結果

問題 No.257 N言っちゃダメゲーム (3)
コンテスト
ユーザー mura40424
提出日時 2015-08-01 15:59:09
言語 Kotlin
(2.3.20)
コンパイル:
kotlinc _filename_ -include-runtime -d main.jar
実行:
kotlin main.jar
結果
RE  
実行時間 -
コード長 467 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 7,630 ms
コンパイル使用メモリ 424,952 KB
実行使用メモリ 71,352 KB
平均クエリ数 1.00
最終ジャッジ日時 2026-03-30 19:31:36
合計ジャッジ時間 17,352 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

var N = 0
var K = 0

fun DontSayN(now : Int) {
    if(now >= N) {
        return
    }
    
    if(now % (K + 1) == K || now == -1) {
        System.out.println(now + 1)
        DontSayN(readLine()!!.toInt())
    }
    else{
        var next = ((now / (K + 1)) + 1) * (K + 1)
        System.out.println(next)
        DontSayN(readLine()!!.toInt())
    }
}

fun main(args : Array<String>) {
    N = readLine()!!.toInt()
    K = readLine()!!.toInt()
    DontSayN(-1)
}
0