Processing math: 100%
Bitwise operations 1 - MarisaOJ: Marisa Online Judge

Bitwise operations 1

Time limit: 1000 ms
Memory limit: 256 MB
Given a non-negative 32-bit integer, initially all bits of this number are '0'. There are three types of queries: - 1k: Set the k-th bit (i.e., assign the k-th bit to '1'). - 2k: Reset the k-th bit (i.e., assign the k-th bit to '0'). - 3k: Flip the k-th bit (i.e., change '0' to '1' and vice versa). Determine the integer after each query. ### Input - The first line contains an integer q. - The next q lines each contain a query in the specified format. ### Output - After each query, print the resulting integer. ### Constraints - 1≤q≤105. - 0≤k≤31. ### Example Input: 51011203133 Output: 13208