Ejemplo n.º 1
0
	int run_test_case(int casenum__) {
		switch (casenum__) {
		case 0: {
			int x[]                   = {-1,-1,1,1};
			int y[]                   = {-1,1,1,-1};
			int wantedParity          = 0;
			string expected__         = "CAN";

			clock_t start__           = clock();
			string received__         = EvenRoute().isItPossible(vector <int>(x, x + (sizeof x / sizeof x[0])), vector <int>(y, y + (sizeof y / sizeof y[0])), wantedParity);
			return verify_case(casenum__, expected__, received__, clock()-start__);
		}
		case 1: {
			int x[]                   = {-5,-3,2};
			int y[]                   = {2,0,3};
			int wantedParity          = 1;
			string expected__         = "CAN";

			clock_t start__           = clock();
			string received__         = EvenRoute().isItPossible(vector <int>(x, x + (sizeof x / sizeof x[0])), vector <int>(y, y + (sizeof y / sizeof y[0])), wantedParity);
			return verify_case(casenum__, expected__, received__, clock()-start__);
		}
		case 2: {
			int x[]                   = {1001, -4000};
			int y[]                   = {0,0};
			int wantedParity          = 1;
			string expected__         = "CAN";

			clock_t start__           = clock();
			string received__         = EvenRoute().isItPossible(vector <int>(x, x + (sizeof x / sizeof x[0])), vector <int>(y, y + (sizeof y / sizeof y[0])), wantedParity);
			return verify_case(casenum__, expected__, received__, clock()-start__);
		}
		case 3: {
			int x[]                   = {11, 21, 0};
			int y[]                   = {-20, 42, 7};
			int wantedParity          = 0;
			string expected__         = "CANNOT";

			clock_t start__           = clock();
			string received__         = EvenRoute().isItPossible(vector <int>(x, x + (sizeof x / sizeof x[0])), vector <int>(y, y + (sizeof y / sizeof y[0])), wantedParity);
			return verify_case(casenum__, expected__, received__, clock()-start__);
		}
		case 4: {
			int x[]                   = {0, 6};
			int y[]                   = {10, -20};
			int wantedParity          = 1;
			string expected__         = "CANNOT";

			clock_t start__           = clock();
			string received__         = EvenRoute().isItPossible(vector <int>(x, x + (sizeof x / sizeof x[0])), vector <int>(y, y + (sizeof y / sizeof y[0])), wantedParity);
			return verify_case(casenum__, expected__, received__, clock()-start__);
		}

		// custom cases

/*      case 5: {
			int x[]                   = ;
			int y[]                   = ;
			int wantedParity          = ;
			string expected__         = ;

			clock_t start__           = clock();
			string received__         = EvenRoute().isItPossible(vector <int>(x, x + (sizeof x / sizeof x[0])), vector <int>(y, y + (sizeof y / sizeof y[0])), wantedParity);
			return verify_case(casenum__, expected__, received__, clock()-start__);
		}*/
/*      case 6: {
			int x[]                   = ;
			int y[]                   = ;
			int wantedParity          = ;
			string expected__         = ;

			clock_t start__           = clock();
			string received__         = EvenRoute().isItPossible(vector <int>(x, x + (sizeof x / sizeof x[0])), vector <int>(y, y + (sizeof y / sizeof y[0])), wantedParity);
			return verify_case(casenum__, expected__, received__, clock()-start__);
		}*/
/*      case 7: {
			int x[]                   = ;
			int y[]                   = ;
			int wantedParity          = ;
			string expected__         = ;

			clock_t start__           = clock();
			string received__         = EvenRoute().isItPossible(vector <int>(x, x + (sizeof x / sizeof x[0])), vector <int>(y, y + (sizeof y / sizeof y[0])), wantedParity);
			return verify_case(casenum__, expected__, received__, clock()-start__);
		}*/
		default:
			return -1;
		}
	}
Ejemplo n.º 2
0
   int run_test_case( int casenum__ ) {
      long long starttime__ = get_time();
      switch( casenum__ ) {
      case 0: {
         int x[]                   = {-1,-1,1,1};
         int y[]                   = {-1,1,1,-1};
         int wantedParity          = 0;
         string expected__         = "CAN";

         return verify_case( casenum__, starttime__, expected__, EvenRoute().isItPossible( vector <int>( x, x + ( sizeof x / sizeof(int) ) ), vector <int>( y, y + ( sizeof y / sizeof(int) ) ), wantedParity ) );
      }
      case 1: {
         int x[]                   = {-5,-3,2};
         int y[]                   = {2,0,3};
         int wantedParity          = 1;
         string expected__         = "CAN";

         return verify_case( casenum__, starttime__, expected__, EvenRoute().isItPossible( vector <int>( x, x + ( sizeof x / sizeof(int) ) ), vector <int>( y, y + ( sizeof y / sizeof(int) ) ), wantedParity ) );
      }
      case 2: {
         int x[]                   = {1001, -4000};
         int y[]                   = {0,0};
         int wantedParity          = 1;
         string expected__         = "CAN";

         return verify_case( casenum__, starttime__, expected__, EvenRoute().isItPossible( vector <int>( x, x + ( sizeof x / sizeof(int) ) ), vector <int>( y, y + ( sizeof y / sizeof(int) ) ), wantedParity ) );
      }
      case 3: {
         int x[]                   = {11, 21, 0};
         int y[]                   = {-20, 42, 7};
         int wantedParity          = 0;
         string expected__         = "CANNOT";

         return verify_case( casenum__, starttime__, expected__, EvenRoute().isItPossible( vector <int>( x, x + ( sizeof x / sizeof(int) ) ), vector <int>( y, y + ( sizeof y / sizeof(int) ) ), wantedParity ) );
      }
      case 4: {
         int x[]                   = {0, 6};
         int y[]                   = {10, -20};
         int wantedParity          = 1;
         string expected__         = "CANNOT";

         return verify_case( casenum__, starttime__, expected__, EvenRoute().isItPossible( vector <int>( x, x + ( sizeof x / sizeof(int) ) ), vector <int>( y, y + ( sizeof y / sizeof(int) ) ), wantedParity ) );
      }

      // custom cases

/*
      case 5: {
         int x[]                   = ;
         int y[]                   = ;
         int wantedParity          = ;
         string expected__         = ;

         return verify_case( casenum__, starttime__, expected__, EvenRoute().isItPossible( vector <int>( x, x + ( sizeof x / sizeof(int) ) ), vector <int>( y, y + ( sizeof y / sizeof(int) ) ), wantedParity ) );
      }
*/
/*
      case 6: {
         int x[]                   = ;
         int y[]                   = ;
         int wantedParity          = ;
         string expected__         = ;

         return verify_case( casenum__, starttime__, expected__, EvenRoute().isItPossible( vector <int>( x, x + ( sizeof x / sizeof(int) ) ), vector <int>( y, y + ( sizeof y / sizeof(int) ) ), wantedParity ) );
      }
*/
/*
      case 7: {
         int x[]                   = ;
         int y[]                   = ;
         int wantedParity          = ;
         string expected__         = ;

         return verify_case( casenum__, starttime__, expected__, EvenRoute().isItPossible( vector <int>( x, x + ( sizeof x / sizeof(int) ) ), vector <int>( y, y + ( sizeof y / sizeof(int) ) ), wantedParity ) );
      }
*/
      default:
         return -1;
      }
   }