亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 學院 > 開發設計 > 正文

PAT A1062. Talent and Virtue (25)

2019-11-10 20:44:05
字體:
來源:轉載
供稿:網友

About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people's talent and virtue. According to his theory, a man being outstanding in both talent and virtue must be a "sage(圣人)"; being less Excellent but with one's virtue outweighs talent can be called a "nobleman(君子)"; being good in neither is a "fool man(愚人)"; yet a fool man is better than a "small man(小人)" who PRefers talent than virtue.

Now given the grades of talent and virtue of a group of people, you are supposed to rank them according to Sima Guang's theory.

Input Specification:

Each input file contains one test case. Each case first gives 3 positive integers in a line: N (<=105), the total number of people to be ranked; 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 -- that is, 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".

Then N lines follow, each gives the information of a person in the format:

ID_Number Virtue_Grade Talent_Gradewhere ID_Number is an 8-digit number, and both grades are integers in [0, 100]. All the numbers are separated by a space.

Output Specification:

The first line of output must give M (<=N), the total number of people that are actually ranked. Then M lines follow, each gives the information of a person in the same format as the input, according to the ranking rules. If there is a tie of the total grade, they must be ranked with respect to their virtue grades in non-increasing order. If there is still a tie, then output in increasing order of their ID's.

Sample Input:
14 60 8010000001 64 9010000002 90 6010000011 85 8010000003 85 8010000004 80 8510000005 82 7710000006 83 7610000007 90 7810000008 75 7910000009 59 9010000010 88 4510000012 80 10010000013 90 9910000014 66 60Sample Output:
1210000013 90 9910000012 80 10010000003 85 8010000011 85 8010000004 80 8510000007 90 7810000006 83 7610000005 82 7710000002 90 6010000014 66 6010000008 75 7910000001 64 90
#include <cstdio>#include <algorithm>#include <cmath>#include <cstring>#define Max 123000using namespace std;struct man{	char ID[9];	int Virtue;	int Talent;	int grade;	int Sum;}M[Max],N[Max];bool cmp(man a,man b){	if(a.grade!=b.grade)return a.grade<b.grade;	else if (a.Sum!=b.Sum) return a.Sum>b.Sum;	else if(a.Virtue!=b.Virtue)  return a.Virtue>b.Virtue;	else return strcmp(a.ID,b.ID)<0;		}int main(){	int n,v1,t1;	int k=0,f=0;	scanf("%d %d %d",&n,&v1,&t1);	for( k=0;k<n;k++)	{		scanf("%s %d%d",M[k].ID,&M[k].Virtue,&M[k].Talent);		M[k].Sum=M[k].Virtue+M[k].Talent;		if(M[k].Virtue>=t1&&M[k].Talent>=t1) M[k].grade=1;		else if(M[k].Virtue>=t1&&M[k].Talent<t1) M[k].grade=2;		else if(M[k].Virtue>=M[k].Talent) M[k].grade=3;		else if(M[k].Virtue<M[k].Talent) M[k].grade=4;		 if(M[k].Virtue<v1||M[k].Talent<v1) M[k].grade=5;		if(M[k].Virtue>=v1&&M[k].Talent>=v1) f++;			}		sort(M,M+n,cmp);	printf("%d/n",f);	for(int i=0;i<f;i++)	{		printf("%s %d %d/n",M[i].ID,M[i].Virtue,M[i].Talent);	}	system("pause");	return 0;}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
一区二区欧美亚洲| 日韩精品在线播放| 亚洲国内精品在线| 国产精品入口日韩视频大尺度| 97超视频免费观看| 久久夜精品香蕉| 91国在线精品国内播放| 久久的精品视频| 国产精品极品美女粉嫩高清在线| 国产日产欧美精品| 91成品人片a无限观看| 美女av一区二区| 亚洲3p在线观看| 国产精品国产三级国产aⅴ9色| 欧美日韩在线视频观看| 久久精品男人天堂| 欧美激情国产高清| 亚洲精品一区二区三区婷婷月| 亚洲国产精品久久精品怡红院| 国产精品青青在线观看爽香蕉| 91在线免费看网站| 美女福利视频一区| 92版电视剧仙鹤神针在线观看| 精品久久久久人成| 国产自产女人91一区在线观看| 精品久久国产精品| 美女国内精品自产拍在线播放| 日韩久久免费视频| 久久精品影视伊人网| 国产欧美亚洲精品| 北条麻妃在线一区二区| 北条麻妃一区二区三区中文字幕| 91免费综合在线| 国产经典一区二区| 欧美中文字幕视频在线观看| 欧美激情第6页| 欧美色videos| 青草青草久热精品视频在线观看| 日韩成人在线免费观看| 另类少妇人与禽zozz0性伦| 日本久久中文字幕| 久久在线视频在线| 一区二区三区高清国产| 久久99精品久久久久久青青91| 日韩免费精品视频| 久久中文字幕在线视频| 欧美激情一二三| 国产精品免费一区豆花| 最近2019中文字幕大全第二页| 中文字幕精品久久久久| 国产精品黄页免费高清在线观看| 欧美日韩亚洲系列| 中国china体内裑精亚洲片| 日韩资源在线观看| 日韩中文字幕在线| 欧美乱人伦中文字幕在线| 欧美日韩亚洲国产一区| 成人福利网站在线观看| 久久艳片www.17c.com| 国模gogo一区二区大胆私拍| 国产精品91免费在线| 国产精品久久久久久久久借妻| 久久久久久网站| 国模精品视频一区二区| 美女啪啪无遮挡免费久久网站| 亚洲国产精品va在线看黑人| 国产欧洲精品视频| 亚洲一区二区三区在线视频| 91成人免费观看网站| 亚洲老板91色精品久久| 亚洲美女视频网站| 国产一区欧美二区三区| 国产自产女人91一区在线观看| 亚洲va欧美va国产综合剧情| 97视频在线免费观看| 欧美理论电影在线播放| 久久久久国产精品免费| 国产精品入口日韩视频大尺度| 精品国产一区二区三区久久狼黑人| 欧美一区二区三区精品电影| 午夜精品久久久久久久白皮肤| 欧美一区二三区| 亚洲影视中文字幕| 国产高清在线不卡| 国产精品视频地址| 日韩在线观看网址| 亚洲欧美日韩一区二区三区在线| 亚洲国产精品成人一区二区| 亚洲黄色av网站| 国产有码一区二区| 精品国产一区二区三区在线观看| 亚洲国产日韩欧美在线动漫| 一本一本久久a久久精品综合小说| 久久久国产精彩视频美女艺术照福利| 国产成人在线一区二区| 亚洲人在线视频| 8x海外华人永久免费日韩内陆视频| 亚洲成人a**站| 精品视频在线播放色网色视频| 色系列之999| 亚洲国产一区二区三区四区| 久久精品国产欧美亚洲人人爽| 国产日韩欧美中文在线播放| 热99精品只有里视频精品| 国产日韩欧美日韩大片| 国产精品白嫩美女在线观看| 日本午夜精品理论片a级appf发布| 国产欧美精品在线播放| 日韩成人在线网站| 欧美激情免费视频| 2020欧美日韩在线视频| 久久精品久久久久久国产 免费| 这里只有精品久久| 国产极品精品在线观看| 中文字幕亚洲一区在线观看| 韩国视频理论视频久久| 怡红院精品视频| 亚洲欧洲av一区二区| 日韩中文字幕欧美| 成人精品在线视频| 亚洲精品国产拍免费91在线| 日韩在线观看精品| 亚洲欧美成人网| 国产亚洲成av人片在线观看桃| 亚洲午夜av电影| 国产激情久久久久| 精品国产欧美一区二区五十路| 亚洲欧美日韩一区二区三区在线| 欧美在线视频播放| 伊人av综合网| 欧美日韩国产精品一区二区不卡中文| 国产精品日韩在线一区| 久久久亚洲福利精品午夜| 国产日本欧美一区| 91av成人在线| 97香蕉超级碰碰久久免费的优势| 红桃av永久久久| 日韩欧美主播在线| 国产精品ⅴa在线观看h| 久久久久久国产| 久久福利网址导航| 久久久久久999| 国产精品丝袜视频| 国产剧情日韩欧美| 国产美女精品免费电影| 国产亚洲精品日韩| 国产成人在线亚洲欧美| 欧美黑人一区二区三区| 欧美人与物videos| 92国产精品久久久久首页| 亚洲高清av在线| 欧美激情在线视频二区| 久久久免费电影| 成人av在线网址| 欧美午夜精品久久久久久人妖| 日韩高清免费观看| 国产精品久久久久久久久久三级| 最近2019中文免费高清视频观看www99| 成人在线视频福利| 国产精品福利久久久| 国产在线观看精品| 亚洲成人精品av| 日本一欧美一欧美一亚洲视频| 日韩专区中文字幕|