結果
| 問題 | No.405 ローマ数字の腕時計 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-08-06 14:09:40 |
| 言語 | F# (F# 10.0) |
| 結果 |
AC
|
| 実行時間 | 48 ms / 2,000 ms |
| コード長 | 572 bytes |
| 記録 | |
| コンパイル時間 | 5,818 ms |
| コンパイル使用メモリ | 195,752 KB |
| 実行使用メモリ | 32,808 KB |
| 最終ジャッジ日時 | 2026-03-28 08:36:41 |
| 合計ジャッジ時間 | 12,746 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (169 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net10.0/main.dll main -> /home/judge/data/code/bin/Release/net10.0/publish/
ソースコード
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 ()