結果

問題 No.405 ローマ数字の腕時計
ユーザー komkomhkomkomh
提出日時 2019-06-09 12:06:26
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 294 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 15,181 ms
コンパイル使用メモリ 421,688 KB
実行使用メモリ 53,264 KB
最終ジャッジ日時 2023-09-21 00:41:06
合計ジャッジ時間 24,430 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 282 ms
52,720 KB
testcase_01 AC 283 ms
52,756 KB
testcase_02 AC 282 ms
52,756 KB
testcase_03 AC 281 ms
52,848 KB
testcase_04 AC 279 ms
52,756 KB
testcase_05 AC 282 ms
52,832 KB
testcase_06 AC 285 ms
52,808 KB
testcase_07 AC 281 ms
52,844 KB
testcase_08 AC 277 ms
53,128 KB
testcase_09 AC 281 ms
52,860 KB
testcase_10 AC 279 ms
52,876 KB
testcase_11 AC 280 ms
53,264 KB
testcase_12 AC 280 ms
52,752 KB
testcase_13 AC 283 ms
53,004 KB
testcase_14 AC 281 ms
52,744 KB
testcase_15 AC 284 ms
52,744 KB
testcase_16 AC 285 ms
52,748 KB
testcase_17 AC 294 ms
53,032 KB
testcase_18 AC 284 ms
52,792 KB
testcase_19 AC 287 ms
52,760 KB
testcase_20 AC 285 ms
52,872 KB
testcase_21 AC 280 ms
52,780 KB
testcase_22 AC 285 ms
53,028 KB
testcase_23 AC 279 ms
52,740 KB
testcase_24 AC 277 ms
53,072 KB
testcase_25 AC 284 ms
52,736 KB
testcase_26 AC 292 ms
52,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder

fun main() {
    val S1 = readLine()!!.split(" ")
    val S = S1[0]
    val T = S1[1].toInt()

    val roma12 = arrayOf("I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII")
    var index: Int = roma12.mapIndexed { index, s -> Pair(index, s) }.filter { it.second == S }[0].first
    index += (T % 12)
    when {
        index > 11 -> index -= 12
        index < 0 -> index += 12
    }
    println(roma12[index])
}
0