結果

問題 No.246 質問と回答
ユーザー kotamanegikotamanegi
提出日時 2016-02-12 18:29:27
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 750 bytes
コンパイル時間 530 ms
コンパイル使用メモリ 74,172 KB
実行使用メモリ 24,408 KB
平均クエリ数 101.00
最終ジャッジ日時 2023-09-23 20:12:20
合計ジャッジ時間 3,483 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
23,700 KB
testcase_01 AC 41 ms
23,664 KB
testcase_02 AC 41 ms
23,448 KB
testcase_03 AC 42 ms
23,580 KB
testcase_04 AC 44 ms
23,436 KB
testcase_05 AC 43 ms
23,700 KB
testcase_06 AC 43 ms
23,520 KB
testcase_07 AC 41 ms
24,408 KB
testcase_08 AC 41 ms
24,024 KB
testcase_09 AC 43 ms
24,300 KB
testcase_10 AC 41 ms
23,640 KB
testcase_11 AC 42 ms
24,024 KB
testcase_12 AC 42 ms
24,060 KB
testcase_13 AC 40 ms
23,208 KB
testcase_14 AC 42 ms
24,084 KB
testcase_15 AC 41 ms
24,000 KB
testcase_16 AC 42 ms
23,808 KB
testcase_17 AC 43 ms
23,520 KB
testcase_18 AC 43 ms
24,312 KB
testcase_19 AC 40 ms
24,372 KB
testcase_20 AC 41 ms
23,988 KB
testcase_21 AC 41 ms
24,000 KB
testcase_22 AC 41 ms
24,084 KB
testcase_23 AC 40 ms
23,448 KB
testcase_24 AC 42 ms
23,520 KB
testcase_25 AC 43 ms
24,060 KB
testcase_26 AC 42 ms
24,300 KB
testcase_27 AC 40 ms
23,604 KB
testcase_28 AC 41 ms
23,988 KB
testcase_29 AC 41 ms
23,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream> 
#include<map>
#include <list>
#include <typeinfo>
using namespace std;
#define REP(a,b) for(long long a = 0;a < b;++a)
int main() {
	long long x_low = 1;
	long long x_high = 1000000000;
	int cnt = 0;
	while (cnt != 100) {
		cnt++;
		long long hoge = (x_high+x_low) / 2;
		cout << "? "<< hoge << endl;
		int a = 0;
		cin >> a;
		if (a == 0) {
			x_high = hoge;
		}
		else {
			x_low = hoge;
		}
	}
	cout << "! " << x_low << endl;
}
0