結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー takeya_okino
提出日時 2019-08-27 21:54:02
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 466 bytes
コンパイル時間 2,060 ms
コンパイル使用メモリ 73,804 KB
実行使用メモリ 71,348 KB
平均クエリ数 6.93
最終ジャッジ日時 2024-07-16 18:00:38
合計ジャッジ時間 10,167 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7 WA * 23
権限があれば一括ダウンロードができます

ソースコード

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 t = (n - 1) % (k + 1);
    System.out.println(t);
    System.out.flush();
    while(true) {
      int a = sc.nextInt();
      if(a >= n) {
        break;
      } else {
        int s = a % (k + 1);
        System.out.println(a + k + 1 - s);
      }
    }
     System.exit(0);
  }
}
0