#P5594. 【XR-4】模拟赛
【XR-4】模拟赛
Description
School X is holding an in-school training camp before CSP.
There are OIers taking part in this training camp, and the coach has carefully prepared sets of mock contest problems for them.
However, each OIer has their own schedule. Coincidentally, in the next days, each of them happens to have exactly days free to do mock contests.
To make management easier, the coach requires that each person must complete the sets of mock contests in order.
For example, if Xiao X is free on days in the next days, then they must do the st set on day , the nd set on day , and the rd set on day .
The coach needs to prepare for every person’s every mock contest. To reduce workload, if multiple people do the same set of mock contest problems on the same day, then the coach only needs to prepare one mock contest using that set of problems on that day.
As a top student in the lab, the coach wants you to help compute how many mock contests they need to prepare each day.
Input Format
The first line contains three integers .
In the next lines, each line contains integers. The integer in row and column indicates that for the -th person, the -th free day among the next days is day .
Output Format
Output one line with integers. The -th integer indicates the number of mock contests the coach needs to prepare on day among the next days.
1 3 5
2 3 5
0 1 1 0 1
6 3 7
2 3 4
2 5 7
3 5 7
1 3 5
5 6 7
1 2 3
1 2 3 1 3 1 1
10 10 20
2 3 4 8 9 11 12 16 17 18
2 3 6 10 12 13 14 15 19 20
1 3 7 10 11 13 14 15 17 19
1 2 4 6 7 9 15 17 19 20
2 3 5 6 9 11 14 16 19 20
1 2 3 8 9 10 11 12 15 19
1 4 6 7 9 12 13 17 18 19
1 7 8 9 10 11 13 15 18 20
1 5 6 7 8 9 13 16 18 19
4 5 7 10 11 13 14 17 18 20
1 2 2 3 2 2 4 3 3 3 3 4 2 1 3 1 2 2 2 1
Hint
This problem uses bundled tests.
- Subtask 1 (13 points): .
- Subtask 2 (24 points): .
- Subtask 3 (24 points): .
- Subtask 4 (39 points): no special constraints.
For of the testdata, , , .
Translated by ChatGPT 5
京公网安备 11011102002149号