結果

問題 No.923 オセロきりきざむたん
ユーザー FF256grhyFF256grhy
提出日時 2019-11-08 22:45:42
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 2,226 bytes
コンパイル時間 1,473 ms
コンパイル使用メモリ 165,172 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2023-10-13 05:33:32
合計ジャッジ時間 4,688 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,548 KB
testcase_01 AC 4 ms
6,480 KB
testcase_02 AC 4 ms
6,476 KB
testcase_03 AC 3 ms
6,604 KB
testcase_04 AC 3 ms
6,644 KB
testcase_05 AC 4 ms
6,480 KB
testcase_06 AC 4 ms
6,748 KB
testcase_07 AC 4 ms
6,608 KB
testcase_08 AC 3 ms
6,608 KB
testcase_09 AC 4 ms
6,528 KB
testcase_10 AC 4 ms
6,468 KB
testcase_11 AC 3 ms
6,532 KB
testcase_12 AC 4 ms
6,680 KB
testcase_13 AC 4 ms
6,480 KB
testcase_14 AC 4 ms
6,536 KB
testcase_15 AC 4 ms
6,632 KB
testcase_16 AC 4 ms
6,480 KB
testcase_17 AC 3 ms
6,524 KB
testcase_18 AC 4 ms
6,580 KB
testcase_19 AC 4 ms
6,472 KB
testcase_20 AC 4 ms
6,692 KB
testcase_21 AC 4 ms
6,676 KB
testcase_22 AC 4 ms
6,560 KB
testcase_23 AC 4 ms
6,680 KB
testcase_24 AC 4 ms
6,464 KB
testcase_25 AC 4 ms
6,612 KB
testcase_26 AC 6 ms
6,700 KB
testcase_27 AC 6 ms
6,708 KB
testcase_28 AC 7 ms
6,688 KB
testcase_29 AC 7 ms
6,796 KB
testcase_30 AC 5 ms
6,536 KB
testcase_31 AC 5 ms
6,672 KB
testcase_32 AC 4 ms
6,488 KB
testcase_33 AC 4 ms
6,536 KB
testcase_34 AC 4 ms
6,532 KB
testcase_35 AC 4 ms
6,544 KB
testcase_36 AC 4 ms
6,472 KB
testcase_37 AC 4 ms
6,488 KB
testcase_38 AC 4 ms
6,476 KB
testcase_39 AC 4 ms
6,556 KB
testcase_40 AC 4 ms
6,532 KB
testcase_41 AC 4 ms
6,484 KB
testcase_42 AC 4 ms
6,536 KB
testcase_43 AC 4 ms
6,544 KB
testcase_44 AC 4 ms
6,544 KB
testcase_45 AC 4 ms
6,544 KB
testcase_46 AC 4 ms
6,496 KB
testcase_47 AC 4 ms
6,508 KB
testcase_48 AC 4 ms
6,552 KB
testcase_49 AC 4 ms
6,504 KB
testcase_50 AC 7 ms
6,720 KB
testcase_51 AC 7 ms
6,660 KB
testcase_52 AC 7 ms
6,648 KB
testcase_53 AC 11 ms
6,720 KB
testcase_54 AC 8 ms
6,540 KB
testcase_55 AC 8 ms
6,744 KB
testcase_56 AC 8 ms
6,600 KB
testcase_57 AC 4 ms
6,504 KB
testcase_58 AC 4 ms
6,560 KB
testcase_59 AC 4 ms
6,492 KB
testcase_60 AC 4 ms
6,560 KB
testcase_61 AC 4 ms
6,480 KB
testcase_62 AC 4 ms
6,528 KB
testcase_63 AC 4 ms
6,556 KB
testcase_64 AC 4 ms
6,480 KB
testcase_65 AC 16 ms
6,856 KB
testcase_66 AC 15 ms
6,908 KB
testcase_67 AC 16 ms
6,996 KB
testcase_68 AC 16 ms
7,052 KB
testcase_69 AC 6 ms
7,052 KB
testcase_70 AC 6 ms
7,324 KB
testcase_71 AC 15 ms
6,848 KB
testcase_72 AC 6 ms
7,052 KB
testcase_73 AC 4 ms
6,544 KB
testcase_74 AC 4 ms
6,536 KB
testcase_75 AC 6 ms
6,604 KB
testcase_76 AC 4 ms
6,624 KB
testcase_77 AC 6 ms
6,648 KB
testcase_78 AC 4 ms
6,564 KB
testcase_79 AC 5 ms
6,644 KB
testcase_80 AC 5 ms
6,624 KB
testcase_81 AC 5 ms
6,672 KB
testcase_82 AC 7 ms
6,720 KB
testcase_83 AC 5 ms
6,900 KB
testcase_84 AC 6 ms
6,656 KB
testcase_85 AC 6 ms
6,740 KB
testcase_86 AC 5 ms
6,628 KB
testcase_87 AC 6 ms
6,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long   signed int LL;
typedef long long unsigned int LU;
#define incID(i, l, r) for(LL i = (l)    ; i <  (r); ++i)
#define incII(i, l, r) for(LL i = (l)    ; i <= (r); ++i)
#define decID(i, l, r) for(LL i = (r) - 1; i >= (l); --i)
#define decII(i, l, r) for(LL i = (r)    ; i >= (l); --i)
#define inc(i, n)  incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define dec(i, n)  decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))
#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
template<typename T> bool setmin  (T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmax  (T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
LL mo(LL a, LL b) { assert(b > 0); a %= b; if(a < 0) { a += b; } return a; }
LL fl(LL a, LL b) { assert(b > 0); return (a > 0 ? a / b : (a - b + 1) / b); }
LL ce(LL a, LL b) { assert(b > 0); return (a < 0 ? a / b : (a + b - 1) / b); }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
#define bit(b, i) (((b) >> (i)) & 1)
#define BC __builtin_popcountll
#define SC static_cast
#define SI(v) SC<int>(v.size())
#define SL(v) SC<LL >(v.size())
#define RF(e, v) for(auto & e: v)
#define ef else if
#define UR assert(false)

// ---- ----

const int M = 100000;
int h, w, hh[M], ww[M];
string s[M];

int main() {
	cin >> h >> w;
	inc(i, h) { cin >> s[i]; }
	
	inc(i, h) {
	inc(j, w) {
		if(s[i][j] == '0') { hh[i] |= 1; ww[j] |= 1; }
		if(s[i][j] == '1') { hh[i] |= 2; ww[j] |= 2; }
	}
	}
	
	bool f = true, g = true;
	inc(i, h) { f &= (hh[i] == 3); }
	inc(j, w) { g &= (ww[j] == 3); }
	
	cout << (f || g ? "YES" : "NO") << endl;
	
	return 0;
}
0