結果

問題 No.179 塗り分け
ユーザー makecirmakecir
提出日時 2017-06-03 17:02:22
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 935 bytes
コンパイル時間 479 ms
コンパイル使用メモリ 31,716 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-14 06:46:05
合計ジャッジ時間 1,594 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 WA -
testcase_02 AC 1 ms
6,944 KB
testcase_03 WA -
testcase_04 AC 1 ms
6,944 KB
testcase_05 WA -
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 1 ms
6,944 KB
testcase_09 AC 1 ms
6,948 KB
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 1 ms
6,940 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 1 ms
6,940 KB
testcase_17 AC 1 ms
6,940 KB
testcase_18 AC 1 ms
6,940 KB
testcase_19 AC 1 ms
6,944 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 1 ms
6,944 KB
testcase_24 WA -
testcase_25 AC 1 ms
6,940 KB
testcase_26 AC 1 ms
6,944 KB
testcase_27 WA -
testcase_28 AC 1 ms
6,944 KB
testcase_29 WA -
testcase_30 AC 1 ms
6,940 KB
testcase_31 WA -
testcase_32 AC 1 ms
6,944 KB
testcase_33 WA -
testcase_34 AC 1 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 <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=0;jp<w;jp++){
                        if(jp==0&&ip==i){
                            jp=j+1;
					    }
						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