結果
問題 |
No.405 ローマ数字の腕時計
|
ユーザー |
![]() |
提出日時 | 2018-06-05 10:27:38 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 510 bytes |
コンパイル時間 | 3,576 ms |
コンパイル使用メモリ | 65,124 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-06 19:17:41 |
合計ジャッジ時間 | 4,094 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 18) Warning: imported and not used: 'sequtils' [UnusedImport]
ソースコード
import strutils, sequtils proc `*`(x: char, y: int): auto = repeat(x, y) proc `%`(x, y: int): auto = x mod y proc trfm(i: int): string = const tmax = 12 let i = (i % tmax + tmax) % tmax case i: of 0: result = "XII" of 1 .. 4: result = 'I' * i of 5 .. 8: result = 'V' & 'I' * (i % 5) of 9: result = "IX" else: result = 'X' & 'I' * (i % 10) let S1_T = readLine(stdin).split for i in 0 ..< 12: if i.trfm == S1_T[0]: echo (i + S1_T[1].parseInt).trfm