zoukankan      html  css  js  c++  java
  • 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
    ",ans);
        }
        return 0;
    }

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

  • 相关阅读:
    学习Tomcat(三)
    TIME_WAIT 优化注意事项
    TIME_WAIT 优化
    TCP(一)
    TCP(二)
    TCP(三)
    5-14 练习题及答案
    5-14 进程池
    5-11 操作系统介绍
    5-8套接字socket
  • 原文地址:https://www.cnblogs.com/xryz/p/4847937.html
Copyright © 2011-2022 走看看