简单排序。

#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<iostream>
#include<algorithm>
using namespace std; struct X
{
string s;
string c;
int g;
}p[];
int n; bool cmp(const X&a,const X&b)
{
return a.g>b.g;
} int main()
{
scanf("%d",&n);
for(int i=;i<=n;i++)
cin>>p[i].s>>p[i].c>>p[i].g;
sort(p+,p++n,cmp); int flag=;
int L,U; scanf("%d%d",&L,&U);
for(int i=;i<=n;i++)
{
if(p[i].g>=L&&p[i].g<=U)
{
cout<<p[i].s<<" "<<p[i].c<<endl;
flag=;
}
}
if(flag==) printf("NONE\n");
return ;
}

PAT (Advanced Level) 1083. List Grades (25)的更多相关文章

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

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

  2. 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 ...

  3. PAT (Advanced Level) 1114. Family Property (25)

    简单DFS. #include<cstdio> #include<cstring> #include<cmath> #include<vector> # ...

  4. PAT (Advanced Level) 1109. Group Photo (25)

    简单模拟. #include<cstdio> #include<cstring> #include<cmath> #include<vector> #i ...

  5. PAT (Advanced Level) 1105. Spiral Matrix (25)

    简单模拟. #include<cstdio> #include<cstring> #include<cmath> #include<map> #incl ...

  6. PAT (Advanced Level) 1101. Quick Sort (25)

    树状数组+离散化 #include<cstdio> #include<cstring> #include<cmath> #include<map> #i ...

  7. PAT (Advanced Level) 1071. Speech Patterns (25)

    简单题. #include<cstdio> #include<cstring> #include<cmath> #include<vector> #in ...

  8. PAT (Advanced Level) 1063. Set Similarity (25)

    读入之后先排序. 询问的时候可以o(m)效率得到答案. #include<cstdio> #include<cstring> #include<cmath> #in ...

  9. PAT (Advanced Level) 1059. Prime Factors (25)

    素因子分解. #include<iostream> #include<cstring> #include<cmath> #include<algorithm& ...

随机推荐

  1. mysql数据库参数innodb_buffer_pool_size和max_connections

    接到报故,查看mysql数据库以下参数 1.innodb_buffer_pool_size 2.max_connections 该参数定义了数据缓冲区buffer pool大小,类似于oracle的d ...

  2. 把perl脚本编译成exe

    来源:http://www.veryhuo.com/a/view/38338.html 今天想把 perl 脚本编译成 exe 以便脱离 perl 解释器独立运行.都可以生成PERL的PE文件,在PE ...

  3. NoRouteToHostException

    http://stackoverflow.com/questions/1572215/how-to-avoid-a-noroutetohostexception 端口不够用,注意一定要关闭所有不用的连 ...

  4. lepus bug

    ------------------------------------------------BUG fix-------------------------------------------- ...

  5. Delphi XE2 生成的.exe 在未安装有Delphi的电脑上运行提示 “丢失 rtl160.bpl”

    解决方案: XE2中加入了多平台的概念,默认的Release模式,也是带包编译,带运行时库的,所以,需要手工设置一下工程选项: 打开工程以后,Project-->Options-->左侧树 ...

  6. Lua 垃圾收集机制

    1. 问题:一款用Lua做的游戏,玩了一段时间后会变卡 因为知道lua是有自动管理内存的机制,所以之前一直没有关注过lua内存的问题.所以今天好好的查看了lua垃圾收集机制.看了一下Lua的Garba ...

  7. C++中的基本数据类型

    C++中定义了一组表示整数.浮点数.单个字符和布尔值的算术类型(arithmetic type). 另外还定义了一种叫做void的特殊类型.void类型没有对应的值,仅用在有限的一些情况下,通常用作无 ...

  8. 初学.net 网页打开过程

    一个网页打开的过程 1.进入控制器里的方法里  控制器的命名必须以Controll结尾前面的名字要和view层的命名一致 2.控制器完了以后 就进入view层对应的视图里 3.视图里调用model   ...

  9. css 重新学习系列(1)

    来源: http://www.cnblogs.com/Zigzag/archive/2009/04/16/1394356.html CSS之Position详解(1) CSS的很多其他属性大多容易理解 ...

  10. UVA 10759 Dice Throwing

    题意为抛n个骰子凑成的点数和大于或等于x的概率,刚开始用暴力枚举,虽然AC了,但时间为2.227s,然后百度了下别人的做法,交了一遍,靠,0.000s,然后看了下思路,原来是dp,在暴力的基础上记忆化 ...