BFS
文章平均质量分 77
iYUNDI
iYUNDI
展开
-
[hoj]Key Task
BFS,细节 注意到达一处时,先更新状态,再判mapp。 边界啊~~但是貌似codeblocks可以自动无视越界。。 #include #include #include #include using namespace std; typedef struct point{ int x,y,key,step; }point; int movee [4][2] = {原创 2013-07-24 23:47:44 · 665 阅读 · 0 评论 -
[hoj]Dungeon Master
依然BFS。 三维迷宫的竖坐标是第一维!一不小心就写串了~~~ /*This Code is Submitted by Iris for Problem 1448 at 2013-07-24 17:48:59*/ #include #include #include #include using namespace std; typedef struct point{ int原创 2013-07-24 23:53:29 · 601 阅读 · 0 评论 -
[hoj]Knight Moves
BFS,先到达即停止。 //因为奇葩的内网而无故CE不止 /*This Code is Submitted by Iris for Problem 1440 at 2013-07-24 22:46:09*/ #include #include #include #include using namespace std; int move[8][2] = {{-2,1},{-1,2},{原创 2013-07-24 23:50:36 · 724 阅读 · 0 评论 -
[poj 1985]Cow Marathon[求树的直径][BFS]
阅读代码 注释之 #include #include #include #include using namespace std; #define MAXV 50000 #define MAXE 100000 /*对一个图进行BFS,两次,找到直径*/ typedef struct{ int t,w,next; }Edge; Edge edge[MAXE]; int n,m;原创 2013-08-07 20:17:19 · 827 阅读 · 0 评论