結果

問題 No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
ユーザー arbtarbt
提出日時 2017-09-20 10:22:26
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 307 ms / 2,000 ms
コード長 289 bytes
コンパイル時間 8,958 ms
コンパイル使用メモリ 432,732 KB
実行使用メモリ 55,440 KB
最終ジャッジ日時 2024-04-30 16:10:47
合計ジャッジ時間 18,578 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 292 ms
55,176 KB
testcase_01 AC 289 ms
55,340 KB
testcase_02 AC 291 ms
55,284 KB
testcase_03 AC 289 ms
55,168 KB
testcase_04 AC 297 ms
55,304 KB
testcase_05 AC 293 ms
55,392 KB
testcase_06 AC 288 ms
55,180 KB
testcase_07 AC 307 ms
55,272 KB
testcase_08 AC 289 ms
55,332 KB
testcase_09 AC 293 ms
55,116 KB
testcase_10 AC 290 ms
55,196 KB
testcase_11 AC 289 ms
55,132 KB
testcase_12 AC 288 ms
55,228 KB
testcase_13 AC 289 ms
55,416 KB
testcase_14 AC 289 ms
55,280 KB
testcase_15 AC 295 ms
55,440 KB
testcase_16 AC 287 ms
55,264 KB
testcase_17 AC 291 ms
55,272 KB
testcase_18 AC 293 ms
55,248 KB
testcase_19 AC 298 ms
55,168 KB
testcase_20 AC 290 ms
55,216 KB
testcase_21 AC 293 ms
55,316 KB
testcase_22 AC 295 ms
55,220 KB
testcase_23 AC 293 ms
55,180 KB
testcase_24 AC 302 ms
55,300 KB
testcase_25 AC 290 ms
55,280 KB
testcase_26 AC 286 ms
55,296 KB
testcase_27 AC 306 ms
55,292 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:19:11: warning: parameter 'argv' is never used
fun main( argv : Array<String> ) {
          ^

ソースコード

diff #

import java.util.Scanner

//
fun _Do() {
    
    val N = scan.nextInt()
    val K = scan.nextInt()
    
    println( when{
        K==0 || K>N -> 0
        K*2 == N+1 -> N-1
        else -> N-2
    }
    )
}

var scan = Scanner(System.`in`)
fun main( argv : Array<String> ) {
    _Do()
}
0