結果

問題 No.421 しろくろチョコレート
ユーザー tailstails
提出日時 2016-09-10 00:20:06
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 838 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 22,400 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-28 06:11:09
合計ジャッジ時間 1,797 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 0 ms
5,376 KB
testcase_03 AC 0 ms
5,376 KB
testcase_04 AC 0 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 WA -
testcase_12 AC 0 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 1 ms
5,376 KB
testcase_20 WA -
testcase_21 AC 2 ms
5,376 KB
testcase_22 WA -
testcase_23 AC 0 ms
5,376 KB
testcase_24 AC 1 ms
5,376 KB
testcase_25 AC 0 ms
5,376 KB
testcase_26 AC 0 ms
5,376 KB
testcase_27 AC 1 ms
5,376 KB
testcase_28 AC 2 ms
5,376 KB
testcase_29 AC 2 ms
5,376 KB
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 6 ms
5,376 KB
testcase_32 AC 2 ms
5,376 KB
testcase_33 AC 2 ms
5,376 KB
testcase_34 AC 1 ms
5,376 KB
testcase_35 AC 1 ms
5,376 KB
testcase_36 AC 1 ms
5,376 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 1 ms
5,376 KB
testcase_40 WA -
testcase_41 AC 1 ms
5,376 KB
testcase_42 AC 1 ms
5,376 KB
testcase_43 AC 1 ms
5,376 KB
testcase_44 AC 2 ms
5,376 KB
testcase_45 AC 0 ms
5,376 KB
testcase_46 AC 0 ms
5,376 KB
testcase_47 AC 1 ms
5,376 KB
testcase_48 AC 4 ms
5,376 KB
testcase_49 AC 1 ms
5,376 KB
testcase_50 AC 1 ms
5,376 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 AC 0 ms
5,376 KB
testcase_54 AC 1 ms
5,376 KB
testcase_55 AC 0 ms
5,376 KB
testcase_56 AC 0 ms
5,376 KB
testcase_57 WA -
testcase_58 AC 1 ms
5,376 KB
testcase_59 AC 1 ms
5,376 KB
testcase_60 WA -
testcase_61 WA -
testcase_62 AC 0 ms
5,376 KB
testcase_63 AC 1 ms
5,376 KB
testcase_64 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
    1 | a[52][52];
      | ^
main.c:1:1: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int]
main.c:2:1: warning: data definition has no type or storage class
    2 | s;
      | ^
main.c:2:1: warning: type defaults to ‘int’ in declaration of ‘s’ [-Wimplicit-int]
main.c:3:1: warning: data definition has no type or storage class
    3 | p[2];
      | ^
main.c:3:1: warning: type defaults to ‘int’ in declaration of ‘p’ [-Wimplicit-int]
main.c:5:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    5 | main(m,n,x,y,c,q,t){
      | ^~~~
main.c: In function ‘main’:
main.c:5:1: warning: type of ‘m’ defaults to ‘int’ [-Wimplicit-int]
main.c:5:1: warning: type of ‘n’ defaults to ‘int’ [-Wimplicit-int]
main.c:5:1: warning: type of ‘x’ defaults to ‘int’ [-Wimplicit-int]
main.c:5:1: warning: type of ‘y’ defaults to ‘int’ [-Wimplicit-int]
main.c:5:1: warning: type of ‘c’ defaults to ‘int’ [-Wimplicit-int]
main.c:5:1: warning: type of ‘q’ defaults to ‘int’ [-Wimplicit-int]
main.c:5:1: warning: type of ‘t’ defaults to ‘int’ [-Wimplicit-int]
main.c:6:9: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
    6 |         scanf("%d%d",&n,&m);
      |         ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | a[52][52];
main.c:6:9: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
    6 |         scanf("%d%d",&n,&m);
      |         ^~~~~
main.c:6:9: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:9:34: warning: format ‘%c’ expects argument of type ‘char *’, but argument 2 has type ‘int *’ [-Wformat=]
    9 |                         scanf(" %c",&a[y+1][x+1]);
      |                                 ~^  

ソースコード

diff #

a[52][52];
s;
p[2];

main(m,n,x,y,c,q,t){
	scanf("%d%d",&n,&m);
	for(y=0;y<n;++y){
		for(x=0;x<m;++x){
			scanf(" %c",&a[y+1][x+1]);
			a[y+1][x+1]>>=6;
		}
	}
	hoge:;
	do{
		q=0;
		for(y=0;y<n;++y){
			for(x=0;x<m;++x){
				if(a[y+1][x+1]){
					c=a[y+0][x+1]+a[y+2][x+1]+a[y+1][x+0]+a[y+1][x+2];
					if(c==1){
						q=1;s+=100;
						a[y+0][x+1]=a[y+2][x+1]=a[y+1][x+0]=a[y+1][x+2]=a[y+1][x+1]=0;
					}
				}
			}
		}
	}while(q);
	for(y=0;y<n;++y){
		for(x=0;x<m;++x){
			if(a[y+1][x+1]){
				if(a[y+1][x+2]){
					a[y+1][x+1]=a[y+1][x+2]=0;
					s+=100;
					goto hoge;
				}
				if(a[y+2][x+1]){
					a[y+1][x+1]=a[y+2][x+1]=0;
					s+=100;
					goto hoge;
				}
			}
		}
	}
	for(y=0;y<n;++y){
		for(x=0;x<m;++x){
			if(a[y+1][x+1]){
				p[x+y&1]++;
			}
		}
	}	
	s+=8*(p[0]<p[1]?p[0]:p[1])+p[0]+p[1];
	printf("%d",s);
	return 0;
}
0