結果

問題 No.452 横着者のビンゴゲーム
ユーザー tailstails
提出日時 2016-12-03 00:29:49
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 410 ms / 3,000 ms
コード長 1,064 bytes
コンパイル時間 467 ms
コンパイル使用メモリ 22,912 KB
実行使用メモリ 16,136 KB
最終ジャッジ日時 2024-05-06 14:09:28
合計ジャッジ時間 10,689 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
9,508 KB
testcase_01 AC 9 ms
9,916 KB
testcase_02 AC 15 ms
10,532 KB
testcase_03 AC 47 ms
10,292 KB
testcase_04 AC 17 ms
9,636 KB
testcase_05 AC 54 ms
9,888 KB
testcase_06 AC 15 ms
10,016 KB
testcase_07 AC 30 ms
10,656 KB
testcase_08 AC 34 ms
10,356 KB
testcase_09 AC 17 ms
10,924 KB
testcase_10 AC 17 ms
9,788 KB
testcase_11 AC 33 ms
10,496 KB
testcase_12 AC 22 ms
10,212 KB
testcase_13 AC 9 ms
10,780 KB
testcase_14 AC 342 ms
9,964 KB
testcase_15 AC 358 ms
10,888 KB
testcase_16 AC 331 ms
10,460 KB
testcase_17 AC 410 ms
16,136 KB
testcase_18 AC 177 ms
11,148 KB
testcase_19 AC 250 ms
12,716 KB
testcase_20 AC 311 ms
12,916 KB
testcase_21 AC 204 ms
9,732 KB
testcase_22 AC 329 ms
14,100 KB
testcase_23 AC 241 ms
9,648 KB
testcase_24 AC 348 ms
15,512 KB
testcase_25 AC 224 ms
12,960 KB
testcase_26 AC 263 ms
10,632 KB
testcase_27 AC 324 ms
11,776 KB
testcase_28 AC 174 ms
10,400 KB
testcase_29 AC 241 ms
11,016 KB
testcase_30 AC 230 ms
9,928 KB
testcase_31 AC 157 ms
11,812 KB
testcase_32 AC 219 ms
11,792 KB
testcase_33 AC 275 ms
10,824 KB
testcase_34 AC 220 ms
10,552 KB
testcase_35 AC 330 ms
12,812 KB
testcase_36 AC 252 ms
13,032 KB
testcase_37 AC 316 ms
15,056 KB
testcase_38 AC 377 ms
9,984 KB
testcase_39 AC 353 ms
10,108 KB
testcase_40 AC 326 ms
11,024 KB
testcase_41 AC 363 ms
10,664 KB
testcase_42 AC 327 ms
9,708 KB
testcase_43 AC 367 ms
9,956 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
    1 | 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
    1 | 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
    1 | 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
    1 | 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
    1 | 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
    2 | 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
    3 | 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]
    4 | 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]
    4 | i(v){scanf("%d",&v);return v;}
      |      ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | n;m;b;d;z;
main.c:4:6: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
    4 | i(v){scanf("%d",&v);return v;

ソースコード

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