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

为什么老是WA啊!高手帮Me看看啊!3x!

Posted by caizhicong0503 at 2007-05-03 16:22:37 on Problem 2153
#include<iostream>
#include<map.h>
using namespace std;
map<string,int> Score;
string p[10001];
int main()
{
	int N;
	scanf("%d\n",&N);
	for(int i=0;i<N;++i){
		getline(cin,p[i]);
		Score[p[i]]=0;
	}
	int M;
	scanf("%d\n",&M);
	while(M--){
		int mark;
		string S;
		for(int i=0;i<N;++i){
			scanf("%d",&mark);
			getchar();
			getline(cin,S);
			Score[S]=mark;
		}
		int n=1;
		for(int i=0;i<N;++i)
			if(Score[p[i]]>Score["Li Ming"])	n++;
		printf("%d\n",n);
	}
} 

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