
搜索
文章平均质量分 79
guognib
这个作者很懒,什么都没留下…
展开
-
UVA 12649 Folding Machine(暴力搜索)
暴力搜索参考中山大学大牛代码#include#include#include#include#include#include#include#include#include#include#define REP(i, n) for(int i=0; i<n; i++)#define FF(i, a, b) for(int i=a; i<b; i++)#define原创 2013-11-19 21:01:48 · 1905 阅读 · 0 评论 -
八数码 poj1077 Eight(A*、IDA*)
八数码主要参考:刘亚宁学长的八数码八境界 等A*主要参考:百度百科,初识A*算法,深入A*算法 等IDA*主要参考:http://blog.youkuaiyun.com/urecvbnkuhbh_54245df/article/details/5856756,http://blog.youkuaiyun.com/nomad2/article/details/6562140 等人工智能课的作业,借此研究下八数码原创 2014-03-13 16:51:41 · 2545 阅读 · 0 评论 -
cf 85 E. Petya and Spiders
http://codeforces.com/contest/112/problem/E轮廓线dp。每个格子中的蜘蛛选一个去向,最终,使每个蜘蛛都有一个去向,同时保证有蜘蛛的格子最少。需要用4进制模拟此题还可以用DLX+二分来解,这个解法相对于轮廓线dp就很无脑了,不用考虑细节。以后再补上#include #include #include #include #include原创 2014-04-17 21:04:41 · 1054 阅读 · 0 评论 -
zoj 3781 Paint the Grid Reloaded (bfs)
int n, m;char s[44][44];int id[44][44];vectorG[1700];set S[1700];int sz;int dir_i[] = {0, -1, 0, 1};int dir_j[] = {-1, 0, 1, 0};bool check(int i, int j){ if (i >= 0 && i = 0 && j < m) ret原创 2014-04-18 19:26:22 · 1157 阅读 · 0 评论 -
DLX hdu2295 Radar
DLX + 二分半径#include#include #include #include #include #include using namespace std;const int maxn = 55 * 55;const int maxr = 55;const int maxc = 55;int U[maxn],D[maxn],L[maxn],R[maxn],C[原创 2014-04-16 15:33:13 · 720 阅读 · 0 评论 -
DLX (精确区间覆盖,重复区间覆盖)(模板)
参考:白书http://www.cnblogs.com/jh818012/p/3252154.htmlhttp://blog.youkuaiyun.com/fp_hzq/article/details/6795027需要注意的是(1)行列id的hash(2)行编号从1开始,列编号为1~c,结点0为表头结点(3)sz和ans等的初始化操作!!!精确区间覆盖原创 2014-04-16 14:21:41 · 1360 阅读 · 0 评论 -
DLX SPOJ 1771 Yet Another N-Queen Problem (八皇后变形)
网上模板ac:#include #include #include using namespace std;const int maxnode = 55 * 55 * 4;const int maxr = 55 * 55;const int maxc = 55 * 6;int U[maxnode],D[maxnode],L[maxnode],R[maxnode],C[maxn原创 2014-04-16 20:00:53 · 1081 阅读 · 0 评论 -
DLX (重复覆盖+费用不为1的最小费用)fzu Problem 2165 v11
http://acm.fzu.edu.cn/problem.php?pid=2165#include#include using namespace std;const int INF = 0x3f3f3f3f;const int maxnode = 110 * 110;const int maxr = 110;const int maxc = 110;int U[maxno原创 2014-04-18 15:19:56 · 700 阅读 · 0 评论