結果
問題 | No.923 オセロきりきざむたん |
ユーザー |
![]() |
提出日時 | 2019-11-08 22:41:21 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 747 bytes |
コンパイル時間 | 1,049 ms |
コンパイル使用メモリ | 58,584 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-15 02:52:50 |
合計ジャッジ時間 | 2,381 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 84 |
ソースコード
#include <iostream>#include <vector>#define llint long long#define inf 1e18using namespace std;llint h, w;char c[100005];int main(void){ios::sync_with_stdio(0);cin.tie(0);cin >> h >> w;for(int y = 0; y < h; y++){for(int x = 0; x < w; x++){cin >> c[y*w+x];}}bool row = false, col = false;for(int x = 0; x < w; x++){bool same = true;for(int y = 0; y < h; y++){if(c[y*w+x] != c[0*w+x]) same = false;}if(same) col = true;}for(int y = 0; y < h; y++){bool same = true;for(int x = 0; x < w; x++){if(c[y*w+x] != c[y*w+0]) same = false;}if(same) row = true;}if(row && col) cout << "NO" << endl;else cout << "YES" << endl;return 0;}