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 |
AC (/≧▽≦)/#include <iostream> #include <map> using namespace std; int a,b; map<int,int> mp,mp2; int main() { bool ok=1; for(int i=1;i<=6;i++) { cin>>a>>b; mp[a]++;mp[b]++;mp2[a]++; if(a!=b)mp2[b]++; } for(map<int,int> :: iterator p=mp.begin();p!=mp.end();p++) if(p->second%4!=0||(p->second==4&&mp2[p->first]!=4))ok=0; cout<<(ok==1?"POSSIBLE":"IMPOSSIBLE")<<endl; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator