시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
3 초 | 1024 MB | 165 | 28 | 25 | 20.833% |
You are given a binary sequence $a_1, a_2, \ldots, a_n$ of length $n$. You will also be given $q$ queries of two different types.
The first line contains two integers $n$ and $q$ ($1 \leq n, q \leq 2 \times 10^5$).
The second line contains a binary string of length $n$ denoting the binary sequence $a_1a_2 \ldots a_n$.
Followed by $q$ lines, each is in one of the following formats:
For each query of the second type, if there exists a segment $[s, e]$ satisfying the conditions, print two integers $s$ and $e$ separated by a single space. Otherwise, print $-1$.
If there are multiple possible answers, you may print any.
번호 | 배점 | 제한 |
---|---|---|
1 | 10 | $n, q \leq 100$ |
2 | 20 | $n, q \leq 5000$ |
3 | 30 | You are only given a query of second type. |
4 | 40 | No further constraints. |
4 6 0010 2 1 4 1 1 1 3 0 2 1 4 1 1 2 1 4 3 0 1 4 1 2 1 4 3 1
2 3 -1 1 3 1 4
1 6 1 2 1 1 0 0 2 1 1 1 0 2 1 1 1 1 1 1 0 2 1 1 1 0 2 1 1 0 1
-1 -1 -1 1 1 -1
University > KAIST > 2023 KAIST RUN Spring Contest E번