"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. hadoop+javaWeb的开发中遇到包冲突问题(java.lang.VerifyError)

    1.HDFS + WEB 项目 报java.lang.VerifyError... 异常 抛异常: Exception in thread "main" java.lang.Ver ...

  2. Hibernate中一对多和多对一关系

    1.单向多对一和双向多对一的区别? 只需要从一方获取另一方的数据时 就使用单向关联双方都需要获取对方数据时 就使用双向关系 部门--人员 使用人员时如果只需要获取对应部门信息(user.getdept ...

  3. 关于android的单位dp与px

    原文:Android中dp和px之间进行转换 官方文档:http://developer.android.com/guide/practices/screens_support.html The de ...

  4. Java Eclipse进行断点调试

    如何调试Java程序? 大家最开始学习Java,都会觉得IDE调试好高端有木有,其实很简单了. 下文会尽量简单直观的教会你在Eclipse中调试,其他的IDE调试步骤也是类似的. 1.在你觉得有错的地 ...

  5. zTree控件的使用

    最常用的使用方式是json格式 .net递归实现对象生成json格式字符串 代码: using System; using System.Collections.Generic; using Syst ...

  6. sdut 2441 屠夫与狼

    屠夫和狼 Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 题目链接:http://acm.sdut.edu.cn/sdutoj/p ...

  7. annotation-config 和 component-scan 的区别

    <context:annotation-config> 和 <context:component-scan>是Spring Core里面的两个基础概念,每个使用者都有必要理解怎 ...

  8. UML 类关系及画法

    1 泛化 [泛化关系]:是一种继承关系,表示一般与特殊的关系,它指定了子类如何特化父类的所有特征和行为.例如:老虎是动物的一种,即有老虎的特性也有动物的共性. [箭头指向]:带三角箭头的实线,箭头指向 ...

  9. mysql编译时报的一个警告warning: type-punning to incomplete type might break strict-aliasing rules,可能是bug

    cmake的时候报了一个警告: /softdb/mysql-5.5.37/storage/innobase/handler/ha_innodb.cc:11870: warning: type-punn ...

  10. HTML5火焰文字特效DEMO演示---转载

    只有google支持 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> &l ...