//https://www.acmicpc.net/problem/1010 #include using namespace std;int dp[31][31]; int main(){ int t; cin >> t; while(t-->0){ int n, m; cin >> n >> m; for(int i=1; i
//https://www.acmicpc.net/problem/2146 #include #include using namespace std;bool map[100][100];int visited[100][100];int visited2[100][100];int N, cnt;int min1=10001; int dy[4]={0,0,1,-1};int dx[4]={1,-1,0,0}; void dfs(int y, int x, int land){ visited[y][x]=land; for(int i=0; i=0 && ny=0 && nx