結果

問題 No.257 N言っちゃダメゲーム (3)
ユーザー utouto97utouto97
提出日時 2019-02-26 13:52:17
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 47 ms / 2,000 ms
コード長 902 bytes
コンパイル時間 1,296 ms
コンパイル使用メモリ 143,932 KB
実行使用メモリ 24,372 KB
平均クエリ数 3.77
最終ジャッジ日時 2023-09-24 02:07:21
合計ジャッジ時間 4,430 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
23,904 KB
testcase_01 AC 41 ms
23,292 KB
testcase_02 AC 40 ms
23,292 KB
testcase_03 AC 40 ms
23,676 KB
testcase_04 AC 41 ms
23,892 KB
testcase_05 AC 40 ms
23,316 KB
testcase_06 AC 40 ms
24,372 KB
testcase_07 AC 42 ms
23,388 KB
testcase_08 AC 41 ms
23,652 KB
testcase_09 AC 39 ms
23,304 KB
testcase_10 AC 41 ms
24,360 KB
testcase_11 AC 41 ms
24,048 KB
testcase_12 AC 41 ms
23,676 KB
testcase_13 AC 41 ms
23,676 KB
testcase_14 AC 42 ms
23,280 KB
testcase_15 AC 41 ms
24,084 KB
testcase_16 AC 42 ms
24,072 KB
testcase_17 AC 41 ms
23,904 KB
testcase_18 AC 41 ms
23,652 KB
testcase_19 AC 41 ms
23,448 KB
testcase_20 AC 41 ms
23,940 KB
testcase_21 AC 41 ms
24,048 KB
testcase_22 AC 40 ms
23,292 KB
testcase_23 AC 40 ms
23,856 KB
testcase_24 AC 42 ms
23,616 KB
testcase_25 AC 43 ms
24,264 KB
testcase_26 AC 42 ms
23,880 KB
testcase_27 AC 42 ms
24,084 KB
testcase_28 AC 42 ms
23,640 KB
testcase_29 AC 41 ms
23,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h> 
using namespace std;

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) 42
#endif

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define all(x) (x).begin(),(x).end()
#define foreach(u,v) for(auto (u) : (v))
#define pb push_back
#define mp make_pair
#define mt make_tuple

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pll;
typedef vector<ll> vl;

const int inf = 1e9;
const ll linf = 1LL<<60;
const ll mod = 1e9 + 7;
const double eps = 1e-9;

/*
*/

int ask(int x)
{
  cout << x << endl;
  int res;
  cin >> res;
  return res;
}

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

  int cur = (n-1)%k;
  if((n-1)%k == 0){
    cur = k;
    ask(0);
  }

  while(ask(cur) < n){
    cur += k;
  }
  
  return 0;
}
0