MDeath-Kid

- M I T & Y
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  ACM-DFS

DFS
摘要:DFS求连通分量。水题~1562/*8737028 MDK 1562 Accepted 712K 32MS G++ 1998B 2011-06-07 22:06:51 */struct fix{ int x,y;};int n,m,tim,sti,stj;bool isescape=0;char mat[MAXN][MAXN],v[MAXN][MAXN];fix p[]={{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};//周围8方向void dfs(int x,int y){ mat[x][y]='*'; for( 阅读全文

posted @ 2011-06-07 22:23 MDeath-Kid 阅读(328) 评论(0) 推荐(0)

摘要:/*2553589 2011-06-07 21:27:12 Accepted 2110 C++ 650 188 MDK */struct fix{ int x,y;};int n,m,tim,s1,s2;bool isescape=0;char mat[MAXN][MAXN];fix p[]={{1,0},{-1,0},{0,1},{0,-1}};void dfs(int x,int y,int timt){ if(x==s1&&y==s2&&timt==tim) { //DB("-=-=-="); isescape=1; return; } 阅读全文

posted @ 2011-06-07 21:26 MDeath-Kid 阅读(350) 评论(0) 推荐(0)

摘要:今天校里面比赛,A出来这样一道题。DFS+HASH+一个判断函数,本题就是如何存入电脑中,并且判断是否能够走到。/*ACMer:MDK2011-04-28 21:35:45Accepted 2412C++0208MDK*/#include <iostream>#include <stdio.h>#include <queue>#include <string.h>#include <math.h>#define MAXN 305using namespace std;typedef struct Bone{ bool up,down, 阅读全文

posted @ 2011-04-28 21:51 MDeath-Kid 阅读(588) 评论(0) 推荐(0)