搜索
u010912405
这个作者很懒,什么都没留下…
展开
-
poj 1253 三维数组+广搜+减枝
#include #include #include #include using namespace std; const int N=51; int A,B,C,step; int map[N][N][N]; int visited[N][N][N]; int ds[6][3]={{1,0,0},{-1,0,0},{0,1,0},{0,-1,0},{0,0,-1},{0,0,1}}; str原创 2013-08-20 20:51:21 · 854 阅读 · 0 评论 -
hdu2553 n皇后问题
#include #include #include using namespace std; const int N=11; int map[N][N]; int col[N],a[N];//保存预处理结果,一直TLE,就是因为这 int n; int ans; int place(int k) { for(int i=1;i<k;i++) {原创 2013-08-21 12:09:48 · 458 阅读 · 0 评论 -
hdu1016深搜
#include #include #include using namespace std; const int N=21; int n,ans[100],visited[30]; int prime(int m) { //int k=(int)sqrt(m);//一直wa! for(int i=2;i<=m/2;i++) { if原创 2013-08-20 20:46:50 · 442 阅读 · 0 评论 -
poj 1088滑雪 记忆化搜索
#include #include #include using namespace std; const int N=102; int s[N][N]; int map[N][N]; int inf=-0xffffff; int ds[4][2]={0,1,1,0,0,-1,-1,0}; int n,m; int judge(int a,int b) { if(a>=1&&a=1&原创 2013-08-23 13:17:19 · 402 阅读 · 0 评论 -
hdu1026 优先队列+广搜
#include #include #include #include using namespace std; struct node { int x,y; int step; friend bool operator<(node a,node b) { return b.step<a.step;原创 2013-08-24 13:57:26 · 507 阅读 · 0 评论 -
hdu1035
#include #include #include using namespace std; const int N=11; int m,n,p; char map[N][N]; int a[N][N]; struct Point { int x; int y; // int step; // int visited; }point[N*N];原创 2013-08-29 12:31:57 · 432 阅读 · 0 评论