結果

問題 No.296 n度寝
ユーザー da_louisda_louis
提出日時 2020-02-11 23:49:13
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 345 bytes
コンパイル時間 14,151 ms
コンパイル使用メモリ 443,492 KB
実行使用メモリ 54,500 KB
最終ジャッジ日時 2024-04-08 21:21:10
合計ジャッジ時間 20,533 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 320 ms
54,496 KB
testcase_04 AC 324 ms
54,500 KB
testcase_05 AC 326 ms
54,492 KB
testcase_06 AC 327 ms
54,496 KB
testcase_07 AC 318 ms
54,496 KB
testcase_08 AC 319 ms
54,496 KB
testcase_09 WA -
testcase_10 AC 325 ms
54,492 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 328 ms
54,500 KB
testcase_14 AC 353 ms
54,496 KB
testcase_15 AC 329 ms
54,492 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^
Main.kt:13:9: warning: 'appendln(Int): kotlin.text.StringBuilder /* = java.lang.StringBuilder */' is deprecated. Use appendLine instead. Note that the new method always appends the line feed character '\n' regardless of the system line separator.
        appendln(newH)
        ^

ソースコード

diff #

fun main(args: Array<String>) {
    p296()
}

fun p296() {
    val (n, h, m, interval) = readLine()!!.split(' ').map { it.toInt() }

    val add = interval * (n - 1)
    val newH = (h + (add / 60)) % 24
    val newM = (m + (add % 60)) % 60

    val answer = buildString {
        appendln(newH)
        append(newM)
    }

    println(answer)
}
0