結果

問題 No.780 オフ会
ユーザー 💕💖💞💕💖💞
提出日時 2019-05-07 22:10:28
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 295 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 10,041 ms
コンパイル使用メモリ 441,476 KB
実行使用メモリ 60,460 KB
最終ジャッジ日時 2024-04-30 20:31:51
合計ジャッジ時間 17,441 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 276 ms
60,320 KB
testcase_01 AC 281 ms
60,224 KB
testcase_02 AC 275 ms
60,396 KB
testcase_03 AC 275 ms
60,212 KB
testcase_04 AC 295 ms
60,392 KB
testcase_05 AC 285 ms
60,340 KB
testcase_06 AC 276 ms
60,308 KB
testcase_07 AC 283 ms
60,348 KB
testcase_08 AC 276 ms
60,272 KB
testcase_09 AC 284 ms
60,332 KB
testcase_10 AC 274 ms
60,204 KB
testcase_11 AC 278 ms
60,216 KB
testcase_12 AC 274 ms
60,268 KB
testcase_13 AC 279 ms
60,232 KB
testcase_14 AC 273 ms
60,460 KB
testcase_15 AC 273 ms
60,368 KB
testcase_16 AC 272 ms
60,232 KB
testcase_17 AC 295 ms
60,236 KB
testcase_18 AC 286 ms
60,264 KB
testcase_19 AC 278 ms
60,284 KB
testcase_20 AC 280 ms
60,216 KB
testcase_21 AC 276 ms
60,216 KB
testcase_22 AC 274 ms
60,308 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args:Array<String>) {
         ^

ソースコード

diff #

fun main(args:Array<String>) {
    val (A, B) = readLine()!!.split(" ").map { it.toInt() }
    listOf(A - B, -1).max().let {
        when {
            it == -1 -> Pair("YES", Math.abs(A+1-B))
            else -> Pair("NO", Math.abs(A+1-B))
        }.let { println("${it.first}\n${it.second}") }
    }
}
0