結果
| 問題 |
No.179 塗り分け
|
| コンテスト | |
| ユーザー |
taba
|
| 提出日時 | 2017-05-20 06:14:18 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 970 bytes |
| コンパイル時間 | 1,717 ms |
| コンパイル使用メモリ | 136,316 KB |
| 最終ジャッジ日時 | 2025-01-05 00:26:21 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 6 |
| other | AC * 34 WA * 6 |
ソースコード
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cassert>
#include <random>
#include <vector>
#include <algorithm>
#include <array>
#include <functional>
#include <utility>
#include <regex>
#include <tuple>
#include <map>
#include <set>
#include <iostream>
using namespace std;
int main(){
int h,w;
-scanf("%d%d",&h,&w);
vector<string> s(h);
for(auto &i:s){
cin>>i;
}
string result="NO";
for(int y=0;y<h;y++){
for(int x=0;x<w;x++){
if(x==0&&y==0)continue;
auto t=s;
bool ok=true;
for(int v=0;v+y<h;v++){
for(int u=0;u+x<w;u++){
if(t[v][u]=='#'){
if(t[v+y][u+x]!='#'){
v=h;
ok=false;
break;
}
t[v][u]=t[v+y][u+x]='.';
}
}
}
int cnt=0;
for(auto i:t){
cnt+=count(i.begin(),i.end(),'#');
}
if(cnt==0&&ok){
result="YES";
//cout<<x<<","<<y<<endl;
y=h;
break;
}
}
}
cout<<result<<endl;
for(auto i:s){
//cout<<i<<endl;
}
return 0;
}
taba