"Accepted today?"

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 2832    Accepted Submission(s):
1290

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?〃兒
 
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.
 
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.

 
Sample Input

10 1 2 3 6
2 02:45:17
2 02:49:01
2 03:17:58
2 03:21:29
4 07:55:48
3 04:25:42
3 06:57:39
2 02:05:02
2 02:16:45
2 02:41:37
0 0 0 0 0

Sample Output
Accepted today? I've got a silver medal :)
#include <stdio.h>
#include <algorithm>
using namespace std; struct AC
{
int num,h,m,s;
int no;
int k;//k=1金,2银,3铜,4,安慰奖
} a[]; int cmp(AC x,AC y)
{
if(x.num!=y.num)
return x.num>y.num;
if(x.h!=y.h)
return x.h<y.h;
if(x.m!=y.m)
return x.m<y.m;
return x.s<y.s;
} int main()
{
int n,g,s,c,m,i;
while(~scanf("%d%d%d%d%d",&n,&g,&s,&c,&m))
{
if(n+g+s+m+c == )
break;
for(i = ; i<n; i++)
{
a[i].no = i+;
scanf("%d %d:%d:%d",&a[i].num,&a[i].h,&a[i].m,&a[i].s);
}
sort(a,a+n,cmp);
//printf("====\n");
for(i = ; i<n; i++)
{
if(g)
{
a[i].k = ;
g--;
}
else if(s)
{
a[i].k = ;
s--;
}
else if(c)
{
a[i].k = ;
c--;
}
else
{
a[i].k = ;
}
}
for(i = ; i<n; i++)
{
if(a[i].no == m)
{
if(a[i].k == )
printf("Accepted today? I've got a golden medal :)\n");
else if(a[i].k == )
printf("Accepted today? I've got a silver medal :)\n");
else if(a[i].k == )
printf("Accepted today? I've got a copper medal :)\n");
else if(a[i].k == )
printf("Accepted today? I've got an honor mentioned :)\n");
break;
}
}
} return ;
}

"Accepted today?"[HDU1177]的更多相关文章

  1. How to Fix GNOME License Not Accepted Issue on CentOS 7

    This post assume that you have just finished the Gnome GUI installation on CentOS 7 by using “yum gr ...

  2. Spark优化之二:集群上运行jar程序,状态一直Accepted且不停止不报错

    如果运行Spark集群时状态一直为Accepted且不停止不报错,比如像下面这样的情况: 15/06/14 11:33:33 INFO yarn.Client: Application report ...

  3. mapreduce作业状态一直是ACCEPTED

    搭建yarn环境后,执行 hadoop/bin/hadoop jar hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.4.1.jar ...

  4. centos7安装出现license information(license not accepted)解决办法

    若出现license information(license not accepted),即说明需要同意许可信息,输入1-回车-2-回车-c-回车-c回车,即可解决.

  5. Accepted Necklace

    Accepted Necklace Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) T ...

  6. SubsetsTotal Accepted:49746Total Submissions:176257My Submissions

    Subsets Total Accepted: 49746 Total Submissions: 176257My Submissions Given a set of distinct intege ...

  7. hdu 2660 Accepted Necklace

    题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=2660 Accepted Necklace Description I have N precious ...

  8. spark on yarn :state: ACCEPTED一直 出现

    今天运行spark on yarn 一直出现 16/09/20 18:40:41 INFO yarn.Client: Application report for application_147417 ...

  9. Spark之submit任务时的Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient memory

    Spark submit任务到Spark集群时,会出现如下异常: Exception 1:Initial job has not accepted any resources; check your ...

随机推荐

  1. poj 2104:K-th Number(划分树,经典题)

    K-th Number Time Limit: 20000MS   Memory Limit: 65536K Total Submissions: 35653   Accepted: 11382 Ca ...

  2. Git学习笔记 git revert

    我们难免会因为种种原因执行一些错误的commit / push,git提供了revert命令帮助程序员修复这样的错误. 举个例子,下图是git commit 的历史记录 git revert 命令会通 ...

  3. Oracle Segments可以跨多个data files吗?

    首先,你需要明白的一点是:数据库的物理结构是由数据库的操作系统文件所决定,每一个Oracle数据库是由三种类型的文件组成:数据文件.日志文件和控制文件.数据库的文件为数据库信息提供真正的物理存储.每一 ...

  4. PHP5中使用PDO连接数据库的方法

    PDO(PHP Data Object) 是PHP 中加入的东西,是PHP 5新加入的一个重大功能,因为在PHP 5以前的php4/php3都是一堆的数据库扩展来跟各个数据库的连接和处理,php_my ...

  5. 【leetcode】Single Number && Single Number II(ORZ 位运算)

    题目描述: Single Number Given an array of integers, every element appears twice except for one. Find tha ...

  6. VS2012 配置 OpenCV3.0

    VS2012 配置 opencv3.0,相比之前的版本,3.0的配置简单了好多. 通过配置属性文件,可以做到一次配置,重复使用! 根据文章的操作在 win7 64bit VS2012 下成功配置 op ...

  7. 装饰模式/decorator模式/结构型模式

    装饰模式Decorator 定义 为对象动态的增加新的功能,实现要求装饰对象和被装饰对象实现同一接口或抽象类,装饰对象持有被装饰对象的实例. java实现要点 定义一个接口或抽象类,作为被装饰者的抽象 ...

  8. Salesforce中所有常用类型字段的取值与赋值

    Salesforce中所有常用字段类型的定义以及如何用代码进行取值和赋值: Field Type的定义: http://www.salesforce.com/us/developer/docs/api ...

  9. loj 1377 (bfs)

    题目链接:http://lightoj.com/volume_showproblem.php?problem=1377 思路:这道题只要处理好遇到"*"这种情况就可以搞定了.我们可 ...

  10. 写给自己的web开发资源

    web开发给我的感觉就是乱七八糟,而且要学习感觉总是会有东西要学习,很乱很杂我也没空搞,(其实学习这个的方法就是去用它,什么你直接用?学过js么学过jquery么?哈哈,我没有系统的看完过,但是也做出 ...