結果
問題 | No.463 魔法使いのすごろく🎲 |
ユーザー | tails |
提出日時 | 2016-12-14 01:09:17 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 15 ms / 2,000 ms |
コード長 | 479 bytes |
コンパイル時間 | 263 ms |
コンパイル使用メモリ | 21,504 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-05-07 13:17:28 |
合計ジャッジ時間 | 1,384 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,812 KB |
testcase_01 | AC | 1 ms
6,940 KB |
testcase_02 | AC | 1 ms
6,940 KB |
testcase_03 | AC | 1 ms
6,944 KB |
testcase_04 | AC | 1 ms
6,944 KB |
testcase_05 | AC | 2 ms
6,948 KB |
testcase_06 | AC | 1 ms
6,944 KB |
testcase_07 | AC | 1 ms
6,940 KB |
testcase_08 | AC | 1 ms
6,944 KB |
testcase_09 | AC | 3 ms
6,940 KB |
testcase_10 | AC | 1 ms
6,944 KB |
testcase_11 | AC | 4 ms
6,940 KB |
testcase_12 | AC | 2 ms
6,940 KB |
testcase_13 | AC | 1 ms
6,944 KB |
testcase_14 | AC | 4 ms
6,940 KB |
testcase_15 | AC | 5 ms
6,944 KB |
testcase_16 | AC | 1 ms
6,940 KB |
testcase_17 | AC | 6 ms
6,940 KB |
testcase_18 | AC | 1 ms
6,940 KB |
testcase_19 | AC | 1 ms
6,940 KB |
testcase_20 | AC | 1 ms
6,940 KB |
testcase_21 | AC | 8 ms
6,940 KB |
testcase_22 | AC | 15 ms
6,940 KB |
testcase_23 | AC | 15 ms
6,940 KB |
testcase_24 | AC | 1 ms
6,940 KB |
testcase_25 | AC | 2 ms
6,944 KB |
testcase_26 | AC | 3 ms
6,940 KB |
testcase_27 | AC | 2 ms
6,940 KB |
testcase_28 | AC | 9 ms
6,944 KB |
testcase_29 | AC | 2 ms
6,940 KB |
testcase_30 | AC | 4 ms
6,940 KB |
testcase_31 | AC | 2 ms
6,940 KB |
testcase_32 | AC | 5 ms
6,944 KB |
testcase_33 | AC | 3 ms
6,944 KB |
testcase_34 | AC | 1 ms
6,944 KB |
testcase_35 | AC | 0 ms
6,940 KB |
testcase_36 | AC | 1 ms
6,944 KB |
testcase_37 | AC | 1 ms
6,940 KB |
testcase_38 | AC | 0 ms
6,944 KB |
コンパイルメッセージ
main.c:3:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 3 | main(n,m,h,i,j,k){ | ^~~~ main.c: In function ‘main’: main.c:3:1: warning: type of ‘n’ defaults to ‘int’ [-Wimplicit-int] main.c:3:1: warning: type of ‘m’ defaults to ‘int’ [-Wimplicit-int] main.c:3:1: warning: type of ‘h’ defaults to ‘int’ [-Wimplicit-int] main.c:3:1: warning: type of ‘i’ defaults to ‘int’ [-Wimplicit-int] main.c:3:1: warning: type of ‘j’ defaults to ‘int’ [-Wimplicit-int] main.c:3:1: warning: type of ‘k’ defaults to ‘int’ [-Wimplicit-int] main.c:5:9: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 5 | scanf("%d%d",&n,&m); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | double c[110],e0[110],e1[110]; main.c:5:9: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 5 | scanf("%d%d",&n,&m); | ^~~~~ main.c:5:9: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:31:9: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 31 | printf("%.10f\n",e0[1]); | ^~~~~~ main.c:31:9: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:31:9: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch] main.c:31:9: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
ソースコード
double c[110],e0[110],e1[110]; main(n,m,h,i,j,k){ scanf("%d%d",&n,&m); for(i=2;i<n;++i){ scanf("%lf",&c[i]); } for(h=0;h<500;++h){ for(i=n;--i;){ double e0i=0; double e1i=0; for(j=i+1;j<=i+m;++j){ k=j<n?j:n*2-j; e0i+=e0[k]+c[k]; e1i+=e1[k]+c[k]; } e0i/=m; e1i/=m; for(j=i+1;j<=i+m;++j){ k=j<n?j:n*2-j; if(e0i>e1[k]+c[k]){ e0i=e1[k]+c[k]; } } e0[i]=e0i; e1[i]=e1i; } } printf("%.10f\n",e0[1]); return 0; }