"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. 继承下public,protected,private访问权限

    C++中派生类对基类成员的访问形式主要有以下两种: 1.内部访问:由派生类中新增成员对基类继承来的成员的访问. 2.对象访问:在派生类外部,通过派生类的对象对从基类继承来的成员的访问.今天给大家介绍在 ...

  2. C#学习笔记----AppDomain应用程序域

    使用.Net建立的可执行程序*.exe,并没有直接承载到进程当中,而是承载到应用程序域(AppDomain)当中.应用程序域是.Net引入的一个新概念,它比进程所占用的资源要少,可以被看做是一个轻量级 ...

  3. js获取url参数值(HTML之间传值)

    <h3>未设置设备: <a href="javascript:addTab('设备列表','PKE_DeviceContent/PKE_DeviceContent.aspx ...

  4. <转>SQL语句执行顺序说明

    原文地址:http://www.cnblogs.com/summer_adai/archive/2011/10/28/2227605.html SQL 不同于与其他编程语言的最明显特征是处理代码的顺序 ...

  5. android 入门-防微信拍摄视频 按钮事件处理

    package com.cc.view; import com.cc.R; import com.cc.R.layout; import com.cc.R.menu; import android.o ...

  6. hdu 4272 2012长春赛区网络赛 dfs暴力 ***

    总是T,以为要剪枝,后来发现加个map就行了 #include<cstdio> #include<iostream> #include<algorithm> #in ...

  7. How to use Ajax on Visualforce page on Salesforce platform

    Just use Ajax pattern to call object data from server on visualforce page. Following is the Asynchro ...

  8. T-SQL 基础编程

    Ø Go批处理语句 用于同时执行多个语句 Ø 使用.切换数据库 use master go Ø 创建.删除数据库 方法1. --判断是否存在该数据库,存在就删除 if (exists (select ...

  9. Android自动化压力测试之Monkey Test (三)

    Monkey 是什么? Monkey是Google提供的一个用于稳定性与压力测试的命令行工具. Monkey路径: 路径:/System/framework/monkey.jar 启动脚本路径:/sy ...

  10. 自定义ActionBar

    /** * 1.创建ActionBar对象getSupportActionBar() * 2.布置自己的ActionBar布局(在res/layout) * 3.把自定义的ActionBar布局加载到 ...