結果

問題 No.923 オセロきりきざむたん
ユーザー lumc_
提出日時 2019-09-26 19:44:38
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 879 bytes
コンパイル時間 895 ms
コンパイル使用メモリ 103,644 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2024-09-15 02:48:18
合計ジャッジ時間 2,969 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 53 WA * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
    for(auto &e2 : e) e2 -= '0';
  }

  int ans = 1;

  // 縁が同色なら NO ! w
  int c[2] = {};
  for(int i = 0; i < h; i++) c[v[i][0]] = c[v[i][w-1]] = 1;
  for(int j = 0; j < w; j++) c[v[0][j]] = c[v[h-1][j]] = 1;
  if(c[0] + c[1] == 1) ans = 0;

  cout << (ans ? "YES" : "NO") << endl;
  return 0;
}
0