![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
排序
julia7_
keep coding
展开
-
B1015/A1062 德才论 (25 分)(排序)
宋代史学家司马光在《资治通鉴》中有一段著名的“德才论”:“是故才德全尽谓之圣人,才德兼亡谓之愚人,德胜才谓之君子,才胜德谓之小人。凡取人之术,苟不得圣人,君子而与之,与其得小人,不若得愚人。”现给出一批考生的德才分数,请根据司马光的理论给出录取排名。输入格式:输入第一行给出 3 个正整数,分别为:N(≤105),即考生总数;L(≥60),为录取最低分数线,即德分和才分均不低于L...原创 2019-01-19 18:05:01 · 156 阅读 · 0 评论 -
A1098 Insertion or Heap Sort (25 分)(插入排序还是堆排序)(排序)
According to Wikipedia:Insertion sortiterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data,...原创 2019-03-10 15:30:13 · 814 阅读 · 0 评论 -
A1080 Graduate Admission (30 分)(考生志愿与录取)(难)
It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if you could write a program to automate the admission...原创 2019-03-06 19:06:32 · 190 阅读 · 0 评论 -
A1075 PAT Judge (25 分)(根据提交信息排序)(难)
Input Specification:每个输入文件包含一个测试用例。对于每种情况,第一行包含3个正整数,n(≤10^4) 用户总数,k(≤5)问题总数,m(≤10^5)提交的总数。然后假设用户ID是从00001到N的5位数字,问题ID是从1到K。下一行包含k个正整数p[i](i=1,…,k),其中p[i]对应第i个问题的满分。然后是M行,每个行以以下格式提供提交的信息:user_i...原创 2019-03-06 17:31:24 · 288 阅读 · 0 评论 -
A1055 The World's Richest (25 分)(输出给定年龄范围内的财富值从大到小排序的前M人信息)
Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest people. Now you are supposed to simulate this job, but concentrate only on the peopl...原创 2019-01-20 16:22:29 · 84 阅读 · 0 评论 -
A1025 PAT Ranking (25 分)(分考场排名、总排名)
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 w...原创 2019-01-16 21:12:32 · 221 阅读 · 0 评论 -
A1016 Phone Bills (25 分)(计算话费)(排序)
A long-distance telephone company charges its customers by the following rules:Making a long-distance call costs a certain amount per minute, depending on the time of day when the call is made. When...原创 2019-03-06 15:20:31 · 307 阅读 · 0 评论 -
排序问题
主要问题:审题要清楚,题目一般给出复杂的顺序,要明白怎样排序 数据量大,采用scanf、printf 平均分并未明说是否需要取整以及取整方式,直接采用总分进行排序即可排名的实现模板:一般的排名规则:分数不同排名不同,分数相同排名相同,但是占用一个排位①. 将排名顺序记录下来stu[0].r = 1;for(int i = 1; i < n; i++){ if...原创 2019-03-06 10:57:25 · 298 阅读 · 0 评论 -
A1012 The Best Rank (25 分)(学生三门课成绩排序)
To evaluate the performance of our first year CS majored students, we consider their grades of three courses only:C- C Programming Language,M- Mathematics (Calculus or Linear Algrbra), andE- Eng...原创 2019-01-20 12:05:14 · 214 阅读 · 0 评论 -
B1035/A1089 插入与归并 (25 分)(排序)(难)
根据维基百科的定义:插入排序是迭代算法,逐一获得输入数据,逐步产生有序的输出序列。每步迭代中,算法从输入序列中取出一元素,将之插入有序序列中正确的位置。如此迭代直到全部元素有序。归并排序进行如下迭代操作:首先将原始序列看成 N 个只包含 1 个元素的有序子序列,然后每次迭代归并两个相邻的有序子序列,直到最后只剩下 1 个有序的序列。现给定原始序列和由某排序算法产生的中间序列,请你判断该...原创 2019-01-27 14:31:51 · 106 阅读 · 0 评论