コード例 #1
0
int main(void) {
	//LARGE_INTEGER start_time, finish_time, liFrequency;
	int testCase;
	char temp;

	//QueryPerformanceFrequency(&liFrequency);
	freopen("input.txt", "r", stdin);

	scanf("%d%c", &testCase, &temp);

	while (testCase--) {
		nCol = 0;
		nRow = 0;
		memset(Matrix, NULL, sizeof(struct str_node) * MAX_COL * MAX_ROW);
		RootNode = &Root;
		memset(RowHeader, NULL, sizeof(struct str_node) * MAX_ROW);
		memset(Data, 0, sizeof(char) * MAX_COL * MAX_ROW);
		memset(Result, 0, sizeof(int) * MAX_ROW);
		nResult = 0;
		Finished = 0;
		GlobalProgressUpdate = 0;
		MaxK = 0;

		BuildData();
		LoadPuzzle();

		//QueryPerformanceCounter(&start_time);
		Search(0);
		//QueryPerformanceCounter(&finish_time);

		//printf("Time : %f\n", (double)(finish_time.QuadPart - start_time.QuadPart) / (double)liFrequency.QuadPart);
	}

	return 0;
}
コード例 #2
0
ファイル: dancing_links.cpp プロジェクト: matefh/sudoku
int main(void) {
	int t;
	scanf("%d", &t);
	while (t--) {
		memset(Data, 0, sizeof(Data));
		Finished = 0;
		MaxK = 0;
		nResult = 0;
		BuildData();
		LoadPuzzle();
		struct str_node *r;
		for (r = RootNode->Right; r != RootNode; r = r->Right)
			r->count = countOnes(r);
		Search(0);
		if (t > 0)
			printf("\n");
	}
	return 0;
}