Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:Help,WA都N次了,帮忙看哈,给点测试数据,谢谢了!!!!!!!!!

Posted by luchenqun at 2010-11-08 22:13:03 on Problem 1581
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator