結果
問題 | No.179 塗り分け |
ユーザー |
![]() |
提出日時 | 2019-07-03 22:23:54 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 686 bytes |
コンパイル時間 | 2,175 ms |
コンパイル使用メモリ | 197,508 KB |
最終ジャッジ日時 | 2025-01-07 05:53:04 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 6 |
other | AC * 34 WA * 6 |
ソースコード
#include <bits/stdc++.h> int main() { int H,W; std::cin >> H >> W; std::vector<std::string> S(H); for(auto&v:S)std::cin >> v; bool ans = false; for(int y=-H+1;!ans&&y<H;++y){ for(int x=-W+1;!ans&&x<W;++x){ if(!x&&!y)continue; bool result = true; auto S2 = S; for(int h=0;result&&h<H;++h){ for(int w=-W+1;result&&w<W;++w){ if(S2[h][w]!='#')continue; S2[h][w]='R'; int h2=h+y,w2=w+x; if(h2<0||H<=h2||w2<0||W<=w2){ result = false; break; } if(S2[h2][w2]=='#'){ S2[h2][w2]='B'; continue; } result = false; } } if(result)ans = true; } } std::cout << (ans?"YES":"NO") << std::endl; }