結果
| 問題 |
No.179 塗り分け
|
| コンテスト | |
| ユーザー |
ngtkana
|
| 提出日時 | 2020-03-23 21:57:20 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 991 bytes |
| コンパイル時間 | 2,217 ms |
| コンパイル使用メモリ | 200,036 KB |
| 最終ジャッジ日時 | 2025-01-09 09:53:29 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 6 |
| other | AC * 34 WA * 6 |
ソースコード
#include<bits/stdc++.h>
using lint=long long;
int main(){
std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
lint h,w;std::cin>>h>>w;
std::vector<std::vector<lint>>a(h,std::vector<lint>(w));
for(lint i=0;i<h;i++){
for(lint j=0;j<w;j++){
char c;std::cin>>c;
a.at(i).at(j)=c=='#';
}
}
for(lint di=0;di<h;di++){
for(lint dj=0;dj<w;dj++){
if(!di&&!dj)continue;
auto b=a;
for(lint i=0;i<h;i++){
for(lint j=0;j<w;j++){
if(!b.at(i).at(j))continue;
lint ni=i+di,nj=j+dj;
if(h<=ni||w<=nj||!std::exchange(b.at(ni).at(nj),false)){
goto Impossible;
}
}
}
std::cout<<"YES"<<'\n';
return 0;
Impossible:;
}
}
std::cout<<"NO"<<'\n';
}
ngtkana