結果
問題 |
No.923 オセロきりきざむたん
|
ユーザー |
![]() |
提出日時 | 2019-09-26 19:40:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 892 bytes |
コンパイル時間 | 1,153 ms |
コンパイル使用メモリ | 103,608 KB |
実行使用メモリ | 6,400 KB |
最終ジャッジ日時 | 2024-09-15 02:48:14 |
合計ジャッジ時間 | 3,125 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 46 WA * 38 |
ソースコード
#if 0 嘘解法 #endif // includes {{{ #include<iostream> #include<iomanip> #include<algorithm> #include<vector> #include<stack> #include<queue> #include<map> #include<set> #include<tuple> #include<cmath> #include<random> #include<cassert> #include<bitset> #include<cstdlib> // #include<deque> // #include<multiset> // #include<cstring> // #include<bits/stdc++.h> // }}} using namespace std; using ll = long long; int main() { std::ios::sync_with_stdio(false), std::cin.tie(0); int h, w; cin >> h >> w; vector<string> v(h); for(auto &e: v) cin >> e; int ans = 1; // 2 * 2 四角形が同色なら NO ! w for(int i = 0; i + 1 < h; i++) for(int j = 0; j + 1 < w; j++) { int c[2] = {}; for(int di = 0; di < 2; di++) for(int dj = 0; dj < 2; dj++) c[v[i+di][j+dj]-'0'] = 1; if(c[0] + c[1] == 1) ans = 0; } cout << (ans ? "YES" : "NO") << endl; return 0; }