結果

問題 No.246 質問と回答
ユーザー femto
提出日時 2016-01-16 17:28:54
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 320 bytes
コンパイル時間 424 ms
コンパイル使用メモリ 56,380 KB
実行使用メモリ 43,048 KB
最終ジャッジ日時 2024-07-16 19:59:36
合計ジャッジ時間 6,826 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other TLE * 1 -- * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
using namespace std;

int main(){
	int l = 0, r = 1000000001;
	while(r - l > 1) {
		int m = (l + r) / 2;
		cout << "? " << m;
		cout.flush();
		int a;
		cin >> a;
		if(a == 0) {
			r = m;
		}
		else {
			l = m;
		}
	}
	cout << "! " << l << endl;
	cout.flush();
}

0