luogu#P5057. [CQOI2006] 简单题
[CQOI2006] 简单题
Problem Description
There is an array with elements, and each element is initially . There are instructions, and each instruction is one of the following two operations:
- Flip all numbers in a continuous segment. (That is, becomes , and becomes .)
- Query the value of a certain element.
For example, when , the instructions are as follows:

Input Format
The first line contains two integers , representing the length of the array and the number of instructions.
In the next lines, the first number is , representing the type of operation:
- If , then two numbers follow, meaning to flip every number in the interval .
- If , then only one number follows, meaning to query the index.
Output Format
For each operation , output one line (either or ), representing the answer to that query.
20 10
1 1 10
2 6
2 12
1 5 12
2 6
2 15
1 6 16
1 11 17
2 12
2 6
1
0
0
0
1
1
Hint
For of the testdata, , .
For of the testdata, , , and it is guaranteed that .
Translated by ChatGPT 5