dfs
123~mutouren
这个作者很懒,什么都没留下…
展开
-
hdu 1312 Red and Black
#include<bits/stdc++.h> using namespace std; const int M = 22; char Map[M][M]; bool vis[M][M]; int w,h,ans; int dir[4][2] = {{0,1},{0,-1},{1,0},{-1,0}}; void dfs(int si, int sj){ if(si<1||si>w||sj<1||sj>h) return; ans++; vis[si][sj]=1;原创 2021-07-29 19:25:36 · 63 阅读 · 0 评论 -
hdu 1241 Oil Deposits
#include<bits/stdc++.h> using namespace std; int i,j,n,m; const int M = 105; int dir[8][2]={{1,0},{-1,0},{0,1},{0,-1},{1,1},{-1,1},{1,-1},{-1,-1}}; char a[M][M]; void dfs(int si,int sj){ int di,dj; for(int k=0;k<8;k++){ di=si+dir[k原创 2021-07-28 19:52:08 · 51 阅读 · 0 评论 -
hdu 1010 Tempter of the Bone
#include<bits/stdc++.h> using namespace std; char Map[9][9]; int n,m,t,di,dj; bool escape; int dir[4][2] = {{0,-1},{0,1},{1,0},{-1,0}}; void dfs(int si,int sj,int cnt); int main (){ int i,j,si,sj; while(cin>>n>>m>>t){ if(n==0&am原创 2021-07-28 16:54:30 · 73 阅读 · 0 评论