結果

問題 No.923 オセロきりきざむたん
ユーザー lumc_lumc_
提出日時 2019-09-26 20:26:15
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,016 bytes
コンパイル時間 953 ms
コンパイル使用メモリ 107,972 KB
実行使用メモリ 8,704 KB
最終ジャッジ日時 2023-10-13 05:29:14
合計ジャッジ時間 7,670 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 2 ms
4,352 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 2 ms
4,352 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,352 KB
testcase_13 AC 2 ms
4,352 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 AC 2 ms
4,352 KB
testcase_21 AC 1 ms
4,348 KB
testcase_22 AC 3 ms
4,352 KB
testcase_23 AC 2 ms
4,352 KB
testcase_24 AC 2 ms
4,352 KB
testcase_25 AC 2 ms
4,352 KB
testcase_26 AC 10 ms
4,348 KB
testcase_27 AC 2 ms
4,348 KB
testcase_28 AC 83 ms
4,348 KB
testcase_29 AC 125 ms
4,348 KB
testcase_30 AC 21 ms
4,352 KB
testcase_31 AC 18 ms
4,352 KB
testcase_32 AC 1 ms
4,352 KB
testcase_33 AC 2 ms
4,352 KB
testcase_34 AC 1 ms
4,348 KB
testcase_35 AC 1 ms
4,348 KB
testcase_36 AC 2 ms
4,348 KB
testcase_37 AC 2 ms
4,348 KB
testcase_38 AC 1 ms
4,348 KB
testcase_39 AC 2 ms
4,348 KB
testcase_40 AC 2 ms
4,352 KB
testcase_41 AC 1 ms
4,348 KB
testcase_42 AC 2 ms
4,348 KB
testcase_43 AC 1 ms
4,348 KB
testcase_44 AC 2 ms
4,348 KB
testcase_45 AC 4 ms
4,348 KB
testcase_46 AC 3 ms
4,348 KB
testcase_47 AC 5 ms
4,352 KB
testcase_48 AC 2 ms
4,352 KB
testcase_49 AC 1 ms
4,352 KB
testcase_50 AC 180 ms
4,348 KB
testcase_51 AC 184 ms
4,348 KB
testcase_52 AC 1,095 ms
4,348 KB
testcase_53 TLE -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
testcase_60 -- -
testcase_61 -- -
testcase_62 -- -
testcase_63 -- -
testcase_64 -- -
testcase_65 -- -
testcase_66 -- -
testcase_67 -- -
testcase_68 -- -
testcase_69 -- -
testcase_70 -- -
testcase_71 -- -
testcase_72 -- -
testcase_73 -- -
testcase_74 -- -
testcase_75 -- -
testcase_76 -- -
testcase_77 -- -
testcase_78 -- -
testcase_79 -- -
testcase_80 -- -
testcase_81 -- -
testcase_82 -- -
testcase_83 -- -
testcase_84 -- -
testcase_85 -- -
testcase_86 -- -
testcase_87 -- -
権限があれば一括ダウンロードができます

ソースコード

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<chrono>
#include<functional>
// #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);
  int cnt[2] = {};
  for(auto &e: v) {
    cin >> e;
    for(auto &e2 : e) e2 -= '0', cnt[e2]++;
  }

  int ans = 1;

  for(int i = 0; i < h; i++) for(int j = 0; j < w; j++) {
    bool ng = 1;
    for(int k = 0; k < h; k++) {
      ng &= v[i][j] == v[k][j];
    }
    for(int k = 0; k < w; k++) {
      ng &= v[i][j] == v[i][k];
    }
    if(ng) ans = 0;
    if(ans == 0) break;
  }


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