/*

 L (>=60), the lower bound of the qualified grades --
that is, only the ones whose grades of talent and virtue are both not below
this line will be ranked; and H (<100), the higher line of qualification ,those with both grades not below this line are considered as the "sages",
and will be ranked in non-increasing order according to their total grades. Those with talent grades below H but virtue grades not are cosidered as
the "noblemen", and are also ranked in non-increasing order according to
their total grades, but they are listed after the "sages". Those with both grades below H,
but with virtue not lower than talent are considered as the "fool men".
They are ranked in the same way but after the "noblemen". The rest of people whose grades both pass the L line are ranked
after the "fool men". */ #include <string.h>
#include <algorithm>
#include <vector>
#include <stdio.h>
using namespace std; struct peo
{
char num[];
int all,t,v;
int id;
}; bool cmp(peo a,peo b)
{
if(a.id==b.id)
{
if(a.all == b.all)
{
if(a.v == b.v )
return (strcmp(a.num,b.num)<);
else return a.v > b.v;
}
else return a.all > b.all;
}
else return a.id<b.id; } int main()
{ int i,n,low,high,v,t;
char num[];
while(scanf("%d%d%d",&n,&low,&high)!=EOF)
{ vector<peo> VP;
for(i=;i<n;i++)
{
getchar();
scanf("%s %d %d",num,&v,&t);
if(t>=low && v>=low)
{
peo pp;
strcpy(pp.num,num);
pp.v=v;
pp.t=t;
pp.all=v+t;
if(v>=high && t>=high)
pp.id=;
else if(v>= high && t<high)
pp.id=;
else if(v< high && t< high && v>=t)
pp.id=;
else
pp.id=; VP.push_back(pp);
}
} sort(VP.begin(),VP.end(),cmp);
printf("%d\n",VP.size());
for(i=;i<VP.size();i++)
printf("%s %d %d\n",VP[i].num,VP[i].v,VP[i].t); }
return ;
}

1062 Talent and Virtue (25)的更多相关文章

  1. 1062. Talent and Virtue (25)【排序】——PAT (Advanced Level) Practise

    题目信息 1062. Talent and Virtue (25) 时间限制200 ms 内存限制65536 kB 代码长度限制16000 B About 900 years ago, a Chine ...

  2. PAT 甲级 1062 Talent and Virtue (25 分)(简单,结构体排序)

    1062 Talent and Virtue (25 分)   About 900 years ago, a Chinese philosopher Sima Guang wrote a histor ...

  3. 1062 Talent and Virtue (25分)(水)

    About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about ...

  4. pat 1062. Talent and Virtue (25)

    难得的一次ac 题目意思直接,方法就是对virtue talent得分进行判断其归属类型,用0 1 2 3 4 表示 不合格 sage noblemen foolmen foolmen 再对序列进行排 ...

  5. PAT (Advanced Level) 1062. Talent and Virtue (25)

    简单排序.题意较长. #include<cstdio> #include<cstring> #include<cmath> #include<queue> ...

  6. PAT甲题题解-1062. Talent and Virtue (25)-排序水题

    水题,分组排序即可. #include <iostream> #include <cstdio> #include <algorithm> #include < ...

  7. 【PAT甲级】1062 Talent and Virtue (25 分)

    题意: 输入三个正整数N,L,H(N<=1E5,L>=60,H<100,H>L),分别代表人数,及格线和高水平线.接着输入N行数据,每行包括一个人的ID,道德数值和才能数值.一 ...

  8. pat1062. Talent and Virtue (25)

    1062. Talent and Virtue (25) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Li Abou ...

  9. 1062 Talent and Virtue (25 分)

    1062 Talent and Virtue (25 分) About 900 years ago, a Chinese philosopher Sima Guang wrote a history ...

随机推荐

  1. android-ramdisk.img分析、recovery.img&boot.img执行过程

    转载请注明来源:cuixiaolei的技术博客 一.ramdisk介绍 ramdisk通过直面意思就大概能理解意思,ram disk虚拟内存盘,将ram模拟成硬盘来使用的文件系统.对于传统的磁盘文件系 ...

  2. 安装tomcat 证书

    创建证书keystore 1)      Mdmc用户登录服务器,执行如下命令: keytool -genkey -v -alias tomcat -keyalg RSA -keystore tomc ...

  3. DHCP服务详解

    DHCP概念和原理 dhcp服务作用 为大量客户机自动分配地址,提供集中管理 减轻管理和维护成本,提高网络配置效率 可分配的地址信息主要包括: 网卡的IP地址.子网掩码 对应的网络地址 默认网关地址 ...

  4. php.ini详解

    [PHP] ; PHP还是一个不断发展的工具,其功能还在不断地删减 ; 而php.ini的设置更改可以反映出相当的变化, ; 在使用新的PHP版本前,研究一下php.ini会有好处的 ;;;;;;;; ...

  5. Delphi7使用ADO直接连接Excel读取数据

    我之前是连接成功的,现在不知道为什么怎样连都失败.最后才知道是Office版本的问题,office2007已经是基于xml的.和以前的不一样. Excel2003的连接字符串: 'Provider=M ...

  6. C#控制台程序 使用 Server.MapPath,

    (1)添加引用 System.Web. (2)在类中填写 using System.Web 命名空间. (3)写法为: System.Web.HttpContext.Current.Server.Ma ...

  7. hihocoder 1049 后序遍历

    #1049 : 后序遍历 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 在参与过了美食节之后,小Hi和小Ho在别的地方又玩耍了一阵子,在这个过程中,小Ho得到了一个非常 ...

  8. BZOJ 2962

    2962: 序列操作 Time Limit: 50 Sec  Memory Limit: 256 MBSubmit: 618  Solved: 225[Submit][Status][Discuss] ...

  9. MyBatis(3.2.3) - One-to-one mapping using nested Select

    We can get Student along with the Address details using a nested Select query as follows: <result ...

  10. jQuery性能优化(转)

    摘要:jQuery是我们经常使用的强大的JS类库,因此它的性能优化十分重要,下面就重几点来说明 原文作者:szyuxueliang    原文地址:http://www.cnblogs.com/yxl ...