-->
当前位置:首页 > 题库

PROGRAMMING:List

Luz5年前 (2021-05-10)题库468
$$Bear$$_$$ 2 $$founded the first session of $$BCPC $$in Qingqing grassland, including $$k $$questions. A total of $$n $$teams participated in the competition and submitted $$M $$times. He wants to rank the team according to the following rules.
1. The team with more questions is preferred
2. In the case of the same number of questions, the less the penalty time, the better
3. In the case of the same number of questions and penalty time, the team with small number has priority.
Note: when a question is passed correctly, the total penalty time should be added with the correct pass time, plus the previous wrong submission times of the question (failed to pass all the test data submission) $$* 20min $$. The total penalty time is the time to pass each question correctly and the penalty time plus the wrong submission time.
For example, suppose that the $$x $$team passes the $$k $$question, and the first correct submission time of each question is $$\ {t}_ 1,...,T_ K \} $$, the number of error submission for each question is $$\ {C}_ 1,...,C_ K\}$$ 。 Then the total penalty time of the team is $$\ sum_{ i=1}^{K}{T_ i+20*C_ i}$$ 。
###Input format:
Input to give a positive integer $$t (1 < = T < = 3) on a line$$
For each group of data, the first line gives a positive integer $$n, m, K (1 < = n < = 10 ^ 5,1 < = m < = 10 ^ 6,1 < = k < = 13) $, which represents the number of teams, the total number of submitted, and the number of competition questions.
In the following $$M $$line, each line gives five integers $$X, y, HH, mm, P (1 < = x < = n, 1 < = y < = k, 0 < = HH < 5,0 < = mm < 60, P = \ {1,0 \}) $$respectively, which means that the $$x $$team submitted the $$y $$question in $$HH $$hours and $$mm $$minutes$$ P = 1 $$means that all test samples have passed this submission; Otherwise, all the test samples failed.
It is guaranteed that the passed questions will not be submitted again, and the sum of all data $$M $$is less than $$10 ^ 6 $$.
###Output format:
According to the order of ranking, each line outputs a team information, including the team number, the number of questions, and the total penalty time, separated by a space.
###Input example:
Here is a set of inputs. For example:
```in
one
4 7 2
4 1 0 1 1
4 2 0 30 1
2 1 0 2 1
1 1 0 1 0
1 1 0 8 1
1 2 0 3 1
3 1 0 1 1
```
###Output example:
The corresponding output is given here. For example:
```out
1 2 31
4 2 31
3 1 1
2 1 2
```
###Tips:
20% data, $$1 < = n < = 10$$
60% of the data, $$1 < = n < = 10 ^ 3$$
For 100% of data, $$1 < = n < = 10 ^ 5 $$< br > < br > < br > < br > < br > is used


answer:If there is no answer, please comment