1177"Accepted today?"
2012-07-24 19:20
393 查看
#include<iostream> #include<cmath> #include<string> #include<algorithm> #include<fstream> using namespace std; struct ACmer { int acnum; int time; char h1,h2,m1,m2,s1,s2; }acmer[200]; bool comp(const ACmer &d1,const ACmer &d2) { if(d1.acnum!=d2.acnum) return d1.acnum>d2.acnum; else return d1.time<d2.time; } int main() { //ifstream cin("acmilan.txt"); int pnum,gnum,snum,cnum,m; int i,p,q; while(cin>>pnum>>gnum>>snum>>cnum>>m) { if(pnum==0&&gnum==0&&snum==0&&cnum==0&&m==0) break; for(i=0;i<pnum;i++) { getchar(); scanf("%d %c%c:%c%c:%c%c",&acmer[i].acnum,&acmer[i].h1,&acmer[i].h2,&acmer[i].m1,&acmer[i].m2,&acmer[i].s1,&acmer[i].s2); acmer[i].time=((acmer[i].h1-'0')*10+(acmer[i].h2-'0'))*3600+((acmer[i].m1-'0')*10+(acmer[i].m2-'0'))*60+(acmer[i].s1-'0')*10+(acmer[i].s2-'0'); } p=acmer[m-1].acnum; q=acmer[m-1].time; sort(acmer,acmer+pnum,comp); for(i=0;i<pnum;i++) { if(acmer[i].acnum==p&&acmer[i].time==q) { break; } } if(i+1<=gnum) cout<<"Accepted today? I've got a golden medal :)"<<endl; else if(i+1>gnum&&i+1<=gnum+snum) cout<<"Accepted today? I've got a silver medal :)"<<endl; else if(i+1>gnum+snum&&i+1<=gnum+snum+cnum) cout<<"Accepted today? I've got a copper medal :)"<<endl; else cout<<"Accepted today? I've got an honor mentioned :)"<<endl; } //system("pause"); return 0; }
相关文章推荐
- hdoj 1177 "Accepted today?"
- HDU 1177 "Accepted today?" 水题
- HDOJ 1177 "Accepted today?" (简单模拟)
- HDU 1177 ( "Accepted today?" )
- HDU1177 &quot;Accepted today?&quot;
- hdu1177("Accepted today?")
- hdu-1177-"Accepted today?"
- HDU--杭电--1177--"Accepted today?"--结构体排序
- HDU1177:"Accepted today?"
- HDU 1177."Accepted today?"【结构体排序(水)】【1月6】
- HDU-1177"Accepted today?"
- 【字符串模拟TWO】我又手贱了-HDU 1177 "AC TODAY"
- "today's topic is 'new age'"
- hdu1177:"Accepted today?" 之基数排序
- "Accepted today?"
- 急求解决:如何将TodayScreen插件的宽度设为屏幕宽,就像系统自带的"日期"插件一样,不出现滚动条。
- HDU1177 "Accepted today?"
- A paper: "Parallel Nonparametric Binarization for Degraded Document Images"Accepted
- HDU1177 "Accepted today?"
- Solution for "No network provider accepted the given network path"