Artifact Content
Not logged in

Artifact 0119219fe783de0611ba43808b4d3ebe1c04ca78


#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>
using namespace std;
typedef long long LL;
typedef long double LD;
typedef complex<LD> CMP;

class EvenRoute { public:
	string isItPossible(vector <int> x, vector <int> y, int wantedParity)
	{
		bool can = false;
		for(int i=0; i<x.size(); ++i)
			if( ((x[i]+y[i])&1) == wantedParity )
				can = true;
		return can ? "CAN" : "CANNOT";
	}
};

// 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(_, EvenRoute().isItPossible(x, y, wantedParity));}
int main(){

CASE(0)
	int x_[] = {-1,-1,1,1};
	  vector <int> x(x_, x_+sizeof(x_)/sizeof(*x_)); 
	int y_[] = {-1,1,1,-1};
	  vector <int> y(y_, y_+sizeof(y_)/sizeof(*y_)); 
	int wantedParity = 0; 
	string _ = "CAN"; 
END
CASE(1)
	int x_[] = {-5,-3,2};
	  vector <int> x(x_, x_+sizeof(x_)/sizeof(*x_)); 
	int y_[] = {2,0,3};
	  vector <int> y(y_, y_+sizeof(y_)/sizeof(*y_)); 
	int wantedParity = 1; 
	string _ = "CAN"; 
END
CASE(2)
	int x_[] = {1001, -4000};
	  vector <int> x(x_, x_+sizeof(x_)/sizeof(*x_)); 
	int y_[] = {0,0};
	  vector <int> y(y_, y_+sizeof(y_)/sizeof(*y_)); 
	int wantedParity = 1; 
	string _ = "CAN"; 
END
CASE(3)
	int x_[] = {11, 21, 0};
	  vector <int> x(x_, x_+sizeof(x_)/sizeof(*x_)); 
	int y_[] = {-20, 42, 7};
	  vector <int> y(y_, y_+sizeof(y_)/sizeof(*y_)); 
	int wantedParity = 0; 
	string _ = "CANNOT"; 
END
CASE(4)
	int x_[] = {0, 6};
	  vector <int> x(x_, x_+sizeof(x_)/sizeof(*x_)); 
	int y_[] = {10, -20};
	  vector <int> y(y_, y_+sizeof(y_)/sizeof(*y_)); 
	int wantedParity = 1; 
	string _ = "CANNOT"; 
END
CASE(5)
	int x_[] = {159833,-62665,323889,-235879,137089,-669850,137554,549764,191807,993220,-801864,-425902,326896,312318,-778686,33030,763633,-866343,36938,-627234,-19941,-909928,-920678,-763769,657773,431660,600784,54912,563394,970744,872933,-413697,319375,249696,368559,-449659,942650,997004,-420096,-473219,-757172,70934,-771310,498140,-870998,176429,985061,-674033,255167,-89503};
	  vector <int> x(x_, x_+sizeof(x_)/sizeof(*x_)); 
	int y_[] = {38668,957082,-75351,-877610,-247852,458917,-417575,219160,515259,-254435,-441099,631589,-637191,-902042,-662042,-279031,-233412,-443322,207905,-566785,-248122,829715,362587,831403,-238955,792643,77852,665108,83526,-623925,-199287,492427,311357,-437880,39341,988852,-261007,-621546,-659372,-661305,196329,769159,-771255,-888939,483180,-151127,-533736,281297,411246,-339825};
	  vector <int> y(y_, y_+sizeof(y_)/sizeof(*y_)); 
	int wantedParity = 0; 
	string _ = "???"; 
END
CASE(5)
	int x_[] = {159833,-62665,323889,-235879,137089,-669850,137554,549764,191807,993220,-801864,-425902,326896,312318,-778686,33030,763633,-866343,36938,-627234,-19941,-909928,-920678,-763769,657773,431660,600784,54912,563394,970744,872933,-413697,319375,249696,368559,-449659,942650,997004,-420096,-473219,-757172,70934,-771310,498140,-870998,176429,985061,-674033,255167,-89503};
	  vector <int> x(x_, x_+sizeof(x_)/sizeof(*x_)); 
	int y_[] = {38668,957082,-75351,-877610,-247852,458917,-417575,219160,515259,-254435,-441099,631589,-637191,-902042,-662042,-279031,-233412,-443322,207905,-566785,-248122,829715,362587,831403,-238955,792643,77852,665108,83526,-623925,-199287,492427,311357,-437880,39341,988852,-261007,-621546,-659372,-661305,196329,769159,-771255,-888939,483180,-151127,-533736,281297,411246,-339825};
	  vector <int> y(y_, y_+sizeof(y_)/sizeof(*y_)); 
	int wantedParity = 1; 
	string _ = "???"; 
END
CASE(6)
	int x_[] = {159833,-62665,323889,-235879,137089,-669850,137554,549764,191807,993220,-801864,-425902,326896,312318,-778686,33030,763633,-866343,36938,-627234,-19941,-909928,-920678,-763769,657773,431660,600784,54912,563394,970744,872933,-413697,319375,249696,368559,-449659,942650,997004,-420096,-473219,-757172,70934,-771310,498140,-870998,176429,985061,-674033,255167,-89503};
	  vector <int> x(x_, x_+sizeof(x_)/sizeof(*x_)); 
	int y_[] = {159833,-62665,323889,-235879,137089,-669850,137554,549764,191807,993220,-801864,-425902,326896,312318,-778686,33030,763633,-866343,36938,-627234,-19941,-909928,-920678,-763769,657773,431660,600784,54912,563394,970744,872933,-413697,319375,249696,368559,-449659,942650,997004,-420096,-473219,-757172,70934,-771310,498140,-870998,176429,985061,-674033,255167,-89503};
	  vector <int> y(y_, y_+sizeof(y_)/sizeof(*y_)); 
	int wantedParity = 0; 
	string _ = "???"; 
END
CASE(6)
	int x_[] = {159833,-62665,323889,-235879,137089,-669850,137554,549764,191807,993220,-801864,-425902,326896,312318,-778686,33030,763633,-866343,36938,-627234,-19941,-909928,-920678,-763769,657773,431660,600784,54912,563394,970744,872933,-413697,319375,249696,368559,-449659,942650,997004,-420096,-473219,-757172,70934,-771310,498140,-870998,176429,985061,-674033,255167,-89503};
	  vector <int> x(x_, x_+sizeof(x_)/sizeof(*x_)); 
	int y_[] = {159833,-62665,323889,-235879,137089,-669850,137554,549764,191807,993220,-801864,-425902,326896,312318,-778686,33030,763633,-866343,36938,-627234,-19941,-909928,-920678,-763769,657773,431660,600784,54912,563394,970744,872933,-413697,319375,249696,368559,-449659,942650,997004,-420096,-473219,-757172,70934,-771310,498140,-870998,176429,985061,-674033,255167,-89503};
	  vector <int> y(y_, y_+sizeof(y_)/sizeof(*y_)); 
	int wantedParity = 1; 
	string _ = "???"; 
END

}
// END CUT HERE