博弈,主要是求SG值。终于做出点儿感觉。
/* 1760 */
#include <cstdio>
#include <cstring>
#include <cstdlib> #define MAXN 55 char map[MAXN][MAXN];
int n, m; int cal_SG() {
int i, j, k, r, p; for (i=; i<n-; ++i) {
for (j=; j<m-; ++j) {
if (map[i][j]=='' && map[i][j+]=='' && map[i+][j]=='' && map[i+][j+]=='') {
map[i][j] = map[i][j+] = map[i+][j] = map[i+][j+] = '';
k = cal_SG();
map[i][j] = map[i][j+] = map[i+][j] = map[i+][j+] = '';
if (k == )
return ;
}
}
}
return ;
} int main() {
int i, j, k; #ifndef ONLINE_JUDGE
freopen("data.in", "r", stdin);
#endif while (scanf("%d %d", &n, &m) != EOF) {
for (i=; i<n; ++i)
scanf("%s", map[i]);
if (cal_SG() == )
puts("No");
else
puts("Yes");
} return ;
}