結果
問題 | No.179 塗り分け |
ユーザー |
![]() |
提出日時 | 2017-05-20 06:45:39 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 908 bytes |
コンパイル時間 | 1,493 ms |
コンパイル使用メモリ | 137,716 KB |
最終ジャッジ日時 | 2025-01-05 00:26:47 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 WA * 1 |
other | AC * 22 WA * 18 |
ソースコード
#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||t.size()&1){ puts("NO"); return 0; } for(int y=-50;y<50;y++){ for(int x=-50;x<50;x++){ auto u=t; while(u.size()){ 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; }