結果

問題 No.1047 Zero (Novice)
ユーザー rutilicusrutilicus
提出日時 2021-02-21 23:25:59
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 319 ms / 2,000 ms
コード長 397 bytes
コンパイル時間 12,355 ms
コンパイル使用メモリ 433,144 KB
実行使用メモリ 54,408 KB
最終ジャッジ日時 2023-10-20 00:14:31
合計ジャッジ時間 21,150 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 302 ms
54,388 KB
testcase_01 AC 303 ms
54,408 KB
testcase_02 AC 308 ms
54,392 KB
testcase_03 AC 303 ms
54,408 KB
testcase_04 AC 303 ms
54,400 KB
testcase_05 AC 305 ms
54,404 KB
testcase_06 AC 304 ms
54,400 KB
testcase_07 AC 310 ms
54,400 KB
testcase_08 AC 306 ms
54,388 KB
testcase_09 AC 304 ms
54,408 KB
testcase_10 AC 307 ms
54,384 KB
testcase_11 AC 305 ms
54,404 KB
testcase_12 AC 312 ms
54,388 KB
testcase_13 AC 319 ms
54,384 KB
testcase_14 AC 309 ms
54,384 KB
testcase_15 AC 304 ms
54,404 KB
testcase_16 AC 304 ms
54,400 KB
testcase_17 AC 306 ms
54,392 KB
testcase_18 AC 300 ms
54,400 KB
testcase_19 AC 299 ms
54,404 KB
権限があれば一括ダウンロードができます

ソースコード

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