Artifact Content
Not logged in

Artifact 4e5b4d79ecf48d8e3351fc54e839912ecf9a021d


#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <iterator>
#include <functional>
#include <complex>
#include <queue>
#include <stack>
#include <cmath>
#include <cassert>
#include <cstring>
using namespace std;
typedef long long LL;
typedef complex<double> CMP;

class CubeStickers { public:
	string isPossible(vector <string> sticker) 
	{
		map<string,int> mp;
		for(int i=0; i<sticker.size(); ++i)
			mp[sticker[i]]++;
		int cnt = 0;
		for(map<string,int>::iterator it=mp.begin(); it!=mp.end(); ++it)
			cnt += min(2, it->second);
		return cnt>=6 ? "YES" : "NO";
	}
};

// BEGIN CUT HERE
#include <ctime>
double start_time; string timer()
 { ostringstream os; os << " (" << int((clock()-start_time)/CLOCKS_PER_SEC*1000) << " msec)"; return os.str(); }
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v)
 { os << "{ ";
   for(typename vector<T>::const_iterator it=v.begin(); it!=v.end(); ++it)
   os << '\"' << *it << '\"' << (it+1==v.end() ? "" : ", "); os << " }"; return os; }
void verify_case(const string& Expected, const string& Received) {
 bool ok = (Expected == Received);
 if(ok) cerr << "PASSED" << timer() << endl;  else { cerr << "FAILED" << timer() << endl;
 cerr << "\to: \"" << Expected << '\"' << endl << "\tx: \"" << Received << '\"' << endl; } }
#define CASE(N) {cerr << "Test Case #" << N << "..." << flush; start_time=clock();
#define END	 verify_case(_, CubeStickers().isPossible(sticker));}
int main(){

CASE(0)
	string sticker_[] = {"cyan","magenta","yellow","purple","black","white","purple"};
	  vector <string> sticker(sticker_, sticker_+sizeof(sticker_)/sizeof(*sticker_)); 
	string _ = "YES"; 
END
CASE(1)
	string sticker_[] = {"blue","blue","blue","blue","blue","blue","blue","blue","blue","blue"};
	  vector <string> sticker(sticker_, sticker_+sizeof(sticker_)/sizeof(*sticker_)); 
	string _ = "NO"; 
END
CASE(2)
	string sticker_[] = {"red","yellow","blue","red","yellow","blue","red","yellow","blue"};
	  vector <string> sticker(sticker_, sticker_+sizeof(sticker_)/sizeof(*sticker_)); 
	string _ = "YES"; 
END
CASE(3)
	string sticker_[] = {"purple","orange","orange","purple","black","orange","purple"};
	  vector <string> sticker(sticker_, sticker_+sizeof(sticker_)/sizeof(*sticker_)); 
	string _ = "NO"; 
END
CASE(4)
	string sticker_[] = {"white","gray","green","blue","yellow","red","target","admin"};
	  vector <string> sticker(sticker_, sticker_+sizeof(sticker_)/sizeof(*sticker_)); 
	string _ = "YES"; 
END
/*
CASE(5)
	string sticker_[] = ;
	  vector <string> sticker(sticker_, sticker_+sizeof(sticker_)/sizeof(*sticker_)); 
	string _ = ; 
END
CASE(6)
	string sticker_[] = ;
	  vector <string> sticker(sticker_, sticker_+sizeof(sticker_)/sizeof(*sticker_)); 
	string _ = ; 
END
*/
}
// END CUT HERE