結果

問題 No.179 塗り分け
ユーザー tabataba
提出日時 2017-05-20 06:40:35
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 889 bytes
コンパイル時間 1,466 ms
コンパイル使用メモリ 141,240 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-14 06:29:05
合計ジャッジ時間 2,998 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 WA -
testcase_02 AC 2 ms
6,940 KB
testcase_03 WA -
testcase_04 AC 2 ms
6,940 KB
testcase_05 WA -
testcase_06 AC 3 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 11 ms
6,940 KB
testcase_11 AC 10 ms
6,944 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 1 ms
6,940 KB
testcase_18 AC 6 ms
6,940 KB
testcase_19 AC 6 ms
6,944 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 4 ms
6,940 KB
testcase_24 WA -
testcase_25 AC 2 ms
6,944 KB
testcase_26 AC 4 ms
6,944 KB
testcase_27 WA -
testcase_28 AC 5 ms
6,940 KB
testcase_29 WA -
testcase_30 AC 6 ms
6,940 KB
testcase_31 WA -
testcase_32 AC 7 ms
6,944 KB
testcase_33 WA -
testcase_34 AC 8 ms
6,940 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0