結果
| 問題 |
No.923 オセロきりきざむたん
|
| コンテスト | |
| ユーザー |
lumc_
|
| 提出日時 | 2019-09-26 20:26:15 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,016 bytes |
| コンパイル時間 | 935 ms |
| コンパイル使用メモリ | 110,116 KB |
| 実行使用メモリ | 11,552 KB |
| 最終ジャッジ日時 | 2024-09-15 02:48:45 |
| 合計ジャッジ時間 | 7,004 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 49 TLE * 1 -- * 34 |
ソースコード
#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;
}
lumc_