結果

問題 No.246 質問と回答
ユーザー femto
提出日時 2016-01-16 17:25:37
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 304 bytes
コンパイル時間 569 ms
コンパイル使用メモリ 58,308 KB
実行使用メモリ 43,040 KB
最終ジャッジ日時 2024-07-16 19:59:28
合計ジャッジ時間 7,053 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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;
		int a;
		cin >> a;
		cin.clear();
		if(a == 0) {
			r = m;
		}
		else {
			l = m;
		}
	}
	cout << "! " << l << endl;
}

0