luogu#P3822. [NOI2017] 整数
[NOI2017] 整数
Background
At the summit of human wisdom, there is a supercomputer with a word length of bits (this number is irrelevant to solving the problem). Dr. P, a famous theoretical computer scientist, is using it for various research. Unfortunately, a typhoon cut off the power system today, and the supercomputer cannot work. Dr. P needs to submit the experimental results tomorrow, so he has to ask you, who have studied OI, for help...
Problem 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