depth first search

POJ 2386 Lake Counting

解説 特になし。蟻本に書いてある。 #include <iostream> using namespace std; int n,m,c; char map[102][102]; void dfs(int x, int y){ map[x][y] = '.'; for(int i = -1; i <= 1; i++){ for(int j = -1; j <= 1; j++){ int nx = x + i, ny = y + j; if(0 <= nx && </iostream>…