HDU 1177
来源:互联网 发布:曦力音视频转换mac版 编辑:程序博客网 时间:2024/06/07 05:01
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
//#include <stdlib>
using namespace std;
struct p
{
int num;//题目数
int h;//小时
int f1;//分钟
int m;//秒
int pos;//记录位置
} f[140];
int cmp(p x,p y)
{
if(x.num==y.num)
{
if(x.h==y.h)
{
if(x.f1==y.f1)
{
return x.m<y.m;
}
else
return x.f1<y.f1;
}
else
return x.h<y.h;
}
else
return x.num>y.num;
}
int main()
{
int i;
char ch;
int n,g,s,c,m1;
while(scanf("%d%d%d%d%d",&n,&g,&s,&c,&m1))
{
if((n+g+s+c+m1)==0)
break;
for(i=1; i<=n; i++)
{
scanf("%d%d%c%d%c%d",&f[i].num,&f[i].h,&ch,&f[i].f1,&ch,&f[i].m);
f[i].pos=i;
}
sort(f+1,f+n+1,cmp);
int sum;
for(i=1; i<=n; i++)
{
if(f[i].pos==m1)
{
sum=i;
break;
}
}
if(sum<=g)
printf("Accepted today? I've got a golden medal :)\n");
else if(sum<=(g+s))
{
printf("Accepted today? I've got a silver medal :)\n");
}
else if(sum<=(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;
}
#include <cstdio>
#include <cstring>
#include <algorithm>
//#include <stdlib>
using namespace std;
struct p
{
int num;//题目数
int h;//小时
int f1;//分钟
int m;//秒
int pos;//记录位置
} f[140];
int cmp(p x,p y)
{
if(x.num==y.num)
{
if(x.h==y.h)
{
if(x.f1==y.f1)
{
return x.m<y.m;
}
else
return x.f1<y.f1;
}
else
return x.h<y.h;
}
else
return x.num>y.num;
}
int main()
{
int i;
char ch;
int n,g,s,c,m1;
while(scanf("%d%d%d%d%d",&n,&g,&s,&c,&m1))
{
if((n+g+s+c+m1)==0)
break;
for(i=1; i<=n; i++)
{
scanf("%d%d%c%d%c%d",&f[i].num,&f[i].h,&ch,&f[i].f1,&ch,&f[i].m);
f[i].pos=i;
}
sort(f+1,f+n+1,cmp);
int sum;
for(i=1; i<=n; i++)
{
if(f[i].pos==m1)
{
sum=i;
break;
}
}
if(sum<=g)
printf("Accepted today? I've got a golden medal :)\n");
else if(sum<=(g+s))
{
printf("Accepted today? I've got a silver medal :)\n");
}
else if(sum<=(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;
}
- HDU 1177
- HDU 1177
- poj 1177 && hdu 1828
- HDU 1177 ( "Accepted today?" )
- HDU-1177"Accepted today?"
- hdu-1177-"Accepted today?"
- HDU 1177(水题)
- poj 1177 && hdu 1828
- hdu
- hdu
- HDU
- hdu ()
- hdu
- hdu
- HDU
- HDU
- hdu
- hdu
- android制作一个简单登入界面的部分代码
- 树链剖分
- Ruby设计模式透析之 —— 适配器(Adapter)
- 淘宝优惠信息公布要求
- redis的基础学习
- HDU 1177
- VMware 9 安装 Mac OS X 10.8.4 并安装 Xcode 4.6
- hdoj 1299 Diophantus of Alexandria
- Hibernate 学习笔记(对关键知识点的系统化总结,亲,百分百对你有帮助哦!)
- 例说 WIN SDK 窗口子类化技术
- 7月21号 一个起点的日子 记录理想和现实的点滴
- Android helloworld
- android
- 自考工作分析之工作分析的历史与发展