結果
問題 | No.158 奇妙なお使い |
ユーザー | 👑 hos.lyric |
提出日時 | 2015-02-27 01:05:47 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 49 ms / 5,000 ms |
コード長 | 502 bytes |
コンパイル時間 | 512 ms |
コンパイル使用メモリ | 21,376 KB |
実行使用メモリ | 11,392 KB |
最終ジャッジ日時 | 2024-06-28 22:23:33 |
合計ジャッジ時間 | 2,575 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 37 ms
11,264 KB |
testcase_01 | AC | 35 ms
11,392 KB |
testcase_02 | AC | 41 ms
11,264 KB |
testcase_03 | AC | 43 ms
11,392 KB |
testcase_04 | AC | 39 ms
11,392 KB |
testcase_05 | AC | 49 ms
11,392 KB |
testcase_06 | AC | 43 ms
11,264 KB |
testcase_07 | AC | 45 ms
11,392 KB |
testcase_08 | AC | 31 ms
11,392 KB |
testcase_09 | AC | 37 ms
11,264 KB |
testcase_10 | AC | 39 ms
11,264 KB |
testcase_11 | AC | 43 ms
11,264 KB |
testcase_12 | AC | 39 ms
11,264 KB |
testcase_13 | AC | 40 ms
11,392 KB |
testcase_14 | AC | 38 ms
11,264 KB |
testcase_15 | AC | 43 ms
11,392 KB |
testcase_16 | AC | 40 ms
11,264 KB |
testcase_17 | AC | 40 ms
11,264 KB |
testcase_18 | AC | 45 ms
11,264 KB |
testcase_19 | AC | 36 ms
11,264 KB |
testcase_20 | AC | 46 ms
11,264 KB |
testcase_21 | AC | 46 ms
11,264 KB |
testcase_22 | AC | 45 ms
11,264 KB |
testcase_23 | AC | 40 ms
11,264 KB |
testcase_24 | AC | 42 ms
11,264 KB |
testcase_25 | AC | 31 ms
11,264 KB |
testcase_26 | AC | 34 ms
11,264 KB |
testcase_27 | AC | 33 ms
11,264 KB |
testcase_28 | AC | 37 ms
11,264 KB |
testcase_29 | AC | 32 ms
11,264 KB |
testcase_30 | AC | 35 ms
11,264 KB |
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class 2 | 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] 2 | 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] 2 | 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] 2 | 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] 2 | 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] 2 | 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] 2 | 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] 2 | 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] 2 | 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] 2 | 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] 2 | a,b,c,d[2],e
ソースコード
#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]); return 0; }