結果

問題 No.257 N言っちゃダメゲーム (3)
コンテスト
ユーザー kohaku_kohaku
提出日時 2016-12-04 05:09:52
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 506 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,808 ms
コンパイル使用メモリ 81,972 KB
実行使用メモリ 62,376 KB
平均クエリ数 2.43
最終ジャッジ日時 2026-03-30 23:35:31
合計ジャッジ時間 7,438 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 WA * 27
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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 t = N%(K+1);
        System.out.println(t-1);
        System.out.flush();
        int B = sc.nextInt();
        while(B<N){
            int d=B-t;
            int A=B+K+1-d;
            System.out.println(A);
            System.out.flush();
            t=B;
            B=sc.nextInt();
        }
    }
}
0