結果
問題 |
No.179 塗り分け
|
ユーザー |
|
提出日時 | 2015-04-05 23:44:56 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 519 bytes |
コンパイル時間 | 483 ms |
コンパイル使用メモリ | 61,260 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-02 13:17:08 |
合計ジャッジ時間 | 1,855 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 6 |
other | AC * 35 WA * 5 |
ソースコード
#include <iostream> #include <string> #include <vector> #include <cstdio> using namespace std; int main(){ int h,w; cin>>h>>w; vector<string>m0(h); for(int i=0;i<h;i++)cin>>m0[i]; for(int dx=0;dx<w;dx++)for(int dy=0;dy<h;dy++)if(dx||dy){ vector<string>m=m0; bool f=false; for(int x=0;x<w;x++)for(int y=0;y<h;y++){ if(m[y][x]=='#'){ f=true; if(x+dx>=w||y+dy>=h||m[y+dy][x+dx]=='.')goto FAIL; m[y][x]=m[y+dy][x+dx]='.'; } } if(f){ puts("YES"); return 0; } FAIL:; } puts("NO"); }