摘要: 对于DancingLinksX算法接精确覆盖的解释之前写的hust1017精确覆盖的代码,鉴于有的同学可能不是很了解其性能,所以对之前的代码进行展开解释。const int N = 1100 , V = 102020;int U[V] , D[V] , L[V] , R[V] , C[V];int H[N] , S[N] , mark[V];int size , n , m , OK[N] , flag;void Link(int r,int c) {Link(r,c)表示在第r行第c列插入一个“1”元素 S[c] ++; C[size] = c; //C[size]表示第size个元... 阅读全文
posted @ 2013-03-31 08:02 aiiYuu 阅读(140) 评论(0) 推荐(0)
摘要: http://acm.hust.edu.cn/problem.php?id=1017ThereisanN*Mmatrixwithonly0sand1s,(1<=N,M<=1000).Anexactcoverisaselectionofrowssuchthateverycolumnhasa1inexactlyoneoftheselectedrows.Trytofindouttheselectedrows.DLX接精确覆盖#include <cstdio>#include <cstring>#include <iostream>#include &l 阅读全文
posted @ 2013-03-31 02:19 aiiYuu 阅读(162) 评论(0) 推荐(0)