Integers
시간 제한2초메모리 제한1024 MB
a·2^b를 더하는 갱신과 k번째 이진 자리를 묻는 질의를 처리한다.
문제
There is an integer , initially zero.
There are operations. Each operation is one of the following types:
1 a b: Add to where is an integer (that can be negative) and is a non-negative integer.2 k: Write in binary, and compute the value of the digit corresponding to a weight of .
It is guaranteed that at any time.
입력
The first line of the input consists of four integers, .
In the following lines, each line describes an operation.
Two adjacent elements in a line are separated by exactly one space.
출력
For each type 2 k query, output a line with an integer (0 or 1) denoting the answer. There shall be no output for each operation of 1 a b.
제한
For all test cases, .
Explanation of
- If a test case has , then .
- If a test case has , then .
- If a test case has , then .
Explanation of
- If a test case has , then .
- If a test case has , then .
- If a test case has , then .
- If a test case has , then .
Explanation of
- If , then all queries are after updates.
- If , then there are no additional constraints.