Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
我用STL做的,能帮我看一下哪里错了吗? 谢谢!#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator