結果

問題 No.3011 あ、俺こいつの役やりたい!
コンテスト
ユーザー tnakao0123
提出日時 2025-01-28 14:23:05
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 472 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 418 ms
コンパイル使用メモリ 50,988 KB
実行使用メモリ 30,020 KB
平均クエリ数 11.61
最終ジャッジ日時 2026-06-25 16:11:49
合計ジャッジ時間 3,656 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 44
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

/* -*- coding: utf-8 -*-
 *
 * 3011.cc:  No.3011 縺ゅ€∽ソコ縺薙>縺、縺ョ蠖ケ繧・j縺溘>! - yukicoder
 */

#include<cstdio>
#include<algorithm>

using namespace std;

/* constant */

const int MAX_N = 1000000000;

/* main */

int main() {
  int x = MAX_N;

  for (;;) {
    x = (x + 1) / 2;
    printf("%d\n", x); fflush(stdout);
    
    int r;
    scanf("%d", &r);
    if (r != 0) break;
  }

  for (int i = 0; i < 1000000000; i++);
  return 0;
}
0