시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
20 초 (추가 시간 없음) | 512 MB | 4 | 3 | 3 | 75.000% |
You are given an array $a$.
Process two types of queries:
The first line contains two integers $n$ and $q$ ($1 \leq n, q \leq 10^6$), the length of $a$ and the number of queries, respectively.
The second line contains $n$ integers $a_i$ ($0 \leq a_i < n$), the elements of $a$.
$q$ lines follow. Each of them has one of the following forms:
For each query of the second type print the corresponding $m$.
6 17 0 0 0 1 2 1 2 0 4 0 2 0 5 0 1 3 2 2 0 4 0 2 0 6 0 2 0 4 2 2 5 6 1 1 0 1 2 1 6 1 2 0 5 1 1 0 0 1 5 5 1 2 2 1 4 4 1 3 3 1 1 1 2 0 6 0
1 2 0 1 2 1 1 2 5