結果

問題 No.253 ロウソクの長さ
ユーザー sugim48
提出日時 2015-07-24 22:32:46
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 575 bytes
コンパイル時間 743 ms
コンパイル使用メモリ 90,368 KB
実行使用メモリ 26,468 KB
平均クエリ数 28.97
最終ジャッジ日時 2025-02-07 08:45:42
合計ジャッジ時間 6,924 ms
ジャッジサーバーID
(参考情報)
judge4 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

#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