結果

問題 No.253 ロウソクの長さ
コンテスト
ユーザー sugim48
提出日時 2015-07-24 22:32:46
言語 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  
実行時間 -
コード長 575 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,315 ms
コンパイル使用メモリ 106,784 KB
実行使用メモリ 28,976 KB
平均クエリ数 28.97
最終ジャッジ日時 2026-03-30 23:09:47
合計ジャッジ時間 15,508 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 36
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <algorithm>
#include <climits>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <vector>
using namespace std;

typedef long long ll;
typedef pair<int, int> i_i;
int MOD = 1000000007;

int main() {
	int lb = 0, ub = 1000000001;
	int t = 0;
	while (ub - lb > 1) {
		int mid = (lb + ub) / 2;
		cout << "? " << mid - t << endl;
		int x; cin >> x;
		if (x == 0) {
			cout << "! " << mid << endl;
			return 0;
		}
		if (x == 1) lb = mid;
		else ub = mid;
		t--;
	}
}
0