結果

問題 No.923 オセロきりきざむたん
ユーザー FF256grhy
提出日時 2019-11-08 22:45:42
言語 C++14
(gcc 8.3.0)
結果
AC  
実行時間 21 ms
コード長 2,226 Byte
コンパイル時間 1,242 ms
使用メモリ 8,924 KB
最終ジャッジ日時 2019-11-08 23:50:33

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
00_sample_1.txt AC 6 ms
6,876 KB
00_sample_2.txt AC 6 ms
8,924 KB
00_sample_3.txt AC 6 ms
6,872 KB
00_sample_4.txt AC 6 ms
6,872 KB
10_hand_1.txt AC 6 ms
6,872 KB
10_hand_2.txt AC 6 ms
6,876 KB
10_hand_3.txt AC 6 ms
6,876 KB
10_hand_4.txt AC 7 ms
6,876 KB
10_hand_5.txt AC 6 ms
6,872 KB
10_hand_6.txt AC 6 ms
6,876 KB
10_hand_7.txt AC 7 ms
6,872 KB
10_hand_8.txt AC 6 ms
6,872 KB
10_hand_9.txt AC 6 ms
6,876 KB
10_hand_10.txt AC 6 ms
6,876 KB
10_hand_11.txt AC 6 ms
6,876 KB
10_hand_12.txt AC 6 ms
6,876 KB
10_hand_13.txt AC 6 ms
6,872 KB
10_hand_14.txt AC 6 ms
6,876 KB
10_hand_15.txt AC 6 ms
6,872 KB
10_hand_16.txt AC 6 ms
6,872 KB
11_hand_1.txt AC 6 ms
6,876 KB
11_hand_2.txt AC 6 ms
6,872 KB
11_hand_3.txt AC 7 ms
6,876 KB
11_hand_4.txt AC 7 ms
6,872 KB
11_hand_5.txt AC 7 ms
6,876 KB
11_hand_6.txt AC 6 ms
6,872 KB
11_hand_7.txt AC 11 ms
6,876 KB
11_hand_8.txt AC 10 ms
6,872 KB
11_hand_9.txt AC 9 ms
6,876 KB
11_hand_10.txt AC 9 ms
6,872 KB
11_hand_11.txt AC 8 ms
6,872 KB
11_hand_12.txt AC 9 ms
6,876 KB
20_general_1.txt AC 7 ms
6,872 KB
20_general_2.txt AC 6 ms
6,876 KB
20_general_3.txt AC 6 ms
6,876 KB
20_general_4.txt AC 6 ms
6,876 KB
21_general_1.txt AC 7 ms
6,872 KB
21_general_2.txt AC 6 ms
6,876 KB
21_general_3.txt AC 6 ms
6,876 KB
21_general_4.txt AC 6 ms
6,876 KB
22_general_1.txt AC 6 ms
6,876 KB
22_general_2.txt AC 7 ms
6,872 KB
22_general_3.txt AC 6 ms
6,872 KB
22_general_4.txt AC 7 ms
8,916 KB
22_general_5.txt AC 6 ms
6,876 KB
22_general_6.txt AC 7 ms
6,872 KB
22_general_7.txt AC 6 ms
6,872 KB
22_general_8.txt AC 7 ms
6,872 KB
22_general_9.txt AC 6 ms
8,916 KB
22_general_10.txt AC 7 ms
6,876 KB
23_general_1.txt AC 12 ms
8,920 KB
23_general_2.txt AC 12 ms
6,872 KB
23_general_3.txt AC 11 ms
6,876 KB
23_general_4.txt AC 16 ms
6,872 KB
23_general_5.txt AC 12 ms
6,876 KB
23_general_6.txt AC 13 ms
6,876 KB
23_general_7.txt AC 12 ms
6,876 KB
23_general_8.txt AC 7 ms
6,876 KB
23_general_9.txt AC 7 ms
8,920 KB
23_general_10.txt AC 6 ms
6,876 KB
23_general_11.txt AC 7 ms
8,920 KB
23_general_12.txt AC 6 ms
6,872 KB
23_general_13.txt AC 6 ms
6,876 KB
23_general_14.txt AC 7 ms
6,872 KB
23_general_15.txt AC 6 ms
6,876 KB
24_general_1.txt AC 21 ms
6,876 KB
24_general_2.txt AC 21 ms
6,876 KB
24_general_3.txt AC 21 ms
6,876 KB
24_general_4.txt AC 21 ms
6,872 KB
24_general_5.txt AC 9 ms
6,876 KB
24_general_6.txt AC 9 ms
6,872 KB
24_general_7.txt AC 21 ms
6,872 KB
24_general_8.txt AC 9 ms
6,876 KB
25_general_1.txt AC 6 ms
6,876 KB
25_general_2.txt AC 8 ms
8,916 KB
25_general_3.txt AC 8 ms
6,872 KB
25_general_4.txt AC 7 ms
6,876 KB
25_general_5.txt AC 8 ms
6,876 KB
25_general_6.txt AC 7 ms
6,876 KB
25_general_7.txt AC 9 ms
6,876 KB
25_general_8.txt AC 9 ms
6,876 KB
25_general_9.txt AC 8 ms
6,876 KB
25_general_10.txt AC 10 ms
6,876 KB
25_general_11.txt AC 8 ms
6,876 KB
25_general_12.txt AC 10 ms
6,876 KB
25_general_13.txt AC 9 ms
6,872 KB
25_general_14.txt AC 8 ms
6,876 KB
25_general_15.txt AC 9 ms
6,872 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