diff --git a/QUSTOJ/1101.cpp b/QUSTOJ/1101.cpp new file mode 100644 index 0000000..c3d9ad6 --- /dev/null +++ b/QUSTOJ/1101.cpp @@ -0,0 +1,52 @@ +#include +#include +#include + +using namespace std; + +//Written by Kiritow On Dec. 2ND, 2015 +char map[500][500]; +bool vis[500][500]; + +int xmax,ymax; + +void dfs(int y,int x) +{ + if(y<0||x<0||y>=ymax||x>=xmax) return; + if(vis[y][x]||map[y][x]=='*') return; + vis[y][x]=true; + dfs(y-1,x); + dfs(y+1,x); + dfs(y,x-1); + dfs(y,x+1); +} + +int main() +{ + scanf("%d %d",&xmax,&ymax); + for(int i=0;i