I have got some impossible queries for you! (or are they? ;) )
You have n binary numbers of length m. The ith binary number is Bi. Also, you have to perform q queries on them. The indexing is zero-based and the indexing of bits starts from left.
The queries are of type : a i j. If a is:
Note : For queries of type 0, 1, and 2, the binary numbers remain unchanged.
It is also recommmended to use Fast I/O for C++ and JAVA programmers.
Input Format
Output Format
Constraints
1≤n,m≤2500
0≤a≤3
0≤i<n
0≤j<m
1≤q≤106 (As usual i have kept a few 'easy' test cases to boost your confidence, but try to get 100 points! :) )
After the first query, the 0th binary number gets changed to : 11
In the second query, the xor operation between 11 and 01 is 10. This string contains a single 1.
In the third query, the and operation between 11 and 01 is 01. This string contains a single 1.