結果
| 問題 |
No.179 塗り分け
|
| ユーザー |
tkzw_21
|
| 提出日時 | 2015-04-05 23:48:48 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 855 bytes |
| コンパイル時間 | 1,284 ms |
| コンパイル使用メモリ | 162,004 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-02 13:17:58 |
| 合計ジャッジ時間 | 2,573 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 6 |
| other | AC * 35 WA * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int h,w;
bool func(int y,int x,vector<string> s){
for(int i=0;i<h;i++){
for(int j=0;j<w;j++){
if(s[i][j] == '#'){
if(i+y >= h || j+x >= w)return false;
if(s[i+y][j+x] != '#')return false;
s[i+y][j+x] = '.';
}
}
}
return true;
}
int main(void) {
cin >> h >> w;
vector<string> s(h);
for(int i=0;i<h;i++){
cin >> s[i];
}
int cnt = 0;
for(int i=0;i<h;i++){
for(int j=0;j<w;j++){
if(s[i][j] == '#')cnt++;
}
}
bool f = false;
for(int i=0;i<h;i++){
for(int j=0;j<w;j++){
if(i == 0 && j == 0)continue;
f |= func(i,j,s);
}
}
cout << ( (f && cnt>=2) ?"YES":"NO") << endl;
return 0;
}
tkzw_21