結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-12-04 05:53:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 519 bytes
コンパイル時間 1,872 ms
コンパイル使用メモリ 71,612 KB
実行使用メモリ 72,320 KB
平均クエリ数 3.70
最終ジャッジ日時 2023-09-24 00:45:09
合計ジャッジ時間 8,643 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 169 ms
71,908 KB
testcase_01 AC 161 ms
71,332 KB
testcase_02 AC 161 ms
72,112 KB
testcase_03 AC 166 ms
71,808 KB
testcase_04 AC 161 ms
71,240 KB
testcase_05 AC 160 ms
72,076 KB
testcase_06 AC 156 ms
72,176 KB
testcase_07 AC 156 ms
71,244 KB
testcase_08 AC 159 ms
72,320 KB
testcase_09 AC 160 ms
71,292 KB
testcase_10 AC 151 ms
71,512 KB
testcase_11 AC 165 ms
71,892 KB
testcase_12 AC 163 ms
71,528 KB
testcase_13 AC 162 ms
71,572 KB
testcase_14 AC 165 ms
71,780 KB
testcase_15 AC 162 ms
71,404 KB
testcase_16 AC 165 ms
71,660 KB
testcase_17 AC 166 ms
71,324 KB
testcase_18 AC 163 ms
71,908 KB
testcase_19 AC 163 ms
70,260 KB
testcase_20 AC 165 ms
72,024 KB
testcase_21 AC 166 ms
72,040 KB
testcase_22 AC 164 ms
71,976 KB
testcase_23 AC 161 ms
71,532 KB
testcase_24 AC 158 ms
71,596 KB
testcase_25 AC 158 ms
72,132 KB
testcase_26 AC 164 ms
71,996 KB
testcase_27 AC 159 ms
71,824 KB
testcase_28 AC 156 ms
70,412 KB
testcase_29 AC 161 ms
71,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int A = N%(K+1)-1;
        if(A==-1){A=K;}
        System.out.println(A);
        System.out.flush();
        while(true){
            int B=sc.nextInt();
            if(B>=N){
                break;
            }
            A+=(K+1);
            System.out.println(A);
            System.out.flush();
        }
    }
}
0