結果

問題 No.158 奇妙なお使い
ユーザー 👑 hos.lyrichos.lyric
提出日時 2015-02-27 01:04:21
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 63 ms / 5,000 ms
コード長 491 bytes
コンパイル時間 1,167 ms
コンパイル使用メモリ 25,260 KB
実行使用メモリ 38,464 KB
最終ジャッジ日時 2023-09-06 03:06:22
合計ジャッジ時間 4,299 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
38,312 KB
testcase_01 AC 42 ms
38,384 KB
testcase_02 AC 52 ms
38,244 KB
testcase_03 AC 54 ms
38,360 KB
testcase_04 AC 49 ms
38,312 KB
testcase_05 AC 60 ms
38,452 KB
testcase_06 AC 57 ms
38,464 KB
testcase_07 AC 63 ms
38,356 KB
testcase_08 AC 42 ms
38,360 KB
testcase_09 AC 51 ms
38,256 KB
testcase_10 AC 55 ms
38,304 KB
testcase_11 AC 59 ms
38,316 KB
testcase_12 AC 56 ms
38,376 KB
testcase_13 AC 60 ms
38,348 KB
testcase_14 AC 51 ms
38,344 KB
testcase_15 AC 62 ms
38,248 KB
testcase_16 AC 54 ms
38,244 KB
testcase_17 AC 55 ms
38,324 KB
testcase_18 AC 61 ms
38,316 KB
testcase_19 AC 52 ms
38,364 KB
testcase_20 AC 60 ms
38,304 KB
testcase_21 AC 59 ms
38,456 KB
testcase_22 AC 59 ms
38,372 KB
testcase_23 AC 56 ms
38,456 KB
testcase_24 AC 56 ms
38,380 KB
testcase_25 AC 39 ms
38,456 KB
testcase_26 AC 44 ms
38,312 KB
testcase_27 AC 43 ms
38,460 KB
testcase_28 AC 48 ms
38,316 KB
testcase_29 AC 39 ms
38,408 KB
testcase_30 AC 47 ms
38,364 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class
 a,b,c,d[2],e[2],f[2],g[2],p[11][101][10001],i,w,x,y,z;
 ^
main.c:2:1: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int]
main.c:2:3: warning: type defaults to ‘int’ in declaration of ‘b’ [-Wimplicit-int]
 a,b,c,d[2],e[2],f[2],g[2],p[11][101][10001],i,w,x,y,z;
   ^
main.c:2:5: warning: type defaults to ‘int’ in declaration of ‘c’ [-Wimplicit-int]
 a,b,c,d[2],e[2],f[2],g[2],p[11][101][10001],i,w,x,y,z;
     ^
main.c:2:7: warning: type defaults to ‘int’ in declaration of ‘d’ [-Wimplicit-int]
 a,b,c,d[2],e[2],f[2],g[2],p[11][101][10001],i,w,x,y,z;
       ^
main.c:2:12: warning: type defaults to ‘int’ in declaration of ‘e’ [-Wimplicit-int]
 a,b,c,d[2],e[2],f[2],g[2],p[11][101][10001],i,w,x,y,z;
            ^
main.c:2:17: warning: type defaults to ‘int’ in declaration of ‘f’ [-Wimplicit-int]
 a,b,c,d[2],e[2],f[2],g[2],p[11][101][10001],i,w,x,y,z;
                 ^
main.c:2:22: warning: type defaults to ‘int’ in declaration of ‘g’ [-Wimplicit-int]
 a,b,c,d[2],e[2],f[2],g[2],p[11][101][10001],i,w,x,y,z;
                      ^
main.c:2:27: warning: type defaults to ‘int’ in declaration of ‘p’ [-Wimplicit-int]
 a,b,c,d[2],e[2],f[2],g[2],p[11][101][10001],i,w,x,y,z;
                           ^
main.c:2:45: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int]
 a,b,c,d[2],e[2],f[2],g[2],p[11][101][10001],i,w,x,y,z;
                                             ^
main.c:2:47: warning: type defaults to ‘int’ in declaration of ‘w’ [-Wimplicit-int]
 a,b,c,d[2],e[2],f[2],g[2],p[11][101][10001],i,w,x,y,z;
                                               ^
main.c:2:49: warning: type defaults to ‘int’ in declaration of ‘x’ [-Wimplicit-int]
 a,b,c,d[2],e[2],f[2],g[2],p[11][101][10001],i,w,x,y,z;
                                                 ^
main.c:2:51: warning: type defaults to ‘int’ in d

ソースコード

diff #

#define _(r,s) if(r&&t<s)t=s;
a,b,c,d[2],e[2],f[2],g[2],p[11][101][10001],i,w,x,y,z;
main(t){
	scanf("%d%d%d%d%d%d%d%d%d%d%d",&a,&b,&c,d,e,f,g,d+1,e+1,f+1,g+1);
	for(;w<=10000;++w)for(x=11;x--;)for(y=101;y--;){
		z=w-x*1000-y*100;
		if(z>=0){
			t=0;
			_(y>=10,p[x+1][y-10][z])
			_(z>=100,p[x][y+1][z-100])
			for(i=2;i--;)
				_(x>=d[i]/1000&&y>=d[i]/100%10&&z>=d[i]%100,
					1+p[x-d[i]/1000+e[i]][y-d[i]/100%10+f[i]][z-d[i]%100+g[i]])
			p[x][y][z]=t;
		}
	}
	printf("%d",p[a][b][c]);
}
0