結果

問題 No.104 国道
ユーザー chike_pluschike_plus
提出日時 2019-04-03 09:13:35
言語 F#
(F# 4.0)
結果
AC  
実行時間 57 ms / 5,000 ms
コード長 336 bytes
コンパイル時間 6,426 ms
コンパイル使用メモリ 154,792 KB
実行使用メモリ 23,992 KB
最終ジャッジ日時 2023-08-22 13:48:39
合計ジャッジ時間 7,236 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
22,020 KB
testcase_01 AC 56 ms
23,992 KB
testcase_02 AC 56 ms
19,900 KB
testcase_03 AC 55 ms
19,896 KB
testcase_04 AC 56 ms
21,868 KB
testcase_05 AC 56 ms
21,988 KB
testcase_06 AC 56 ms
21,944 KB
testcase_07 AC 57 ms
23,960 KB
testcase_08 AC 56 ms
21,940 KB
testcase_09 AC 57 ms
21,952 KB
testcase_10 AC 56 ms
21,940 KB
testcase_11 AC 55 ms
21,864 KB
testcase_12 AC 56 ms
21,980 KB
testcase_13 AC 57 ms
23,868 KB
testcase_14 AC 55 ms
22,100 KB
testcase_15 AC 55 ms
22,056 KB
testcase_16 AC 56 ms
23,988 KB
testcase_17 AC 55 ms
23,976 KB
testcase_18 AC 56 ms
21,952 KB
testcase_19 AC 56 ms
21,964 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let ``No.104 国道``() =
  let rec loop acc lt =
    match lt with
    | []    -> acc
    | x::xs -> match x with
               | 'L' -> loop (acc * 2) xs
               | 'R' -> loop (acc * 2 + 1) xs
               | _   -> acc
               
  stdin.ReadLine()
  |> Seq.toList
  |> loop 1
  |> stdout.WriteLine

``No.104 国道``()
0