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

Posted by goodpeter at 2007-08-24 17:20:29 on Problem 3320
#include <iostream>
#include <map>
using namespace std;

int P;
int count = 0;

int main(int argc, char* argv[])
{
	map<int, int> book;
	cin>>P;
	int index = 0;
	while(index < P)
	{
		int a;
		cin>>a;
		if(book.find(a) == book.end())
		{
			book[a] = a;
			count++;
		}
		index++;
	}

	cout<<count<<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