Dancing Links
文章平均质量分 81
ahfywff
这个作者很懒,什么都没留下…
展开
-
POJ 1084 Square Destroyer【Dancing Links重复覆盖】
Square Destroyer Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 2695 Accepted: 1101 Description The left figure below shows a complete 3*3 grid made with原创 2012-09-04 14:27:39 · 2374 阅读 · 0 评论 -
HDU 4069 Squiggly Sudoku【Dancing Links精确覆盖】
跟普通的数独有一点点不同,先预处理一下再用Dancing Links进行精确覆盖即可。 #include #include #include #include using namespace std; const int maxn = 9*9*9*9*9*4 + 10; const int oo = 1 << 30; const int maxrow = 9*9*9 + 10; co原创 2012-09-04 08:26:58 · 1094 阅读 · 0 评论 -
HDU 2295 Radar【二分+Dancing Links重复覆盖】
重复覆盖不同于精确覆盖,要求是在0/1矩阵中选择最少的行使每一列至少有一个1。进行重复覆盖时要使用估价函数来剪枝。 这题二分雷达半径,找到能将所有城市覆盖的最小半径即可。 #include #include #include #include #include using namespace std; const int maxn = 50*50 + 10; const i原创 2012-09-04 08:35:12 · 867 阅读 · 0 评论 -
HDU 3498 whosyourdaddy【Dancing Links重复覆盖】
有n个单位的敌人,对某个敌人进行攻击时该敌人以及与其直接相邻的敌人都会被消灭。问消灭所有敌人所需的最少攻击次数。 重复覆盖问题。我把此题贴出来是想说剪枝优化很有必要,一个小细节就能决定是TLE还是AC。 #include #include #include #include #include using namespace std; const int maxn = 60*60原创 2012-09-04 09:59:02 · 698 阅读 · 0 评论