結果
| 問題 | No.405 ローマ数字の腕時計 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-08-06 14:09:40 |
| 言語 | F# (F# 10.0) |
| 結果 |
AC
|
| 実行時間 | 45 ms / 2,000 ms |
| + 187µs | |
| コード長 | 572 bytes |
| 記録 | |
| コンパイル時間 | 4,898 ms |
| コンパイル使用メモリ | 211,576 KB |
| 実行使用メモリ | 32,748 KB |
| 最終ジャッジ日時 | 2026-08-10 03:18:55 |
| 合計ジャッジ時間 | 7,812 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (170 ミリ秒)。 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 ()