摘要: http://ac.jobdu.com/problem.php?id=1140直接用的USACO上代码,不解释 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 int N=8; 5 bool placed[15][15]={false}; 6 int diagonals_l[50]={0}; 7 int diagonals_r[50]={0}; 8 bool column_ok[15]={true}; 9 int solutions[93]={0};10 int cur=1 阅读全文
posted @ 2012-02-15 21:23 linyvxiang 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 经典八皇后问题只写的最基本的,对称剪枝,位运算都没有用,以后有时间再看 1 /* ID:linyvxi1 2 PROB:checker 3 LANG:C++ 4 */ 5 #include <stdio.h> 6 #include <stdlib.h> 7 #include <string.h> 8 int N; 9 int total_solutions=0;10 int times_already_output=0;11 bool placed[15][15]={false};12 int diagonals_l[50]={0};13 int diago 阅读全文
posted @ 2012-02-15 18:21 linyvxiang 阅读(204) 评论(0) 推荐(0) 编辑