2019 Summer Hang two day8 test summary

table of Contents

@ (2019 Summer Hang two day8 test summary)

T1

Subject to the effect

There was once a country, national prosperity. Yet we all know that once a country strong again, then there will be many in this country want to host a traitor. So to plain speaking people no matter who, no matter what is put forward suggestions, there can country's demise.

Guo Zili now living in this country, but she does not want the country to this situation. So she wanted to give the king advice.

However, US Secretary of State next to the Swept also know this law, so she saw Guo Zili to plain speaking, concluded that she must be a traitor.

Guo Zili order to prove that he is not a traitor, you need to defeat the Evil in the United States on intelligence. What mental game? Of course, he is playing chess.

U.S. Swept gives a chessboard n × m, and have a life value of the i-th row j-th lattice column \ (A_ {i, j} \) , soldier. Guo Zili need to learn from each value of life of a soldier in order to enhance their abilities, but Guo Zili is a sense of proportion of people, she does not value the life of a soldier would suck all finished, but at least she'll learn a little. Guo Zili after each draw, the United States Evil will conduct a similar operation.

In order to reflect their own tolerance as a minister of the United States Swept simplify the game a bit. Guo Zili can select any soldier row to play the game, that is, selected after each operation can only be carried out on this line. Swept said the United States, and those who learned the value of life that last point line last soldier, then that person will become the guardian of the winner because the force.

Guo Zili certainly do not want to lose, so the value of every life she would soldier on the board to tell you, I hope you told her how many ways can win the election row. But in order not to be discovered cheating, Guo Zili Always ask will be given an interval [l, r], you can only be in the first [l, r] to select the row.
Input
a first row, the two numbers n, m represents the size of the board.

The second row to the n + 1 rows of m positive integer, the number of the i + 1 row j-th column represents the j-th column on the health of the i-th row lattice soldier. N + 2 th row, an integer Q, represents inquiry or modification times.

Next Q lines of a first number is opt, showing operation number. If opt = 1, followed by two numbers l, r represents a query operation. If opt = 2, followed by the five integers x1, y1, x2, y2, p. Will represent (x1, y1) of the upper left corner, (x2, y2) for the lower right corner of each rectangular soldier on health are different lattice or p.
Output
output several lines. For each opt = 1, the output of a number indicating how many rows soldier Guo Zili make certain to win.
\ (n \ times m \ le 100000, Q \ le 100000 \)

However, the United States hopes Guo Zili Swept not so easy to win, so the United States will be subject to change health Swept soldiers on board. Guo Zili help you solve this problem.

sol

SG game, win a row this line if and only if the value of life xor up to zero. It can be compressed into a matrix of n * m n rows, XOR operation is equivalent to the interval, number of intervals to check the number is not zero.

nq violence can water too

Correct answer is block, set \ (F [i] [j] \) for the block i j occurred many times, \ (Tag [i] \) is the i-th block mark. When small modifications violence, change \ (f \) , chunks of marking. Small query violence, inquire how many chunks equal to the number \ (Tag \) , you can calculate how many zeros, minus the total number 0 is the answer.

Guess you like

Origin www.cnblogs.com/hht2005/p/11402641.html