結果

問題 No.1047 Zero (Novice)
ユーザー rutilicus
提出日時 2021-02-21 23:25:59
言語 Kotlin
(2.1.0)
結果
AC  
実行時間 295 ms / 2,000 ms
コード長 397 bytes
コンパイル時間 11,185 ms
コンパイル使用メモリ 433,068 KB
実行使用メモリ 56,940 KB
最終ジャッジ日時 2024-09-19 20:07:58
合計ジャッジ時間 17,874 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

fun main() {
    val builder = StringBuilder()

    val (a, b) = readInputLine().split(" ").map { it.toLong() }

    if (b == 0L) {
        builder.appendLine(1)
    } else {
        builder.appendLine(
            when(a) {
                -1L -> 2
                else -> -1
            }
        )
    }

    print(builder.toString())
}

fun readInputLine(): String {
    return readLine()!!
}
0