#P6688. 可重集
可重集
Description
You are given a non-negative integer sequence of length , and operations. Each operation first gives a parameter :
-
If , then two parameters are given, and you need to modify to .
-
If , then four parameters are given (it is guaranteed that ). You need to determine whether the interval and the interval are essentially the same. If they are, output
YES, otherwise outputNO.
Definition of being essentially the same: let the interval length be . Let the sequence be the result of sorting in non-decreasing order, and let the sequence be the result of sorting in non-decreasing order. There exists an integer such that .
Input Format
The first line contains two positive integers , representing the length of the sequence and the number of operations.
The second line contains non-negative integers, representing .
The next lines each describe one of the operations above.
Output Format
For each operation with , output whether the two intervals are essentially the same. If yes, output YES, otherwise output NO.
12 6
1 1 4 5 1 4 2 2 5 2 3 3
1 1 3 7 9
1 2 3 5 6
1 1 3 2 4
0 7 1
1 1 4 2 5
1 5 7 8 10
YES
YES
NO
YES
YES
Hint
-
Subtask 1 ( pts): .
-
Subtask 2 ( pts): , .
-
Subtask 3 ( pts): .
-
Subtask 4 ( pts): no special constraints.
You can only get the score of a subtask if you pass all testdata in that subtask.
For all data: , , . Also, for all , .
Translated by ChatGPT 5
京公网安备 11011102002149号