hdoj 1177 Accepted today?

2023-11-29 23:49
文章标签 hdoj accepted today 1177

本文主要是介绍hdoj 1177 Accepted today?,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

是判断第m个得的奖!!

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>
typedef struct{
int qu, time;
}str;
int main()
{int n, g, s, c, m, h, min, sec, i;str st[150];while( scanf( "%d%d%d%d%d", &n, &g, &s, &c, &m ), n||g||s||c||m ){int sor = 1;for( i = 1; i <= n; i ++ ){scanf( "%d %d:%d:%d", &st[i].qu, &h, &min, &sec );st[i].time = h*3600+min*60+sec;}for( i = 1; i <= n; i ++ ){if( i!=m&&((st[m].qu<st[i].qu)||(st[m].qu==st[i].qu&&st[m].time>st[i].time)) )++sor;}if( sor <= g )printf( "Accepted today? I've got a golden medal :)\n" );else if( sor<=g+s )printf( "Accepted today? I've got a silver medal :)\n" );else if( sor <= g+s+c )printf( "Accepted today? I've got a copper medal :)\n" );elseprintf( "Accepted today? I've got an honor mentioned :)\n" );}
}


这篇关于hdoj 1177 Accepted today?的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



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

相关文章

POJ 1177

/*扫描线求矩阵的周长交并*/#include<cstdio>#include<cstring>#include<algorithm>using namespace std;#define lson (pos<<1)#define rson (pos<<1|1)typedef long long LL;const int ADD = 10005;const int maxn

today extension 扩展使用

http://blog.csdn.net/ralbatr/article/details/44194389 效果图:

hdoj 2371 decoded string. Decode the Strings

http://acm.hdu.edu.cn/showproblem.php?pid=2371 题意:给出编码的原则,给一个字符串,输出该字符串经过m次解码后的字符串。 啊啊啊啊。。。。无耻的看错题意了,以为给出字符串输出经过m次解码的后的字符串,样例死活过不了,赛后才发现问的是“decoded string”. 即解码后的字符串。。 思路:对于 5 3 2 3 1 5 4 helol

HDU 2112 Today (Dijkstra)

http://acm.hdu.edu.cn/showproblem.php?pid=2112 HDU Today Time Limit: 15000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 16490    Accepted Submission(s): 3

HDOJ 1874 畅通工程续——结构体模拟邻接链表的SPFA算法

Problem Description 某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。 现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。   Input 本题目包含多组数据,请处理到文

HDU 1828 POJ 1177 Picture(线段树+扫描线+离散化)

HDU题目地址:HDU 1828  POJ题目地址:POJ 1177 这题是求周长并,我用的方法可能有点麻烦。。是先求横着的线,再求竖着的线。每次只要求出每次的总区间覆盖长度,然后每次累加这次的总区间覆盖与上次的总区间覆盖长度的差的绝对值。因为只有长度发生变化时,才会产生一段新的周长。 待会再试试只扫描一次的方法。此博客有待更新。 代码如下: #include <iostream>#

九度OJ-1435-迷瘴(HDOJ-2570)

题目地址:点击打开链接 题目描述: 通过悬崖的yifenfei,又面临着幽谷的考验—— 幽谷周围瘴气弥漫,静的可怕,隐约可见地上堆满了骷髅。由于此处长年不见天日,导致空气中布满了毒素,一旦吸入体内,便会全身溃烂而死。 幸好yifenfei早有防备,提前备好了解药材料(各种浓度的万能药水)。现在只需按照配置成不同比例的浓度。 现已知yifenfei随身携带有n种浓度的万能药水,体积V都相

POJ 1177 Picture (线段树扫描线)

题意: 给定n个矩形(0 <= n < 5000)的左下角坐标(x1,y1)和右上角坐标(x2,y2)   (-10000 <= x1,x2,y1,y2 <= 10000) 求所有矩形重合后的图形的周长,如下图(图片来自POJ 1177): 做法:线段树扫描线。 由于值域不大,所以不需要离散化,直接将Y值向正方向平移10001个单位,然后用线段树直接做。 扫描线就是用垂直于x轴的线

AI播客下载:AI Today(今日AI)

AI Today播客的背后公司是Cognilytica ,这家公式专注于为组织和专业人士提供人工智能、机器学习、自动化、数据和分析的最佳实践研究、培训和认证。自2018年以来,Cognilytica 的旗舰产品 CPMAI™ 人工智能和机器学习项目管理培训和认证已被全球各种规模的组织采纳。Cognilytica 通过最佳实践方法和管理方法,提高了组织和个人实施新兴技术成功率。 AI To

Today Extension(widget)看我就够了

一、介绍 1、app extension、containing app及host app app extension extension不能单独存在,必须有一个包含它的containing app,它有一个包含在app bundle中的独立bundle,extension的bundle后缀名是.appex。其生命周期也和普通app不同。 extension需要用户手动激活,不同的exte