結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー alpha_virginisalpha_virginis
提出日時 2016-11-16 21:27:33
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 599 bytes
コンパイル時間 1,446 ms
コンパイル使用メモリ 163,860 KB
実行使用メモリ 24,408 KB
平均クエリ数 3.40
最終ジャッジ日時 2023-09-23 11:45:56
合計ジャッジ時間 4,963 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
24,264 KB
testcase_01 AC 43 ms
24,264 KB
testcase_02 WA -
testcase_03 AC 44 ms
23,556 KB
testcase_04 AC 43 ms
23,856 KB
testcase_05 AC 43 ms
24,060 KB
testcase_06 AC 42 ms
23,436 KB
testcase_07 AC 43 ms
23,736 KB
testcase_08 AC 42 ms
24,060 KB
testcase_09 WA -
testcase_10 AC 42 ms
24,216 KB
testcase_11 AC 43 ms
23,664 KB
testcase_12 AC 42 ms
23,856 KB
testcase_13 AC 43 ms
23,556 KB
testcase_14 AC 43 ms
23,556 KB
testcase_15 AC 42 ms
23,328 KB
testcase_16 AC 42 ms
24,252 KB
testcase_17 AC 44 ms
24,252 KB
testcase_18 WA -
testcase_19 AC 43 ms
23,916 KB
testcase_20 AC 42 ms
24,288 KB
testcase_21 AC 42 ms
23,436 KB
testcase_22 AC 42 ms
23,280 KB
testcase_23 AC 43 ms
23,304 KB
testcase_24 AC 43 ms
23,280 KB
testcase_25 AC 43 ms
23,520 KB
testcase_26 AC 43 ms
24,396 KB
testcase_27 AC 43 ms
23,688 KB
testcase_28 AC 42 ms
23,928 KB
testcase_29 AC 43 ms
23,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  if( n % (k + 1) == 1 ) {
    printf("0\n");
    fflush(stdout);
    int t;
    scanf("%d", &t);
    if( t >= n ) return 0;
    for(int i = 1; ; ++i) {
      int x = i * (k + 1) + (n % (k + 1)) - 1;
      printf("%d\n", x);
      fflush(stdout);
      int t;
      scanf("%d", &t);
      if( t >= n ) break;
    }
  }
  else {
    for(int i = 0; ; ++i) {
      printf("%d\n", i * (k + 1) + (n % (k + 1)) - 1);
      fflush(stdout);
      int t;
      scanf("%d", &t);
      if( t >= n ) break;
    }
  }
  
  return 0;
}
0