結果

問題 No.560 ふしぎなナップサック
ユーザー natoriusannatoriusan
提出日時 2023-07-30 15:20:31
言語 F#
(F# 4.0)
結果
AC  
実行時間 286 ms / 2,000 ms
コード長 227 bytes
コンパイル時間 7,391 ms
コンパイル使用メモリ 202,844 KB
実行使用メモリ 34,884 KB
最終ジャッジ日時 2024-04-17 16:26:23
合計ジャッジ時間 11,426 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 283 ms
34,504 KB
testcase_01 AC 284 ms
34,200 KB
testcase_02 AC 281 ms
34,380 KB
testcase_03 AC 282 ms
34,496 KB
testcase_04 AC 281 ms
34,752 KB
testcase_05 AC 283 ms
33,756 KB
testcase_06 AC 282 ms
34,632 KB
testcase_07 AC 285 ms
33,820 KB
testcase_08 AC 286 ms
34,500 KB
testcase_09 AC 282 ms
34,884 KB
testcase_10 AC 283 ms
33,816 KB
testcase_11 AC 281 ms
34,632 KB
testcase_12 AC 282 ms
34,760 KB
testcase_13 AC 281 ms
34,628 KB
testcase_14 AC 281 ms
34,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (250 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
/home/judge/data/code/Main.fs(1,5): warning FS0025: この式のパターン マッチが不完全です たとえば、値 '[|_; _; _|]' はパターンに含まれないケースを示す可能性があります。 [/home/judge/data/code/main.fsproj]
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

let [|m; n|] = stdin.ReadLine().Split " " |> Array.map int

let rec e = function
    | 0 -> float m
    | n ->
        let prev = e (n-1)
        1./3. * prev * 2. + 1./3. * (prev + 1.) + 1./3. * 0.
        
e n |> printfn "%f"
0