結果
問題 | No.463 魔法使いのすごろく🎲 |
ユーザー | tails |
提出日時 | 2016-12-14 01:05:28 |
言語 | C90 (gcc 11.4.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 482 bytes |
コンパイル時間 | 701 ms |
コンパイル使用メモリ | 21,120 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-05-07 13:17:21 |
合計ジャッジ時間 | 11,577 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 287 ms
5,248 KB |
testcase_01 | AC | 93 ms
5,376 KB |
testcase_02 | AC | 110 ms
5,376 KB |
testcase_03 | AC | 10 ms
5,376 KB |
testcase_04 | AC | 129 ms
5,376 KB |
testcase_05 | AC | 135 ms
5,376 KB |
testcase_06 | AC | 4 ms
5,376 KB |
testcase_07 | AC | 20 ms
5,376 KB |
testcase_08 | AC | 126 ms
5,376 KB |
testcase_09 | AC | 418 ms
5,376 KB |
testcase_10 | AC | 69 ms
5,376 KB |
testcase_11 | AC | 626 ms
5,376 KB |
testcase_12 | AC | 327 ms
5,376 KB |
testcase_13 | AC | 1 ms
5,376 KB |
testcase_14 | AC | 620 ms
5,376 KB |
testcase_15 | AC | 745 ms
5,376 KB |
testcase_16 | AC | 17 ms
5,376 KB |
testcase_17 | AC | 920 ms
5,376 KB |
testcase_18 | AC | 2 ms
5,376 KB |
testcase_19 | AC | 71 ms
5,376 KB |
testcase_20 | AC | 3 ms
5,376 KB |
testcase_21 | AC | 1,395 ms
5,376 KB |
testcase_22 | TLE | - |
testcase_23 | TLE | - |
testcase_24 | AC | 96 ms
5,376 KB |
testcase_25 | AC | 339 ms
5,376 KB |
testcase_26 | AC | 492 ms
5,376 KB |
testcase_27 | AC | 231 ms
5,376 KB |
testcase_28 | AC | 1,716 ms
5,376 KB |
testcase_29 | AC | 275 ms
5,376 KB |
testcase_30 | AC | 831 ms
5,376 KB |
testcase_31 | AC | 284 ms
5,376 KB |
testcase_32 | AC | 814 ms
5,376 KB |
testcase_33 | AC | 341 ms
5,376 KB |
testcase_34 | AC | 131 ms
5,376 KB |
testcase_35 | AC | 1 ms
5,376 KB |
testcase_36 | AC | 3 ms
5,376 KB |
testcase_37 | AC | 25 ms
5,376 KB |
testcase_38 | AC | 1 ms
5,376 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<100000;++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; }