結果

問題 No.179 塗り分け
ユーザー ciel
提出日時 2015-04-05 23:43:38
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 476 bytes
コンパイル時間 491 ms
コンパイル使用メモリ 61,320 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-02 13:16:33
合計ジャッジ時間 1,761 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 6
other AC * 34 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
		for(int x=0;x<w;x++)for(int y=0;y<h;y++){
			if(m[y][x]=='#'){
				if(x+dx>=w||y+dy>=h||m[y+dy][x+dx]=='.')goto FAIL;
				m[y][x]=m[y+dy][x+dx]='.';
			}
		}
		puts("YES");
		return 0;
FAIL:;
	}
	puts("NO");
}
0