| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:Help,WA都N次了,帮忙看哈,给点测试数据,谢谢了!!!!!!!!!In Reply To:Help,WA都N次了,帮忙看哈,给点测试数据,谢谢了!!!!!!!!! Posted by:20054738 at 2007-04-03 21:06:30 #include <iostream>
#include <string>
using namespace std;
int s[4],t[4];
int main()
{
int n,sloved=-1,penalty=-1,tempsloved,temppenalty;
string temp,name;
cin>>n;
while(n--)
{
tempsloved=0,temppenalty=0;
cin>>temp;
int i;
for(i=0;i<4;i++)
cin>>s[i]>>t[i];
for(i=0;i<4;i++)
{
if(t[i]>0)
{
++tempsloved;
temppenalty +=(s[i]-1)*20+t[i];
}
}
if((tempsloved>sloved) || (tempsloved==sloved&&penalty>temppenalty))
{
sloved=tempsloved;
name=temp;
penalty=temppenalty;
}
}
cout<<name<<" "<<sloved<<" "<<penalty<<endl;
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator