Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in several places, and the ranklists will be merged immediately after the test. Now it is your job to write a program to correctly merge all the ranklists and generate the final rank.

Input Specification:

Each input file contains one test case. For each case, the first line contains a positive number N (≤), the number of test locations. Then N ranklists follow, each starts with a line containing a positive integer K (≤), the number of testees, and then K lines containing the registration number (a 13-digit number) and the total score of each testee. All the numbers in a line are separated by a space.

Output Specification:

For each test case, first print in one line the total number of testees. Then print the final ranklist in the following format:

registration_number final_rank location_number local_rank

The locations are numbered from 1 to N. The output must be sorted in nondecreasing order of the final ranks. The testees with the same score must have the same rank, and the output must be sorted in nondecreasing order of their registration numbers.

Sample Input:

2
5
1234567890001 95
1234567890005 100
1234567890003 95
1234567890002 77
1234567890004 85
4
1234567890013 65
1234567890011 25
1234567890014 100
1234567890012 85

Sample Output:

9
1234567890005 1 1 1
1234567890014 1 2 1
1234567890001 3 1 2
1234567890003 3 1 2
1234567890004 5 1 4
1234567890012 5 2 2
1234567890002 7 1 5
1234567890013 8 2 3
1234567890011 9 2 4

题目分析:就是一道比较题目 蛋疼的是我测试点2 4都没过 检查后才发现比较函数写的有点问题
 Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in several places, and the ranklists will be merged immediately after the test. Now it is your job to write a program to correctly merge all the ranklists and generate the final rank.

 Input Specification:
Each input file contains one test case. For each case, the first line contains a positive number N (≤), the number of test locations. Then N ranklists follow, each starts with a line containing a positive integer K (≤), the number of testees, and then K lines containing the registration number (a -digit number) and the total score of each testee. All the numbers in a line are separated by a space. Output Specification:
For each test case, first print in one line the total number of testees. Then print the final ranklist in the following format: registration_number final_rank location_number local_rank
The locations are numbered from to N. The output must be sorted in nondecreasing order of the final ranks. The testees with the same score must have the same rank, and the output must be sorted in nondecreasing order of their registration numbers. Sample Input: Sample Output:

最新文章

  1. page object
  2. Python Windows环境下安装Python集成开发环境 学习之路(一)
  3. IOS竖屏应用单个页面横屏的解决办法
  4. WCF使用泛型方法的问题
  5. WPF MVVM实现TreeView
  6. 学习chrome 插件 DHC ,http请求传参方法
  7. 【SSH系列】Hibernate映射 -- 继承映射
  8. java自定义注释
  9. Linux的Shell练习--个人笔记
  10. OOm是否可以try catch ?
  11. JavaScript大杂烩7 - 理解内置集合
  12. mysql 5.6 在线 DDL
  13. primary库新增数据文件后,standby库无法创建文件并终止数据同步
  14. 解决IIS7虚拟目录出现HTTP 错误 500.19(由于权限不足而无法读取配置文件)的问题
  15. ABAP空格和零的问题
  16. numpy.squeeze()的用法
  17. JavaEE笔记(十三)
  18. hihocoder第226周:打表找规律
  19. IE访问历史记录恢复工具pasco
  20. 使用mysql 统计函数 结果为null时返回值改为0

热门文章

  1. ASP.NET Core 快速入门(Razor Pages + Entity Framework Core)
  2. Go组件学习:如何读取ini配置文件
  3. php遍历文件夹中所有的文件
  4. css 实战技巧
  5. 【Python】2.11学习笔记 注释,print,input,数据类型,标识符
  6. CSS每日学习笔记(3)
  7. Mybatis(三)Mybatis映射开发
  8. JSP+Servlet+JDBC+Mysql实现的天才会议管理系统
  9. leetcode之820. 单词的压缩编码 | python极简实现字典树
  10. 计算几何-Minimum Area Rectangle II