#include <stdio.h>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <iostream>
using namespace std;
struct node {
int num, h, m, s;
}ss[135];
int cmp(int a, int b)
{
if(ss[a].num != ss[b].num)
return ss[a].num > ss[b].num;
if(ss[a].h != ss[b].h)
return ss[a].h < ss[b].h;
if(ss[a].m != ss[b].m)
return ss[a].m < ss[b].m;
return ss[a].s < ss[b].s;
}
int pos[135];
int main()
{
int n, g, s, c, m;
while(cin>>n>>g>>s>>c>>m)
{
if(!n && !g && !s && !c && !m)
break;
for(int i = 1; i <= n; i++)
scanf("%d %d:%d:%d", &ss[i].num, &ss[i].h, &ss[i].m, &ss[i].s);
for(int i = 1; i <= n; i++)
pos[i] = i;
sort(pos + 1, pos + n + 1, cmp);
int leap = 0;
for(int i = 1; i <= g; i++)
{
if(pos[i] == m){
cout<<"Accepted today? I've got a golden medal :)"<<endl;
leap = 1;
break;
}
}
if(leap) continue;
for(int i = g + 1; i <= g + s; i++)
{
if(pos[i] == m){
cout<<"Accepted today? I've got a silver medal :)"<<endl;
leap = 1;
break;
}
}
if(leap) continue;
for(int i = g + s + 1; i <= g + s + c; i++)
{
if(pos[i] == m){
cout<<"Accepted today? I've got a copper medal :)"<<endl;
leap = 1;
break;
}
}
if(leap) continue;
cout<<"Accepted today? I've got an honor mentioned :)"<<endl;
}
return 0;
}
HDU 1177(水题)
最新推荐文章于 2020-08-10 23:52:40 发布