#P3822. [NOI2017] 整数
[NOI2017] 整数
Description
Dr. P abstracts his computation task as operations on an integer.
Specifically, there is an integer , initially .
Then there are operations, each of the following two types:
1 a b: add the integer to , where is an integer and is a nonnegative integer.2 k: ask for the value of the bit of in binary whose weight is (that is, a in this bit represents ).
It is guaranteed that at all times.
Input Format
The first line of input contains four positive integers . The meaning of is given in the problem statement, and the meanings of are given in the subtasks.
Then follow lines, each giving one operation. The specific format and meaning are as described above.
Output Format
For each query operation, output one line representing the answer ( or ). For addition operations, there is no output.
10 3 1 2
1 100 0
1 2333 0
1 -233 0
2 5
2 7
2 15
1 5 15
2 15
1 -1 12
2 15
0
1
0
1
0
Hint
In all test points, , , . Different pairs correspond to the following special restrictions:
- For , .
- For , .
- For , .
- For , .
- For , .
- For , .
- For , .
- For , all query operations appear after all addition operations.
- For , the order between query operations and addition operations is not guaranteed.
There are 25 test points in total, each worth 4 points. The Constraints of each test point are as follows:
::cute-table{tuack}
| Test point ID | ||||
|---|---|---|---|---|
Translated by ChatGPT 5
京公网安备 11011102002149号