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

俺重写了一下,终于过了, 不过还是不明白咋错的???

Posted by zhjh008 at 2004-08-15 16:45:37 on Problem 1761
In Reply To:谁能帮俺检查一下? 多谢! Posted by:askhelp at 2004-08-15 12:13:53
//#include <fstream>

#include <iostream>
#include <string>
#include <vector>
#include <iomanip>
#include <map>
using namespace std;
//ifstream cin("1761a.in");

int N;

int main()
{
	int i,j;
	cin>>N;

	float time;
	string name;
	char pro,rslt;

		vector<string> solved[9];
		float sumtime[9];
		map<string,int> teamsub[9];
		float prosub[9];

	for(i=0;i<N;i++)
	{
		cin>>time>>name>>pro>>rslt;

	///////////////////////////////////////////////////////////////////////////////////////
		///check if it is nouse submit.
		int flag=1;
		for(j=0;j<solved[pro-65].size();j++)
			if(name==solved[pro-65][j])
			{
				flag=0;
				break;
			};
		if(flag==0)
			continue;
	//////////////////////////////////////////////////////////////////////////////////////
		///
		teamsub[pro-65][name]++;

		if(rslt=='A')
		{
			solved[pro-65].push_back(name);		//ready to next loop.
			sumtime[pro-65]+=time;				// calc the time
			prosub[pro-65]+=teamsub[pro-65][name];
		}
		
		//cout<<time<<" "<<name<<" "<<pro<<" "<<rslt<<endl;
	}
	for(i=0;i<9;i++)
	{
		cout<<(char)(i+65)<<" "<<solved[i].size();
		if(solved[i].size()>0)
			cout<<" "<<fixed<<setprecision(2)<<prosub[i]/solved[i].size()<<" "<<sumtime[i]/solved[i].size();
		cout<<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