結果

問題 No.452 横着者のビンゴゲーム
ユーザー tailstails
提出日時 2016-12-03 00:29:49
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 412 ms / 3,000 ms
コード長 1,064 bytes
コンパイル時間 844 ms
コンパイル使用メモリ 26,176 KB
実行使用メモリ 15,628 KB
最終ジャッジ日時 2023-08-19 06:56:15
合計ジャッジ時間 10,744 ms
ジャッジサーバーID
(参考情報)
judge13 / judge9
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
11,276 KB
testcase_01 AC 10 ms
11,316 KB
testcase_02 AC 14 ms
11,324 KB
testcase_03 AC 46 ms
11,356 KB
testcase_04 AC 17 ms
11,292 KB
testcase_05 AC 53 ms
11,380 KB
testcase_06 AC 15 ms
11,336 KB
testcase_07 AC 27 ms
11,380 KB
testcase_08 AC 33 ms
11,324 KB
testcase_09 AC 16 ms
11,412 KB
testcase_10 AC 17 ms
11,344 KB
testcase_11 AC 30 ms
11,240 KB
testcase_12 AC 20 ms
11,364 KB
testcase_13 AC 8 ms
11,216 KB
testcase_14 AC 334 ms
11,544 KB
testcase_15 AC 329 ms
11,428 KB
testcase_16 AC 304 ms
11,512 KB
testcase_17 AC 412 ms
15,528 KB
testcase_18 AC 160 ms
11,388 KB
testcase_19 AC 243 ms
11,604 KB
testcase_20 AC 326 ms
13,628 KB
testcase_21 AC 216 ms
11,452 KB
testcase_22 AC 297 ms
15,620 KB
testcase_23 AC 223 ms
11,464 KB
testcase_24 AC 333 ms
15,628 KB
testcase_25 AC 196 ms
13,508 KB
testcase_26 AC 223 ms
11,496 KB
testcase_27 AC 295 ms
11,580 KB
testcase_28 AC 171 ms
11,432 KB
testcase_29 AC 216 ms
11,552 KB
testcase_30 AC 223 ms
11,440 KB
testcase_31 AC 154 ms
11,536 KB
testcase_32 AC 206 ms
11,576 KB
testcase_33 AC 264 ms
11,520 KB
testcase_34 AC 208 ms
11,516 KB
testcase_35 AC 304 ms
13,636 KB
testcase_36 AC 229 ms
13,512 KB
testcase_37 AC 289 ms
15,588 KB
testcase_38 AC 315 ms
11,436 KB
testcase_39 AC 303 ms
11,488 KB
testcase_40 AC 304 ms
11,472 KB
testcase_41 AC 299 ms
11,452 KB
testcase_42 AC 297 ms
11,568 KB
testcase_43 AC 312 ms
11,504 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
 n;m;b;d;z;
 ^
main.c:1:1: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int]
main.c:1:3: warning: data definition has no type or storage class
 n;m;b;d;z;
   ^
main.c:1:3: warning: type defaults to ‘int’ in declaration of ‘m’ [-Wimplicit-int]
main.c:1:5: warning: data definition has no type or storage class
 n;m;b;d;z;
     ^
main.c:1:5: warning: type defaults to ‘int’ in declaration of ‘b’ [-Wimplicit-int]
main.c:1:7: warning: data definition has no type or storage class
 n;m;b;d;z;
       ^
main.c:1:7: warning: type defaults to ‘int’ in declaration of ‘d’ [-Wimplicit-int]
main.c:1:9: warning: data definition has no type or storage class
 n;m;b;d;z;
         ^
main.c:1:9: warning: type defaults to ‘int’ in declaration of ‘z’ [-Wimplicit-int]
main.c:2:1: warning: data definition has no type or storage class
 c[200][100][100];
 ^
main.c:2:1: warning: type defaults to ‘int’ in declaration of ‘c’ [-Wimplicit-int]
main.c:3:1: warning: data definition has no type or storage class
 u[2000000];
 ^
main.c:3:1: warning: type defaults to ‘int’ in declaration of ‘u’ [-Wimplicit-int]
main.c:4:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 i(v){scanf("%d",&v);return v;}
 ^
main.c: In function ‘i’:
main.c:4:1: warning: type of ‘v’ defaults to ‘int’ [-Wimplicit-int]
main.c:4:6: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
 i(v){scanf("%d",&v);return v;}
      ^~~~~
main.c:4:6: warning: incompatible implicit declaration of built-in function ‘scanf’
main.c:4:6: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:1:1:
+#include <stdio.h>
 n;m;b;d;z;
main.c:4:6:
 i(v){scanf("%d",&v);return v;}
      ^~~~~
main.c: At top level:
main.c:6:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 f(d,e,x,y){
 ^
main.c: In function ‘f’:
mai

ソースコード

diff #

n;m;b;d;z;
c[200][100][100];
u[2000000];
i(v){scanf("%d",&v);return v;}

f(d,e,x,y){
	for(d=0;d<m;++d){
		if(d-z){
			for(y=0;y<n;++y){
				e=0;
				for(x=0;x<n;++x){
					e+=!u[c[d][y][x]];
				}
				if(b>e)b=e;
			}
			for(x=0;x<n;++x){
				e=0;
				for(y=0;y<n;++y){
					e+=!u[c[d][y][x]];
				}
				if(b>e)b=e;
			}
			{
				e=0;
				for(y=0;y<n;++y){
					e+=!u[c[d][y][y]];
				}
			}
			{
				if(b>e)b=e;
				e=0;
				for(y=0;y<n;++y){
					e+=!u[c[d][y][~y+n]];
				}
				if(b>e)b=e;
			}
		}
	}
}

main(x,y){
	b=n=i();m=i();
	for(z=0;z<m;++z){
		for(y=0;y<n;++y){
			for(x=0;x<n;++x){
				c[z][y][x]=i();
			}
		}
	}
	for(z=0;z<m;++z){
		for(y=0;y<n;++y){
			bzero(u,sizeof u);
			for(x=0;x<n;++x){
				u[c[z][y][x]]=1;
			}
			f(z);
		}
		for(x=0;x<n;++x){
			bzero(u,sizeof u);
			for(y=0;y<n;++y){
				u[c[z][y][x]]=1;
			}
			f(z);
		}
		{
			bzero(u,sizeof u);
			for(y=0;y<n;++y){
				u[c[z][y][y]]=1;
			}
			f(z);
		}
		{
			bzero(u,sizeof u);
			for(y=0;y<n;++y){
				u[c[z][y][~y+n]]=1;
			}
			f(z);
		}
	}
		
	printf("%d",n+b-1);
	return 0;
}
0