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

我用STL做的,能帮我看一下哪里错了吗? 谢谢!

Posted by hisky at 2006-06-11 13:22:08 on Problem 2419
#include <set>
#include <map>
#include <vector>
#include <iostream>
#include <fstream>
#include <stdlib.h>
using namespace std;

int main()
{
	typedef map< set<int>, int > MAP;
	typedef vector< set<int> > VECTOR;
	MAP mm;
	VECTOR vv;
	int m,n, a1, a2;
	cin >> m >> n;
	vv.resize(m);
	while (cin >> a1 >> a2)
	{
		vv[a1 - 1].insert(a2);
	}

	for (VECTOR::iterator vIter = vv.begin();vIter != vv.end();vIter ++)
	{
		mm[(*vIter)] ++;
 	}


	int msize = mm.size();
	for (MAP::iterator iter = mm.begin();iter != mm.end();iter ++)
	{
		set<int> ss = iter->first;
		if (ss.size() == 0)
			msize --;
	}

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