hdu 1070 Milk

#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <time.h>
using namespace std;

int main()
{
    int _,i,n,p1,v1,p,v,t1,t;
    double k1,k;
    char ans[1024],s[1024];
    scanf("%d",&_);
    while(_--)
    {
        scanf("%d",&n);
        v1=0;
        k1=9999999;
        for(i=0;i<n;i++)
        {
            scanf("%s%d%d",s,&p,&v);
            if(v<200) continue;
            if(v>=1000) t=5;
            else t=v/200;
            k=1.0*p/t;
            if(k<k1||(k==k1&&v>=v1))
            {
                v1=v;
                k1=k;
                strcpy(ans,s);
            }
        }
        printf("%s\n",ans);
    }
    return 0;
}

版权声明:本文为博主原创文章,未经博主允许不得转载。http://xiang578.top/

posted @ 2015-07-16 14:06  xryz  阅读(121)  评论(0编辑  收藏  举报