数独
摘要:
这是求解数独的程序。还是深搜。class Sudoku { int table[9][9]; bool occupied[9][9][9]; int solution[9][9];public: Sudoku(int* tab = 0) { set(tab); } void set(int* tab) { if (!tab) return; for (int i = 0; i < 81; ++i) table[i/9][i%9] = tab[i]; init(); } int solve() { int cnt = 0; solve(count(), cnt); return cnt; 阅读全文
posted @ 2011-03-11 20:42 acmaru 阅读(178) 评论(0) 推荐(0) 编辑