#P4024. [CTSC2012] 统计学家
[CTSC2012] 统计学家
Description
Given an integer matrix (, ). You need to answer queries. The ‑th query asks you to count the number of 2D inversion pairs that satisfy all of the following:
- ,
- ,
- .
Input Format
This is an answer-submission problem. The input files are named rev1.in ~ rev10.in.
For each rev*.in, the first line contains three positive integers .
The next lines each contain integers, giving the matrix , where the ‑th number in the ‑th line is . Then the next lines each contain four integers describing the queries; in the ‑th of these lines, the four integers are .
Output Format
On Luogu, output a single integer: the XOR of all answers (i.e., the XOR of the answers to all queries).
Note: The sample is only for understanding the problem and is not the final output format.
(Original answer-submission format for each rev*.out: it contains lines, where the ‑th line is the answer to the ‑th query, i.e., the number of 2D inversion pairs that satisfy the corresponding conditions.)
3 5 3
1 2 3 4 5
9 9 9 9 9
1 4 3 5 2
1 1 2 5
3 1 3 5
2 1 3 5
0
4
19
Hint
Please keep the input files *.in and your outputs *.out safe and back them up in time to avoid accidental deletion.
Translated by ChatGPT 5
京公网安备 11011102002149号