标签:des style blog http io ar color os sp
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1070
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 14286 Accepted Submission(s):
3525
1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 6 int main() 7 { 8 char name[200],min_name[200]; 9 double Min,s; 10 int min_v; 11 int T,p,v,d,n; 12 scanf("%d",&T); 13 while (T--) 14 { 15 Min=99999; 16 min_v=0; 17 scanf("%d",&n); 18 while(n--) 19 { 20 scanf("%s%d%d",name,&p,&v); 21 if (v<200) 22 continue; 23 if (v/200>=5) 24 s=p/5; 25 else 26 s=p*1.0/(v/200); 27 if(Min>s) 28 { 29 min_v=v; 30 Min=s; 31 strcpy(min_name,name); 32 } 33 else if(Min==s) 34 { 35 if(min_v<v) 36 { 37 min_v=v; 38 strcpy(min_name,name); 39 } 40 } 41 } 42 printf("%s\n",min_name); 43 } 44 return 0; 45 }
标签:des style blog http io ar color os sp
原文地址:http://www.cnblogs.com/qq-star/p/4128878.html