結果

問題 No.257 N言っちゃダメゲーム (3)
コンテスト
ユーザー tnakao0123
提出日時 2016-03-31 00:56:13
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 741 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 719 ms
コンパイル使用メモリ 102,172 KB
実行使用メモリ 28,976 KB
平均クエリ数 9.37
最終ジャッジ日時 2026-03-30 21:34:41
合計ジャッジ時間 3,844 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

/* -*- coding: utf-8 -*-
 *
 * 257.cc: No.257 N言っちゃダメゲーム (3) - yukicoder
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

/* typedef */

/* global variables */

/* subroutines */

/* main */

int main() {
  int n, k;
  cin >> n >> k;

  int c = 0;

  for (;;) {
    int a = (c + k) / (k + 1) * (k + 1);
    printf("%d\n", a); flush(cout);

    int b;
    cin >> b;
    if (b >= n) break;

    c = b;
  }

  return 0;
}
0