結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー takeya_okinotakeya_okino
提出日時 2019-08-27 22:22:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 170 ms / 2,000 ms
コード長 467 bytes
コンパイル時間 2,143 ms
コンパイル使用メモリ 71,520 KB
実行使用メモリ 72,144 KB
平均クエリ数 3.70
最終ジャッジ日時 2023-09-24 02:20:15
合計ジャッジ時間 8,704 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 170 ms
72,144 KB
testcase_01 AC 166 ms
71,252 KB
testcase_02 AC 164 ms
71,828 KB
testcase_03 AC 166 ms
71,280 KB
testcase_04 AC 163 ms
69,764 KB
testcase_05 AC 162 ms
71,096 KB
testcase_06 AC 164 ms
71,600 KB
testcase_07 AC 170 ms
71,992 KB
testcase_08 AC 169 ms
72,000 KB
testcase_09 AC 167 ms
71,516 KB
testcase_10 AC 168 ms
71,644 KB
testcase_11 AC 169 ms
71,452 KB
testcase_12 AC 167 ms
71,560 KB
testcase_13 AC 165 ms
71,716 KB
testcase_14 AC 165 ms
71,668 KB
testcase_15 AC 166 ms
71,868 KB
testcase_16 AC 165 ms
71,768 KB
testcase_17 AC 165 ms
72,040 KB
testcase_18 AC 166 ms
71,960 KB
testcase_19 AC 165 ms
71,680 KB
testcase_20 AC 165 ms
71,340 KB
testcase_21 AC 168 ms
71,788 KB
testcase_22 AC 168 ms
71,340 KB
testcase_23 AC 169 ms
71,460 KB
testcase_24 AC 165 ms
69,884 KB
testcase_25 AC 166 ms
71,844 KB
testcase_26 AC 166 ms
71,904 KB
testcase_27 AC 165 ms
72,056 KB
testcase_28 AC 165 ms
72,044 KB
testcase_29 AC 167 ms
71,840 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 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