Quality and CCPC

English foundation:

the fractional part  小数部分
disclaimer      免责声明
fictitious       虚构的,编造的;假定的,虚设的;小说式的;假装的
No two teams have the same name.
round down the number  下取整
proportion       比例,占比;部分;面积;均衡
rounded to the nearest integer   四舍五入到最近的整数
Rounding means to make a number shorter or simpler, but keeping it as close in value as possible to the original number. 
A team ranks before another if they solved more problems or both teams solved an equal number of problems but they had less penalty time.

 

题目:http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1010&cid=855

分析:

 

代码:

 

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;

struct team
{
    char s[15];
    int p,t;
}te[100005];

bool cmp(team x,team y)
{
    if(x.p==y.p) return x.t<y.t;
    else 	     return x.p>y.p;
}

int main()
{
    int T;
    scanf("%d",&T);
    while(T--)
    {
        int num,d;
        scanf("%d%d",&num,&d);
        for(int i=0;i<num;i++)
        {
            scanf("%s",te[i].s);
            scanf("%d%d",&te[i].p,&te[i].t);
        }
        if(num*d%10!=5)
		{
            puts("Quailty is very great");
            continue;
        }
        else
		{
            sort(te,te+num,cmp);
            int x=ceil(num*0.1*d)-1;
            printf("%s\n",te[x].s);
        }
    } 
} 

 

  

 

 
 

 

转载于:https://www.cnblogs.com/dragondragon/p/11358048.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值