int main(int argc, char* argv[])
{
	bool test_flag = true;
	//printf("max: %llu\n",std::numeric_limits<unsigned long long>::max());

	if (test_flag)
	{
		test_cases();
		//test_big_num();
	}
	else
	{
		char ch;
		while (scanf("%d",&ch) != EOF)
		{
			if (ch == -1)
			{
				break;
			}
			else
			{
				//Game<unsigned long long> game(2*ch);
				//printf("%llu\n",game.connections(1,2*ch));
				Game<unsigned int> game(2*ch);
				printf("%s\n",game.connections(1,2*ch).str().c_str());
			}
		}
	}

	return 0;
}
Пример #2
0
int sc_main( int, char** )
{
  int wl = 0, iwl = 0;
  test_cases(cout, wl, wl);

  return 0;
}
Пример #3
0
int main(int argc, char *argv[])
{
    assert(2 == argc);

    FILE *file = fopen(argv[1], "r");

    int T;
    fscanf(file, "%d", &T);
    for (int t = 1; t <= T; t++) {
        printf("Case #%d: %d\n", t, test_cases(file));
    }
    fclose(file);

    return 0;
}
Пример #4
0
void test_case(const std::string& filename) {
    boost::program_options::variables_map vm;
    std::ifstream test_cases(filename);

    std::string line;
    while (std::getline(test_cases, line)) {
        // Ignore empty lines and comments
        if (line.size() < 4 || line.substr(0, 3) != "// ") {
            continue;
        }

        std::string statement = line.substr(3, std::string::npos);

        if (!std::getline(test_cases, line)) {
            std::cerr << "Unexpected end of test cases." << std::endl;
            exit(-1);
        }

        std::istringstream ss{line};
        ss.ignore(std::numeric_limits<std::streamsize>::max(), ' ');
        std::vector<int> matches;
        int match_line;

        while (ss >> match_line) {
            matches.push_back(match_line);
        }

        std::cout << "Testing: " << statement << std::endl;

        auto term = parse_search_string(statement, vm);
        auto found = find_matches(filename, term, vm);

        assert(found.size() == matches.size());
        for (std::size_t s = 0; s < found.size(); ++s) {
            assert(found[s].first.first == matches[s]);
        }

        std::cout << "  Passed" << std::endl;
    }
}
Пример #5
0
int main(int argc, char **argv)
{
   test_cases();

   return 0;
}
Пример #6
0
int main()
{
   test_cases();
   return 0;
}