#include <cstdio>
#include <cstdlib> using namespace std; class Stu {
public:
char name[];
char id[];
}; int main() {
int N = ;
// because all the grades are distinct & grade in range of [0, 100]
// use simplified bucket sort here
Stu* stu[] = {};
int grade;
scanf("%d", &N);
for (int i=; i<N; i++) {
Stu* tmp = new Stu();
scanf("%s%s%d", tmp->name, tmp->id, &grade);
stu[grade] = tmp;
} int lo, hi;
scanf("%d%d", &lo, &hi);
if (lo > hi) {
int tmp = lo;
lo = hi;
hi = tmp;
}
bool has = false;
for (int i=hi; i>=lo; i--) {
if (stu[i] == NULL) continue;
has = true;
printf("%s %s\n", stu[i]->name, stu[i]->id);
}
if (!has) {
printf("NONE");
}
return ;
}

完成每日任务,睡觉了可以!

PAT 1083 List Grades的更多相关文章

  1. PAT 1083 List Grades[简单]

    1083 List Grades (25 分) Given a list of N student records with name, ID and grade. You are supposed ...

  2. PAT 甲级 1083 List Grades (25 分)

    1083 List Grades (25 分) Given a list of N student records with name, ID and grade. You are supposed ...

  3. PAT 甲级 1083 List Grades

    https://pintia.cn/problem-sets/994805342720868352/problems/994805383929905152 Given a list of N stud ...

  4. 【PAT甲级】1083 List Grades (25 分)

    题意: 输入一个正整数N(<=101),接着输入N个学生的姓名,id和成绩.接着输入两个正整数X,Y(0<=X,Y<=100),逆序输出成绩在x,y之间的学生的姓名和id. tric ...

  5. PAT (Advanced Level) 1083. List Grades (25)

    简单排序. #include<cstdio> #include<cstring> #include<cmath> #include<vector> #i ...

  6. 1083. List Grades (25)

    the problem is from PAT,which website is http://pat.zju.edu.cn/contests/pat-a-practise/1083 and the ...

  7. PAT 1083 是否存在相等的差(20)(代码+思路)

    1083 是否存在相等的差(20 分) 给定 N 张卡片,正面分别写上 1.2.--.N,然后全部翻面,洗牌,在背面分别写上 1.2.--.N.将每张牌的正反两面数字相减(大减小),得到 N 个非负差 ...

  8. PTA(Advanced Level)1083.List Grades

    Given a list of N student records with name, ID and grade. You are supposed to sort the records with ...

  9. 1083 List Grades

    Given a list of N student records with name, ID and grade. You are supposed to sort the records with ...

随机推荐

  1. linux系统安全及应用——PAM安全认证

    一.PAM认证模块介绍 PAM认证模块,叫做可插拔式的认证模块.一项重要的功能就是为了加强su命令的使用控制,可以借助于PAM认证模块,只允许极个别用户使用su命令进行切换.PAM提供了对所有服务进行 ...

  2. centos安装mysql57

    下载源安装文件 https://dev.mysql.com/downloads/repo/yum/ wget http://repo.mysql.com//mysql57-community-rele ...

  3. behave 测试框架,了解一下

    # behave测试框架 [behave](https://pythonhosted.org/behave/)是python的1个bdd测试框架实现. ### 安装 ```pip install be ...

  4. springcloud微服务总结五 服务熔断

    一:雪崩效应 如下图所示:A作为服务提供者,B为A的服务消费者,C和D是B的服务消费者.A不可用引起了B的不可用,并将不可用像滚雪球一样放大到C和D时,导致整个系统瘫痪,雪崩效应就形成了. 雪崩过程: ...

  5. EasyUI学习笔记(三)—— message和menubutton的使用

    一.message(消息框) 1.1 alert   <script type="text/javascript"> $(function () { // alert方 ...

  6. python安装环境配置、python模块添加、sublime text编辑器配置

    前提: 本文讲述的是  windows环境 python相应的安装配置. 进入官网找安装包,官网地址如下:https://www.python.org/downloads/ 找到相应2.7.x或3.x ...

  7. POJ_1984 Navigation Nightmare 【并查集】

    一.题面 POJ1984 二.分析 这题还是比较有意思的一题. 首先需要清楚的是,这题与普通并查集的区别在于它的节点之间的权值是二维的,因为是曼哈顿距离,肯定不能直接存距离,这样将不利于后面的路径压缩 ...

  8. bzoj1818 内部白点(好题) 离散化+树状数组

    题目传送门 题意:给出很多黑点,当一个坐标上下左右都有黑点时,这个点也被染成黑色,问最后黑点的数量. 思路:首先,一个很显然的结论,不可能出现无限染色的情况.所以不会输出-1,当n为0或者1时,答案就 ...

  9. WPF 布局

    WPF布局原则 WPF窗口只能包含单个元素,为在WPF窗口中放置多个元素并创建更贴近使用的用户界面,需要在窗口上放置一个容器,然后在这个容器中添加其他元素 遵循以下几条重要原则 不应显式设定元素(如控 ...

  10. HDU - 1223 DP 分类

    据说这个是经典问题 \(dp[i][j]=dp[i-1][j-1]*j+dp[i-1][j]*j\) \(dp[i][j]\)表示前i个数分为j个集合,[i-1][j-1]为插入小于号[i-1][j] ...