結果

問題 No.405 ローマ数字の腕時計
ユーザー ichibanshiboriichibanshibori
提出日時 2016-08-06 14:09:40
言語 F#
(F# 4.0)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 572 bytes
コンパイル時間 3,110 ms
コンパイル使用メモリ 153,268 KB
実行使用メモリ 24,824 KB
最終ジャッジ日時 2023-09-21 00:16:08
合計ジャッジ時間 6,385 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
22,692 KB
testcase_01 AC 78 ms
22,636 KB
testcase_02 AC 79 ms
22,688 KB
testcase_03 AC 82 ms
24,780 KB
testcase_04 AC 78 ms
22,712 KB
testcase_05 AC 80 ms
22,808 KB
testcase_06 AC 81 ms
22,652 KB
testcase_07 AC 81 ms
22,768 KB
testcase_08 AC 78 ms
22,648 KB
testcase_09 AC 81 ms
24,792 KB
testcase_10 AC 81 ms
22,720 KB
testcase_11 AC 81 ms
22,904 KB
testcase_12 AC 81 ms
22,780 KB
testcase_13 AC 81 ms
22,712 KB
testcase_14 AC 79 ms
22,692 KB
testcase_15 AC 81 ms
24,824 KB
testcase_16 AC 81 ms
24,796 KB
testcase_17 AC 81 ms
22,756 KB
testcase_18 AC 78 ms
22,684 KB
testcase_19 AC 81 ms
24,824 KB
testcase_20 AC 81 ms
22,728 KB
testcase_21 AC 80 ms
20,836 KB
testcase_22 AC 80 ms
22,696 KB
testcase_23 AC 80 ms
22,768 KB
testcase_24 AC 81 ms
22,772 KB
testcase_25 AC 81 ms
22,756 KB
testcase_26 AC 81 ms
20,804 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let doIt () =
    let shour, dh = stdin.ReadLine () |> fun str -> str.Split () |> fun arr -> (arr.[0], int arr.[1])

    let hour = match shour with
               | "IX" -> 9
               | s -> seq s |> Seq.map (function | 'I' -> 1 | 'V' -> 5 | _ -> 10) |> Seq.sum

    (hour + (dh % 12) + 12) % 12 |>
    (function | 0 -> 12 | n -> n) |>
    (function | n when n <= 4 -> System.String('I', n)
              | n when n <= 8 -> "V" + System.String('I', n - 5)
              | 9 -> "IX"
              | n -> "X" + System.String('I', n - 10)) |>
    printfn "%s"

doIt ()
0