コード例 #1
0
   int run_test_case( int casenum__ ) {
      long long starttime__ = get_time();
      switch( casenum__ ) {
      case 0: {
         int webbedFeet            = 4;
         int duckBills             = 1;
         int beaverTails           = 1;
         int expected__            = 1;

         return verify_case( casenum__, starttime__, expected__, PlatypusDuckAndBeaver().minimumAnimals( webbedFeet, duckBills, beaverTails ) );
      }
      case 1: {
         int webbedFeet            = 0;
         int duckBills             = 0;
         int beaverTails           = 0;
         int expected__            = 0;

         return verify_case( casenum__, starttime__, expected__, PlatypusDuckAndBeaver().minimumAnimals( webbedFeet, duckBills, beaverTails ) );
      }
      case 2: {
         int webbedFeet            = 10;
         int duckBills             = 2;
         int beaverTails           = 2;
         int expected__            = 3;

         return verify_case( casenum__, starttime__, expected__, PlatypusDuckAndBeaver().minimumAnimals( webbedFeet, duckBills, beaverTails ) );
      }
      case 3: {
         int webbedFeet            = 60;
         int duckBills             = 10;
         int beaverTails           = 10;
         int expected__            = 20;

         return verify_case( casenum__, starttime__, expected__, PlatypusDuckAndBeaver().minimumAnimals( webbedFeet, duckBills, beaverTails ) );
      }
      case 4: {
         int webbedFeet            = 1000;
         int duckBills             = 200;
         int beaverTails           = 200;
         int expected__            = 300;

         return verify_case( casenum__, starttime__, expected__, PlatypusDuckAndBeaver().minimumAnimals( webbedFeet, duckBills, beaverTails ) );
      }

      // custom cases

/*
      case 5: {
         int webbedFeet            = ;
         int duckBills             = ;
         int beaverTails           = ;
         int expected__            = ;

         return verify_case( casenum__, starttime__, expected__, PlatypusDuckAndBeaver().minimumAnimals( webbedFeet, duckBills, beaverTails ) );
      }
*/
/*
      case 6: {
         int webbedFeet            = ;
         int duckBills             = ;
         int beaverTails           = ;
         int expected__            = ;

         return verify_case( casenum__, starttime__, expected__, PlatypusDuckAndBeaver().minimumAnimals( webbedFeet, duckBills, beaverTails ) );
      }
*/
/*
      case 7: {
         int webbedFeet            = ;
         int duckBills             = ;
         int beaverTails           = ;
         int expected__            = ;

         return verify_case( casenum__, starttime__, expected__, PlatypusDuckAndBeaver().minimumAnimals( webbedFeet, duckBills, beaverTails ) );
      }
*/
      default:
         return -1;
      }
   }
コード例 #2
0
	int run_test_case(int casenum__) {
		switch (casenum__) {
		case 0: {
			int webbedFeet            = 4;
			int duckBills             = 1;
			int beaverTails           = 1;
			int expected__            = 1;

			clock_t start__           = clock();
			int received__            = PlatypusDuckAndBeaver().minimumAnimals(webbedFeet, duckBills, beaverTails);
			return verify_case(casenum__, expected__, received__, clock()-start__);
		}
		case 1: {
			int webbedFeet            = 0;
			int duckBills             = 0;
			int beaverTails           = 0;
			int expected__            = 0;

			clock_t start__           = clock();
			int received__            = PlatypusDuckAndBeaver().minimumAnimals(webbedFeet, duckBills, beaverTails);
			return verify_case(casenum__, expected__, received__, clock()-start__);
		}
		case 2: {
			int webbedFeet            = 10;
			int duckBills             = 2;
			int beaverTails           = 2;
			int expected__            = 3;

			clock_t start__           = clock();
			int received__            = PlatypusDuckAndBeaver().minimumAnimals(webbedFeet, duckBills, beaverTails);
			return verify_case(casenum__, expected__, received__, clock()-start__);
		}
		case 3: {
			int webbedFeet            = 60;
			int duckBills             = 10;
			int beaverTails           = 10;
			int expected__            = 20;

			clock_t start__           = clock();
			int received__            = PlatypusDuckAndBeaver().minimumAnimals(webbedFeet, duckBills, beaverTails);
			return verify_case(casenum__, expected__, received__, clock()-start__);
		}
		case 4: {
			int webbedFeet            = 1000;
			int duckBills             = 200;
			int beaverTails           = 200;
			int expected__            = 300;

			clock_t start__           = clock();
			int received__            = PlatypusDuckAndBeaver().minimumAnimals(webbedFeet, duckBills, beaverTails);
			return verify_case(casenum__, expected__, received__, clock()-start__);
		}

		// custom cases

/*      case 5: {
			int webbedFeet            = ;
			int duckBills             = ;
			int beaverTails           = ;
			int expected__            = ;

			clock_t start__           = clock();
			int received__            = PlatypusDuckAndBeaver().minimumAnimals(webbedFeet, duckBills, beaverTails);
			return verify_case(casenum__, expected__, received__, clock()-start__);
		}*/
/*      case 6: {
			int webbedFeet            = ;
			int duckBills             = ;
			int beaverTails           = ;
			int expected__            = ;

			clock_t start__           = clock();
			int received__            = PlatypusDuckAndBeaver().minimumAnimals(webbedFeet, duckBills, beaverTails);
			return verify_case(casenum__, expected__, received__, clock()-start__);
		}*/
/*      case 7: {
			int webbedFeet            = ;
			int duckBills             = ;
			int beaverTails           = ;
			int expected__            = ;

			clock_t start__           = clock();
			int received__            = PlatypusDuckAndBeaver().minimumAnimals(webbedFeet, duckBills, beaverTails);
			return verify_case(casenum__, expected__, received__, clock()-start__);
		}*/
		default:
			return -1;
		}
	}