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

AC (/≧▽≦)/

Posted by 1243295518 at 2019-02-23 11:08:36 on Problem 2160
#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:
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