杭电1177-Accepted today
来源:互联网 发布:windows 酷炫主题包 编辑:程序博客网 时间:2024/06/07 10:17
"Accepted today?"
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2031 Accepted Submission(s): 895
Problem Description
Do you remember a sentence "Accepted today?" Yes, the sentence is mentioned frequently in lcy's course "ACM Programming"!
The contest is still in progress this moment. How excited it is! You, smart programmer, must have AC some problems today. "Can I get copper medal, silver medal, or even golden medal?" Oh, ha-ha! You must be considering this question. And now, the last problem of this contest comes.
Give you all submitting data in the contest, and tell you the number of golden medals, silver medals and copper medals; your task is to output someone's contest result.
Easy? Of course! I t is the reason that I designed the problem.
When you have completed this contest, please remember that sentence〃 Accepted today?〃兒
The contest is still in progress this moment. How excited it is! You, smart programmer, must have AC some problems today. "Can I get copper medal, silver medal, or even golden medal?" Oh, ha-ha! You must be considering this question. And now, the last problem of this contest comes.
Give you all submitting data in the contest, and tell you the number of golden medals, silver medals and copper medals; your task is to output someone's contest result.
Easy? Of course! I t is the reason that I designed the problem.
When you have completed this contest, please remember that sentence〃 Accepted today?〃兒
Input
Input contains multiple test cases. Each test case starts with five numbers N (4 =< N <= 130 -- the total number of attendees), G, S, C (1<=G<=S<=C<N --G, S, C denoting the number of golden medals, silver medals and copper medals respectively) and M (0<M<=N). The next N lines contain an integer P (1<=P<=8 --number of problems that have been solved by someone) and a time T(for example,"02:45:17", meaning 2 hours and 45 minutes and 17 seconds consumed according to contest rules) each. You can assume that all submit data are different.
A test case starting with 0 0 0 0 0 terminates input and this test case should not to be processed.
A test case starting with 0 0 0 0 0 terminates input and this test case should not to be processed.
Output
For each case, print a sentence in a line, and it must be one of these sentences:
Accepted today? I've got a golden medal :)
Accepted today? I've got a silver medal :)
Accepted today? I've got a copper medal :)
Accepted today? I've got an honor mentioned :)
Note:
You will get an honor mentioned if you can't get copper medal, silver medal or golden medal.
Accepted today? I've got a golden medal :)
Accepted today? I've got a silver medal :)
Accepted today? I've got a copper medal :)
Accepted today? I've got an honor mentioned :)
Note:
You will get an honor mentioned if you can't get copper medal, silver medal or golden medal.
Sample Input
10 1 2 3 62 02:45:172 02:49:012 03:17:582 03:21:294 07:55:483 04:25:423 06:57:392 02:05:022 02:16:452 02:41:370 0 0 0 0Sample OutputAccepted today? I've got a silver medal :)
题目意思看了好久才明白:就是给你n个人AC题目数目(注意是题目数量不是题目编号)和最后AC时间,再给你金奖,银奖,铜奖的数目,再给你一个人的在这个n个人中的编号,问这个人可以拿什么奖或者都拿不到拿个荣誉奖,这题理解好题目就是水题AC代码:#include<iostream>#include<cstring>#include<algorithm>const int MAX=200;using namespace std;typedef struct AC{int num;char t[10];};AC k[MAX];bool cmp1(AC a,AC b){if(a.num>b.num)return true;else if(a.num==b.num){if(strcmp(a.t,b.t)<0)return true;elsereturn false;}elsereturn false;}int main(){int n,g,s,c,m,mingci;int i,j;while(cin>>n>>g>>s>>c>>m&&(n||g||s||c||m)){for(i=0;i<n;i++){cin>>k[i].num>>k[i].t;}AC x;x=k[m-1];sort(k,k+n,cmp1);mingci=1;for(i=0;i<10;i++){if(x.num==k[i].num&&strcmp(x.t,k[i].t)==0)break;elsemingci+=1;}if(mingci<=g)cout<<"Accepted today? I've got a golden medal :)"<<endl;else if(mingci<=g+s)cout<<"Accepted today? I've got a silver medal :)"<<endl;else if(mingci<=g+c+s)cout<<"Accepted today? I've got a copper medal :)"<<endl;elsecout<<"Accepted today? I've got an honor mentioned :)"<<endl;}return 0;}
- 杭电1177-Accepted today
- HDU杭电 1177 Accepted today
- HDU--杭电--1177--"Accepted today?"--结构体排序
- HDU 1177 ( "Accepted today?" )
- 1177"Accepted today?"
- HDU-1177"Accepted today?"
- hdu-1177-"Accepted today?"
- hdoj 1177 "Accepted today?"
- HDU 1177 "Accepted today?" 水题
- HDOJ 1177 "Accepted today?" (简单模拟)
- HDU1177:"Accepted today?"
- hdu1177("Accepted today?")
- 【杭电2112】HDU Today
- 杭电 HDU 2660 Accepted Necklace
- HDU1177 "Accepted today?"
- hdu1177:"Accepted today?" 之基数排序
- 杭电-2112 HDU Today(dijkstra)
- 【最短路+模板题】杭电 hdu 2112 HDU Today
- Linux Shell脚本编程--wget 命令用法详解
- 您应该关注的几个eclipse插件
- OpenCV学习笔记(三)人脸检测的代码分析(1)
- c/C++ 求一个二进制数中有多少个1
- ubuntu 12.04中超强两笔输入法的安装与配置
- 杭电1177-Accepted today
- glog函数调用出现c++:void value not ignored as it ought to be错误
- OpenCV学习笔记(三)人脸检测的代码分析(2)
- windows bat批处理语法简析
- java简易算法+循环版动态日历(包含周六周日和当前日期标识)
- MongoDB配置用户安全模式
- python lambda函数
- C#制作WinForm控件 .
- OpenCV学习笔记之二――基于Haar-like特征的层叠推进分类器快速