首页 > 其他 > 详细

Quality and CCPC

时间:2019-08-15 16:43:51      阅读:78      评论:0      收藏:0      [点我收藏+]

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);
        }
    } 
} 

 

  

 

 
 

 

Quality and CCPC

原文:https://www.cnblogs.com/dragondragon/p/11358048.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!