시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 512 MB | 21 | 10 | 9 | 64.286% |
You are playing a board game with squares numbered from 0 to 109 (inclusive) and N tokens numbered from 1 to N. Each token is located in one of the squares, and multiple tokens might be located in the same square. Initially, token i is located in square Ti . The distance of the two tokens is the difference between the square number where the first token is located and the square number where the second token is located.
For a set of tokens S, we would like to check whether the tokens are well-separated as follows.
You would like to perform Q operations of either one of these types:
Input begins with a line containing two integers: N Q (2 ≤ N ≤ 100 000; 1 ≤ Q ≤ 100 000) representing the number of tokens and the number of operations, respectively. The next line contains N integers: Ti (0 ≤ Ti ≤ 109) representing the initial square location of the tokens. The next Q lines each contains one of the following input format representing the operation you should perform.
There will be at least one operation of the second type.
For each operation of the second type in the same order as input, output in a line a string “YES
” (without quotes) or “NO
” (without quotes) whether the set of tokens numbered from L to R (inclusive) are well-separated.
5 7 1 1 1 10 1 2 1 3 2 1 5 1 5 4 1 3 7 2 2 4 2 2 5 2 4 5
YES NO NO YES YES
ICPC > Regionals > Asia Pacific > Indonesia > Jakarta > The 2020 ICPC Asia Jakarta Regional Contest J번