![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
回溯
文章平均质量分 77
limchiang
这个作者很懒,什么都没留下…
展开
-
回溯法
http://acm.hdu.edu.cn/showproblem.php?pid=1045 在最多为 4 * 4 的方阵中,圆形代表堡垒,正方形代表墙,堡垒射出的子弹无法穿过墙,求任何两个堡垒都不能射中对方的最大的堡垒放置数? #pragma warning (disable:4786) #include #include #include using namespace std原创 2012-12-02 17:08:26 · 207 阅读 · 0 评论 -
N皇后问题 (回溯+打表)
http://acm.hdu.edu.cn/showproblem.php?pid=2553 第一种方法,需打表,否则超时 #pragma warning (disable:4786) #include using namespace std; int used_column[12]; //标记列是否被用过 int used_Ldia[102],used_原创 2012-12-03 19:13:37 · 380 阅读 · 0 评论