結果
問題 | No.179 塗り分け |
ユーザー |
![]() |
提出日時 | 2017-05-20 06:40:35 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 889 bytes |
コンパイル時間 | 1,419 ms |
コンパイル使用メモリ | 137,832 KB |
最終ジャッジ日時 | 2025-01-05 00:26:40 |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 3 |
other | AC * 17 WA * 23 |
ソースコード
#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); vector<array<int,2>> t; for(int y=0;y<h;y++){ cin>>s[y]; for(int x=0;x<w;x++){ if(s[y][x]=='#'){ t.push_back(array<int,2>({x,y})); } } } if(t.size()==0){ puts("NO"); return 0; } for(int y=-50;y<50;y++){ for(int x=-50;x<50;x++){ auto u=t; while(1){ auto f=*u.begin(); f[0]+=x; f[1]+=y; auto v=find(u.begin(),u.end(),f); if(v==u.end()){ break; } u.erase(u.begin()); u.erase(v); } if(u.size()==0){ puts("YES"); return 0; } } } return 0; }