List Sorting   模仿excel,按不同的column进行排序。(未完)

题目描述

Excel can sort records according to any column.  Now you are supposed to imitate this function.

输入描述:

Each input file contains one test case.  For each case, the first line contains two integers N (<=100000) and C, where N is the number of records and C is the column that you are supposed to sort the records with.  Then N lines follow, each contains a record of a student.  A student's record consists of his or her distinct ID (a 6-digit number), name (a string with no more than 8 characters without space), and grade (an integer between 0 and 100, inclusive).

输出描述:

For each test case, output the sorting result in N lines.  That is, if C = 1 then the records must be sorted in increasing order according to ID's; if C = 2 then the records must be sorted in non-decreasing order according to names; and if C = 3 then the records must be sorted in non-decreasing order according to grades.  If there are several students who have the same name or grade, they must be sorted according to their ID's in increasing order.

输入例子:

3 1
000007 James 85
000010 Amy 90
000001 Zoe 60

输出例子:

000001 Zoe 60
000007 James 85
000010 Amy 90

List Sorting相关推荐

  1. 【C++】C++11 STL算法(三):分隔操作(Partitioning operations)、排序操作(Sorting operations)

    目录 分隔操作(Partitioning operations) 一.is_partitioned 1.原型: 2.说明: 3.官网demo 二.partition 1.原型: 2.说明: 3.官方d ...

  2. 阅读Book: MultiObjective using Evolutionary Algorithms (5) ---- Non-Dominated Sorting of a Population

    种群非支配等级排序. Why??不是说就为了找到非支配集合吗? 这个不是多目标中优化中追求的一个goal? 解释: Most evolutionary multi-objective optimiza ...

  3. Codeforces Round #699 (Div. 2) E.Sorting Books(贪心+DP / 线段树)超高质量题解,看不懂来打我 ~

    整理的算法模板合集: ACM模板 点我看算法全家桶系列!!! 实际上是一个全新的精炼模板整合计划 E - Sorting Books 一排书架上有 nnn 本书排成一排,每本书上有一个颜色 aia_i ...

  4. C - A problem of sorting HDU - 5427 sort(cmp)

    C - A problem of sorting HDU - 5427 sort 函数用法 cmp 写法 bool cmp(node a, node b){return a.sum > b.su ...

  5. DNA Sorting(排序)

    欢迎参加--BestCoder周年纪念赛(高质量题目+多重奖励) DNA Sorting Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: ...

  6. Google Python Class --- Sorting

    刚才看到一位朋友谈到如何写出高逼格的文章,想了想确实有道理.所以特意弄一张高清的图片加上高逼格的文字. 坚持是一种品格 学习Python和我的工作关系并不大,但这不重要,因为喜欢所以坚持. 打篮球他们 ...

  7. distribution counting—a sorting method from aocp

    /* *From the art of computer programming:vol 3:Sorting and Searching *时间:2012年3月6日21:02:32 *作者:张超 *E ...

  8. PAT甲级1052 Linked List Sorting:[C++题解]链表排序

    文章目录 题目分析 题目链接 题目分析 题意:给定数据(里面有不构成链表的数据,若是,则跳过),是链表的构成链表.然后根据数值大小重新排序,构成新的链表. 分析:用数组模拟链表,先建立链表.遍历链表, ...

  9. PAT甲级1028 List Sorting:[C++题解]排序,cin和cout会超时

    文章目录 题目分析 题目链接 题目分析 用结构体来存,写三个排序函数. 本题需要注意的点是: 用cin来读会超时,所以用C语言的scanf来读.这样的话,就不能使用string,而是使用char数组. ...

  10. 【PAT】A1028 List Sorting

    Input Specification: Each input file contains one test case. For each case, the first line contains ...

最新文章

  1. getElementById 不能取得visible=false 的控件解决方法
  2. ACE之Proactor模式使用实例
  3. sqlmap参数说明
  4. MongoDB3.4 版本新节点同步的一点惊喜
  5. 2021年自然语言处理(NLP)算法学习路线!
  6. Python魔术世界 1 如何使用Visual Studio在WIN10中一键安装Python3入门编程环境并测试Django...
  7. 在web3上搭建ecshop网上商城
  8. 移动网页广告引入mraid.js使用指南
  9. php操作excel表格的导入和导出
  10. layer子窗口与父窗口传值
  11. java版教材管理系统源码
  12. AI领域最有影响力100人,Hinton只排31、Bengio竟然没有上榜?
  13. 顶级域名、一级域名、二级域名、三级域名的区别
  14. 面试智力题,1000瓶水,其中一瓶有毒,而且毒性无敌,稀释一亿倍毒性都不减,毒性的发作时间最长为1小时,请问怎样可以在两个小时之内找出哪瓶水有毒
  15. webrtc视频卡顿分析一本地视频卡顿
  16. C语言:变量存储类别
  17. 如何使CAD打印PDF显示清楚
  18. park,clark和ipark浅析
  19. 2021哔哩哔哩1024程序员节日第二弹:安全攻防挑战赛
  20. 关于打破思维的墙读后感

热门文章

  1. Physica A 2020 | 链接预测综述(二)
  2. c 连接 mysql 创建数据库_c sqlite创建数据库连接
  3. 使用数据处理技能优化Draftkings NBA阵容
  4. SVNkit-SVNAuthenticationException
  5. jQuery制作照片墙
  6. IEEE Fellow推荐,2023年计算机EI学术会议最新列表,录用率高,审稿周期短!
  7. ios底部栏设计规范_IOS界面设计尺寸标准规范——超级干货
  8. 压缩Html HtmlCompressor
  9. 卷积神经网络(人马分类)
  10. Sketch 51 for Mac(矢量绘图软件)怎么汉化?Sketch 51 for Mac汉化教程