Dfs
曜雨丶
这个作者很懒,什么都没留下…
展开
-
【深度优先搜索】HDU 2553 N皇后问题
今天的主菜是搜索,想起来初中就听过八皇后问题了啊。。。当年有一个学编程的机会在我眼前我没有去珍惜,到现在我只能默默后悔。。。嘛,其实我也没那么在意啦 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2553 皇后的移动方式是直线和斜线不限长移动,毕竟最强兵种。 所以每一行必然只有一个皇后,因此我们可以选择以每行为单位来进行DFS(深度优先原创 2015-07-04 18:22:50 · 402 阅读 · 0 评论 -
【树形DP】 POJ 2152 Fire
Fire Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 1412 Accepted: 751 Description Country Z has N cities, which are numbered from 1 to N. Cities are conn原创 2016-07-22 09:09:34 · 359 阅读 · 0 评论 -
【树分治】 POJ 1741 Tree
Tree Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 17624 Accepted: 5757 Description Give a tree with n vertices,each edge has a length(positive integer l原创 2016-07-22 10:43:57 · 362 阅读 · 0 评论