結果

問題 No.246 質問と回答
ユーザー trineutron
提出日時 2019-07-24 00:31:44
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 261 bytes
コンパイル時間 1,762 ms
コンパイル使用メモリ 166,680 KB
実行使用メモリ 25,476 KB
平均クエリ数 31.00
最終ジャッジ日時 2024-07-16 20:21:31
合計ジャッジ時間 4,561 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main()
{
    int n = 0;
    for (int i = 29; i >= 0; i--) {
        cout << "? " << n + (1 << i) << endl;
        int ans;
        cin >> ans;
        n += ans * (1 << i);
    }
    cout << "! " << n << endl;
}
0