ZZULI_SUMMER_PRACTICE(7)nbsp;1177nbsp;nbsp;quot;…

2023-10-20 03:48

本文主要是介绍ZZULI_SUMMER_PRACTICE(7)nbsp;1177nbsp;nbsp;quot;…,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

"Accepted today?"

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


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 :)

Author
lcy
简单题就是求序号为m的那个得了什么奖牌,
代码:
#include<stdio.h>
#include<stdlib.h>
struct point{
int problem,time,index;
}map[150];
int cmp(const void *a,const void *b)
{
struct point *c,*d;
c=(struct point *)a;
d=(struct point *)b;
if(c->problem!=d->problem)
return d->problem-c->problem;
else return c->time-d->time;
}
int main()
{
int hour,minute,second,i,n,g,s,c,m;
while(scanf("%d%d%d%d%d",&n,&g,&s,&c,&m),n||g||s||c)
{
for(i=0;i<n;i++)
{
scanf("%d %d:%d:%d",&map[i].problem,&hour,&minute,&second);
map[i].time=hour*3600+minute*60+second;
map[i].index=i+1;
}

qsort(map,n,sizeof(map[0]),cmp);
for(i=0;i<n;i++)
if(map[i].index==m)break;
if(i>=0&&i<g)printf("Accepted today? I've got a golden medal :)\n");
else if(i>=g&&i<g+s)printf("Accepted today? I've got a silver medal :)\n");
else if(i>=g+s&&i<g+s+c)printf("Accepted today? I've got a copper medal :)\n");
else printf("Accepted today? I've got an honor mentioned :)\n");
}
return 0;
}

这篇关于ZZULI_SUMMER_PRACTICE(7)nbsp;1177nbsp;nbsp;quot;…的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/244436

相关文章

PAT (Advanced Level) Practice——1011,1012

1011:  链接: 1011 World Cup Betting - PAT (Advanced Level) Practice (pintia.cn) 题意及解题思路: 简单来说就是给你3行数字,每一行都是按照W,T,L的顺序给出相应的赔率。我们需要找到每一行的W,T,L当中最大的一个数,累乘的结果再乘以0.65,按照例子写出表达式即可。 同时还需要记录每一次选择的是W,T还是L

Error:(106) Attribute quot;rippleColorquot; has already been defined

compile 'com.github.navasmdc:MaterialDesign:1.5@aar' 扁平化设计,导入出现: Error:(106) Attribute "rippleColor" has already been defined 解决: compile 'com.github.navasmdc:MaterialDesign:1.3.2'

Ubuntunbsp;出现apt-get:nbsp;Packag…

学习了 原文地址:Ubuntu 出现apt-get: Package has no installation candidate问题 作者:zhou4539   Ubuntu 出现apt-get: Package has no installation candidate问题 分类: 系统-Linux 2011-12-18 13:32 751人阅读 评论(0) 收藏 举报 今天在

微信公众平台nbsp;10.29日更新nbsp;之己见

曾经有前辈说过,无论微信 5.0 的部分功能做的有多差,但是这是微信转型的一个里程碑。起初,笔者有点不太理解其中的道理,但是随着自己做了些东西东西后,才慢慢发现,这种先推广后优化,让用户去引导功能开发的策略是多么的明智。 此前,网络曾有谣言,微信服务号将于明年起收3000元/年的年费,这一传言尚未被证实,昨天微信公众平台正式推出了微信认证这一个功能,服务号可以花费300元进行认

从客户端(content1=quot;lt;img src=quot;/web/news/...quot;)中检测到有潜在危险的 Request.Form 值。

kindeditor 一开始一直不能上传图片 配置了所有应该配置的参数,从网上找各种大神贴,依旧不行,本来都是测试成功的不知道问啥突然就不能上传图片,蓝瘦香菇一阵后决定重新下载安装配置,整了一波后终于ok,但是又出现新的问题 提交不成功,一直提示: 从客户端(content1="<img src="/web/news/…")中检测到有潜在危险的 Request.Form 值。 加上配置文件中

PAT (Advanced Level) Practice

1001:  题目大意: 计算 a+b 的结果,并以标准格式输出——即每三个数字一组,组之间用逗号分隔(如果数字少于四位,则不需要逗号分隔)  解析: 我们知道相加右正有负,对于样例来说 Sample Input: -1000000 9 Sample Output: -999,991 如果是从左往右,算上负号的话输出应该是-99,999,1 从右往左:-,999,991离正确

Code Practice Journal | Day59-60_Graph09 最短路径(待更)

1. Dijkstra 1.1 原理与步骤 步骤: 选取距离源点最近且未被访问过的节点标记该节点为已访问更新未访问节点到源点的距离 1.2 代码实现 以KamaCoder47题为例 题目:47. 参加科学大会(第六期模拟笔试) (kamacoder.com) class Program{public static void Main(string[] args){//处

C语言提示:什么是quot;逻辑或quot;;…

原文地址:C语言提示:什么是"逻辑或";"逻辑非";"逻辑与" 作者:小陌 什么是"逻辑或";"逻辑非";"逻辑与"?、 “!”(逻辑非)、“&&”(逻辑与)、“||”(逻辑或)是三种逻辑运算符。  “逻辑与”相当于生活中说的“并且”,就是两个条件都同时成立的情况下“逻辑与”的运算结果才为“真”。  “逻辑或”相当于生活中的“或者”,当两个条件中有任一个条件满足,“逻辑或”的运算结果就

C语言的条件编译#if,nbsp;#elif…

原文地址:C语言的条件编译#if, #elif, #else, #endif、#ifdef, #ifndef 作者:Embeder 有些程序在调试、兼容性、平台移植等情况下可能想要通过简单地设置一些参数就生成一个不同的软件,这当然可以通过变量设置,把所有可能用到的代码都写进去,在初始化时配置,但在不同的情况下可能只用到一部分代码,就没必要把所有的代码都写进去,就可以用条件编译,通过预编译指

结构体定义nbsp;typedefnbsp;structnbsp;…

很不错 原文地址:结构体定义 typedef struct 用法详解和用法小结 作者:紫心玲儿 typedef是类型定义的意思。typedef struct 是为了使用这个结构体方便。 具体区别在于: 若struct node {}这样来定义结构体的话。在申请node 的变量时,需要这样写,struct node n; 若用typedef,可以这样写,typedef struct node