编程介的小学生 2017-08-27 02:22 采纳率: 20.5%
浏览 667
已采纳

Final Ranklist

The programming contest is getting so popular in Zhejiang that a multi-site provincial contest has to be considered. Instead of having all the contestants competing at Zhejiang University, there will be N sites scattered in Zhejiang Province. All sites will share the same problem set, run the contests simultaneously, and have their separated ranklists. When the contests are over, all the N ranklists will be collected and merged into one with Final Standings.

Your job is to write a program to generate the Final Standings and to obtain the statistics.

Input
The input consists of multiple contests. For each contest, the first line contains two positive integers N (<=10) and M (<=10) which are the numbers of sites and problems, respectively. Then N blocks follow, each contains the number of teams, T (0<=T<=300), of that site, and T lines of records. A line of record is given in the following format:

Rank TeamID Solved status[1] ... status[M] Time

where Rank is the rank of that team in that site starting from 1, TeamID is a string of no more than 10 characters and is distinct for each team in a contest, Solved is the number of problems solved by that team, Time is the total penalty in hh:mm:ss, and status[i] is one of the following: "0" if solution i has never been submitted during the contest; "-w" if solution i has been submitted for w times yet has not been accepted; "hh:mm:ss (w)" if solution i has been submitted for w times and has been accepted at the time hh:mm:ss.

Output
For each contest, first print the merged Final Standings in the same record format as in the input, except that all the teams that have solved the same number of problems and have exactly the same penalty times must have the same rank, and are sorted in increasing order according to their TeamID's.

After the standing list is out, print in the last line the following statistics:
Total Teams: NT; Solved N1: T1; Solved N2: T2; ...; Solved Nk: Tk.

where NT is the total number of teams participated in this contest, N1 and Nk are the positive maximum and minimum numbers of problems solved by any team respectively, and Ti is the positive number of teams that have solved Ni problems. Ni's are given in decreading order.
There must be a blank line separating two contests, but no extra line at the end of output.

Sample Input:
2 3
2
1 team1 1 0 -3 00:45:21 (2) 01:05:21
2 team11 0 -5 -8 -1 00:00:00
3
1 team2 2 00:20:00 (1) -5 00:45:21 (1) 01:05:21
2 team12 1 01:05:21 (1) 0 0 01:05:21
3 team6 0 0 0 -2 00:00:00
2 4
2
1 team11 1 00:20:00 (1) -8 -1 0 00:20:00
2 team1 1 0 -3 00:45:21 (2) 0 01:05:21
2
1 team2 3 00:05:25 (1) 00:45:16 (2) 0 03:21:59 (1) 04:32:40
2 team3 0 0 0 0 -2 00:00:00
1 8
1
1 jury 0 0 0 0 0 0 -10 0 0 00:00:00
Sample Output:
1 team2 2 00:20:00 (1) -5 00:45:21 (1) 01:05:21
2 team1 1 0 -3 00:45:21 (2) 01:05:21
2 team12 1 01:05:21 (1) 0 0 01:05:21
3 team11 0 -5 -8 -1 00:00:00
3 team6 0 0 0 -2 00:00:00
Total Teams: 5; Solved 2: 1; Solved 1: 2.

1 team2 3 00:05:25 (1) 00:45:16 (2) 0 03:21:59 (1) 04:32:40
2 team11 1 00:20:00 (1) -8 -1 0 00:20:00
3 team1 1 0 -3 00:45:21 (2) 0 01:05:21
4 team3 0 0 0 0 -2 00:00:00
Total Teams: 4; Solved 3: 1; Solved 1: 2.

1 jury 0 0 0 0 0 0 -10 0 0 00:00:00
Total Teams: 1.

  • 写回答

1条回答 默认 最新

  • devmiao 2017-08-27 15:53
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决