結果

問題 No.179 塗り分け
ユーザー makecirmakecir
提出日時 2017-06-03 16:53:47
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 847 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 31,104 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-14 06:45:50
合計ジャッジ時間 1,676 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <stdio.h>

typedef struct{
	char map[50][50];
}Map;

int h,w;
int check(Map m,int x,int y){
	int i,j;
	Map t;
	t=m;
	for(i=0;i<h;i++){
		for(j=0;j<w;j++){
			if(t.map[i][j]=='#'){
				if(t.map[i+y][j+x]=='#'){
					t.map[i][j]='.';
					t.map[i+y][j+x]='.';
				}
				else{
					return -1;
				}
			}
		}
	}
	return 0;
}
	
int main(){
	int i,j,ip,jp,fl;
	Map master;
	scanf("%d %d",&h,&w);
	getchar();
	for(i=0;i<h;i++){
		scanf("%s",master.map[i]);
		if(i!=h-1){
			getchar();
		}
	}
	for(i=0;i<h;i++){
		for(j=0;j<w;j++){
			if(master.map[i][j]=='#'){
				for(ip=i;ip<h;ip++){
					for(jp=j+1;jp<w;jp++){
						if(master.map[ip][jp]=='#'){
							fl=check(master,jp-j,ip-i);
							if(fl==0){
								printf("YES");
								return 0;
							}
						}
					}
				}
				printf("NO");
				return 0;
			}
		}
	}
	printf("NO");
	return 0;
} 
0