結果

問題 No.45 回転寿司
ユーザー chike_pluschike_plus
提出日時 2019-03-28 12:50:48
言語 F#
(F# 4.0)
結果
AC  
実行時間 67 ms / 5,000 ms
コード長 405 bytes
コンパイル時間 4,658 ms
コンパイル使用メモリ 156,000 KB
実行使用メモリ 24,508 KB
最終ジャッジ日時 2023-08-27 16:55:47
合計ジャッジ時間 7,875 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
22,524 KB
testcase_01 AC 66 ms
22,488 KB
testcase_02 AC 67 ms
24,448 KB
testcase_03 AC 65 ms
22,376 KB
testcase_04 AC 65 ms
22,488 KB
testcase_05 AC 58 ms
24,368 KB
testcase_06 AC 65 ms
20,344 KB
testcase_07 AC 66 ms
22,332 KB
testcase_08 AC 65 ms
22,384 KB
testcase_09 AC 67 ms
24,444 KB
testcase_10 AC 66 ms
24,488 KB
testcase_11 AC 65 ms
22,452 KB
testcase_12 AC 67 ms
24,432 KB
testcase_13 AC 59 ms
22,320 KB
testcase_14 AC 58 ms
22,420 KB
testcase_15 AC 62 ms
22,368 KB
testcase_16 AC 63 ms
22,432 KB
testcase_17 AC 63 ms
22,316 KB
testcase_18 AC 64 ms
22,560 KB
testcase_19 AC 63 ms
24,492 KB
testcase_20 AC 56 ms
24,408 KB
testcase_21 AC 56 ms
22,368 KB
testcase_22 AC 56 ms
22,272 KB
testcase_23 AC 56 ms
20,224 KB
testcase_24 AC 61 ms
22,468 KB
testcase_25 AC 56 ms
20,320 KB
testcase_26 AC 64 ms
22,444 KB
testcase_27 AC 64 ms
24,440 KB
testcase_28 AC 63 ms
24,404 KB
testcase_29 AC 62 ms
22,432 KB
testcase_30 AC 64 ms
24,500 KB
testcase_31 AC 56 ms
24,508 KB
testcase_32 AC 56 ms
22,320 KB
testcase_33 AC 63 ms
22,484 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let ``No.45 回転寿司``() =
    
  let n = stdin.ReadLine() |> int
  let v = stdin.ReadLine().Split(' ')
          |> Array.map (fun s -> s |> int)
          |> Array.toList
  let rec loop r l =
    let prepre, pre = r
    match l with
    | []   -> 0
    | [x]  -> max (prepre + x) pre
    | x::xs-> loop (pre, max (prepre + x) pre) xs
  
  loop (0,0) v
  |> stdout.WriteLine

``No.45 回転寿司``()
0