結果

問題 No.3011 あ、俺こいつの役やりたい!
ユーザー Jikky1618
提出日時 2025-01-25 13:04:46
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 603 bytes
コンパイル時間 2,857 ms
コンパイル使用メモリ 273,052 KB
実行使用メモリ 26,228 KB
平均クエリ数 30.00
最終ジャッジ日時 2025-01-25 22:32:20
合計ジャッジ時間 8,709 ms
ジャッジサーバーID
(参考情報)
judge5 / judge11
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#ifdef LOCAL
#include <debug.hpp>
#else
#define debug(...)
#endif

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    auto check = [&](int x) -> bool {
        cout << x << endl;
        int r;
        cin >> r;
        if (r == -1) exit(0);
        return r == 1;
    };

    constexpr int M = 30;
    int ok = 0, ng = 5e8 + 1;
    for (int iter = 0; iter < M - 1; iter++) {
        int mid = midpoint(ok, ng);
        (check(mid) ? ok : ng) = mid;
    }

    check(ok);
}
0