結果
問題 | No.179 塗り分け |
ユーザー |
![]() |
提出日時 | 2017-09-17 18:13:15 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 916 bytes |
コンパイル時間 | 1,598 ms |
コンパイル使用メモリ | 166,880 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 01:56:48 |
合計ジャッジ時間 | 3,398 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 WA * 1 |
other | AC * 25 WA * 15 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ul; typedef signed long long ll; ul over = 1000000007; int main(void) { cin.tie(0); ios::sync_with_stdio(false); cout << fixed; int h, w; cin >> h >> w; bool isb[h][w]; int cnt = 0; for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { char c; cin >> c; isb[i][j] = (c=='#' ? true : false); if (isb[i][j]) cnt++; } } if (cnt%2==1) {cout << "NO" << endl; return 0;} for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { if (i==0 && j==0) continue; int f_cnt = 0; for (int k = 0; k < h; ++k) { for (int l = 0; l < w; ++l) { if (isb[k][l] && i+k<h && j+l<w) { if (isb[i+k][j+l]) f_cnt++; } } } if (f_cnt == cnt/2) {cout << "YES" << endl; return 0;} } } cout << "NO" << endl; return 0; }