2009年8月3日

hdu 1429 priority_queue+bfs

摘要: #include <iostream>#include <queue>using namespace std;int n, m, t;char map[20][20];int dir[4][2] = {{0,1},{0,-1},{1,0},{-1,0}};bool hash[20][20][1100];int keybin[10] = {1,2,4,8,16,32,64,1... 阅读全文

posted @ 2009-08-03 15:02 ZAFU_VA 阅读(335) 评论(0) 推荐(0) 编辑

hdu 1732 推箱子 三个箱子

摘要: #include <iostream>#include <queue>using namespace std;struct Point{ int x, y;};struct Node{ Point you, box[3]; int step;};int n, m;char map[8][8];Node first, next;bool hash[8][8][8][8][8]... 阅读全文

posted @ 2009-08-03 13:14 ZAFU_VA 阅读(505) 评论(0) 推荐(0) 编辑

hdu 1254 推箱子

摘要: #include <iostream>#include <queue>using namespace std;int map[7][7];bool hash[7][7];int dir[4][2] = {{0,1},{0,-1},{1,0},{-1,0}};int fuck[7][7][7][7];//记录该状态下的最短步数int n, m;struct Point{ ch... 阅读全文

posted @ 2009-08-03 10:01 ZAFU_VA 阅读(412) 评论(0) 推荐(0) 编辑

2009年8月2日

pku 1101 连连看

摘要: #include <iostream>#include <queue>#include <cmath>using namespace std;const int MAX_SIZE = 75;int dir[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};class Point{public: int x,y,step,times;};cl... 阅读全文

posted @ 2009-08-02 16:41 ZAFU_VA 阅读(260) 评论(0) 推荐(1) 编辑

2009年8月1日

hdu 2699 ( Five in a Row ) 五子棋

摘要: #include <iostream>#include <queue>using namespace std;struct Node{ char x, y, time, dirc; bool no_stone;};char map[15][15], c;int dir[4][2] = {{0,1},{1,0},{1,-1},{1,1}};bool bfs(int x, in... 阅读全文

posted @ 2009-08-01 21:30 ZAFU_VA 阅读(243) 评论(0) 推荐(0) 编辑

2009年7月31日

pku 3463 dijkstra求次短路

摘要: #include <iostream>#include <vector>using namespace std;const int MAXN = 1010;const int INF = 2100000000;typedef pair<int, int> PAIR;vector < PAIR > map[MAXN];int dist[MAXN][2]... 阅读全文

posted @ 2009-07-31 18:01 ZAFU_VA 阅读(915) 评论(0) 推荐(0) 编辑

2009年7月30日

hdu 2955 Robberies 01背包

摘要: //以抢的钱为背包容量 求最大容量且概率又小于被抓概率的#include <iostream>using namespace std;struct Bag{ double pro; int money;};Bag b[101];double dp[10001];inline double max(double a, double b){ return a>b?a:b;}int m... 阅读全文

posted @ 2009-07-30 20:16 ZAFU_VA 阅读(315) 评论(0) 推荐(1) 编辑

2009年7月27日

pku 2195 km上浙大模版

摘要: //构图 每个人到每个房子的距离#include <iostream>#include <queue>using namespace std;#define inf 1000000000#define _clr(x) memset(x,0xff,sizeof(int)*n)const int MAXN = 110;int n, m;char map[MAXN][MAXN];... 阅读全文

posted @ 2009-07-27 20:34 ZAFU_VA 阅读(422) 评论(0) 推荐(1) 编辑

pku 2446 构图 二分完全匹配

摘要: #include <iostream>using namespace std;const int MAXN = 33;bool map[MAXN*MAXN][MAXN*MAXN];bool hash[MAXN][MAXN];int pre[MAXN*MAXN];bool fuck[MAXN*MAXN];int nu[MAXN][MAXN];int dir[4][2] = {{1,0},... 阅读全文

posted @ 2009-07-27 20:31 ZAFU_VA 阅读(203) 评论(0) 推荐(1) 编辑

pku 1511 静态邻接表 + SPFA

摘要: //最近写些图论 邻接表 真是好东西 #include <iostream>#include <queue>using namespace std;const int MAXN = 1000010;const int inf = INT_MAX;typedef struct { int next, v, cost;}Edge;Edge e[MAXN], oppe[MAXN... 阅读全文

posted @ 2009-07-27 20:29 ZAFU_VA 阅读(439) 评论(0) 推荐(2) 编辑

导航