結果

問題 No.780 オフ会
ユーザー 💕💖💞💕💖💞
提出日時 2019-05-07 22:10:28
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 323 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 12,633 ms
コンパイル使用メモリ 424,136 KB
実行使用メモリ 57,228 KB
最終ジャッジ日時 2023-08-13 01:58:52
合計ジャッジ時間 21,288 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 323 ms
56,872 KB
testcase_01 AC 319 ms
56,744 KB
testcase_02 AC 316 ms
56,748 KB
testcase_03 AC 309 ms
56,804 KB
testcase_04 AC 312 ms
56,848 KB
testcase_05 AC 306 ms
56,856 KB
testcase_06 AC 307 ms
56,940 KB
testcase_07 AC 309 ms
56,940 KB
testcase_08 AC 313 ms
56,936 KB
testcase_09 AC 310 ms
56,748 KB
testcase_10 AC 306 ms
56,856 KB
testcase_11 AC 308 ms
56,856 KB
testcase_12 AC 309 ms
57,136 KB
testcase_13 AC 310 ms
56,860 KB
testcase_14 AC 310 ms
57,128 KB
testcase_15 AC 315 ms
56,748 KB
testcase_16 AC 310 ms
56,836 KB
testcase_17 AC 309 ms
57,080 KB
testcase_18 AC 314 ms
57,228 KB
testcase_19 AC 308 ms
56,748 KB
testcase_20 AC 309 ms
56,908 KB
testcase_21 AC 307 ms
56,844 KB
testcase_22 AC 309 ms
57,120 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