結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー takeya_okino
提出日時 2019-08-27 22:22:45
言語 Java
(openjdk 23)
結果
AC  
実行時間 209 ms / 2,000 ms
コード長 467 bytes
コンパイル時間 2,377 ms
コンパイル使用メモリ 74,152 KB
実行使用メモリ 70,988 KB
平均クエリ数 3.70
最終ジャッジ日時 2024-07-17 02:21:53
合計ジャッジ時間 9,687 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

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 = (n - 1 - a) % (k + 1);
        System.out.println(a + s);
      }
    }
    System.exit(0);
  }
}
0