結果
問題 | No.923 オセロきりきざむたん |
ユーザー |
|
提出日時 | 2019-11-09 15:05:29 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 11 ms / 2,000 ms |
コード長 | 1,049 bytes |
コンパイル時間 | 1,412 ms |
コンパイル使用メモリ | 120,804 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-15 04:29:02 |
合計ジャッジ時間 | 3,848 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 84 |
ソースコード
#define _USE_MATH_DEFINES#include <cstdio>#include <iostream>#include <sstream>#include <fstream>#include <iomanip>#include <algorithm>#include <cmath>#include <complex>#include <string>#include <vector>#include <array>#include <list>#include <queue>#include <stack>#include <set>#include <map>#include <bitset>#include <numeric>#include <limits>#include <climits>#include <cfloat>#include <functional>#include <iterator>#include <memory>#include <regex>using namespace std;int main(){int h, w;cin >> h >> w;vector<int> yCnt(h), xCnt(w);for(int y=0; y<h; ++y){for(int x=0; x<w; ++x){char c;cin >> c;if(c == '1'){++ yCnt[y];++ xCnt[x];}}}sort(yCnt.begin(), yCnt.end());sort(xCnt.begin(), xCnt.end());if((yCnt.front() == 0 || yCnt.back() == w) && (xCnt.front() == 0 || xCnt.back() == h))cout << "NO" << endl;elsecout << "YES" << endl;return 0;}