結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー kano_townkano_town
提出日時 2015-07-31 22:49:27
言語 Java21
(openjdk 21)
結果
AC  
実行時間 177 ms / 2,000 ms
コード長 514 bytes
コンパイル時間 3,726 ms
コンパイル使用メモリ 72,220 KB
実行使用メモリ 72,676 KB
平均クエリ数 3.70
最終ジャッジ日時 2023-09-23 21:06:08
合計ジャッジ時間 9,930 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 165 ms
72,068 KB
testcase_01 AC 164 ms
71,476 KB
testcase_02 AC 163 ms
71,480 KB
testcase_03 AC 165 ms
72,080 KB
testcase_04 AC 165 ms
71,392 KB
testcase_05 AC 165 ms
71,996 KB
testcase_06 AC 164 ms
71,616 KB
testcase_07 AC 165 ms
72,440 KB
testcase_08 AC 172 ms
71,896 KB
testcase_09 AC 166 ms
72,448 KB
testcase_10 AC 166 ms
71,316 KB
testcase_11 AC 166 ms
71,128 KB
testcase_12 AC 166 ms
71,916 KB
testcase_13 AC 166 ms
71,600 KB
testcase_14 AC 169 ms
71,660 KB
testcase_15 AC 174 ms
72,248 KB
testcase_16 AC 175 ms
71,396 KB
testcase_17 AC 177 ms
72,140 KB
testcase_18 AC 174 ms
71,924 KB
testcase_19 AC 167 ms
70,292 KB
testcase_20 AC 167 ms
71,608 KB
testcase_21 AC 168 ms
71,936 KB
testcase_22 AC 168 ms
71,820 KB
testcase_23 AC 169 ms
72,260 KB
testcase_24 AC 167 ms
71,904 KB
testcase_25 AC 169 ms
71,960 KB
testcase_26 AC 170 ms
72,676 KB
testcase_27 AC 167 ms
71,484 KB
testcase_28 AC 173 ms
70,432 KB
testcase_29 AC 170 ms
71,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yukicoder257 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), k = sc.nextInt(), now;
        int r = (n - 1) % (k + 1), o;
        now = r;
        System.out.println(now);
        System.out.flush();
        while (true) {
            o = sc.nextInt();
            if (o >= n) break;
            now += (k + 1);
            System.out.println(now);
            System.out.flush();
        }
    }
}
0