結果
問題 | No.246 質問と回答 |
ユーザー |
![]() |
提出日時 | 2016-02-12 18:29:27 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 60 ms / 2,000 ms |
コード長 | 750 bytes |
コンパイル時間 | 822 ms |
コンパイル使用メモリ | 79,968 KB |
実行使用メモリ | 25,604 KB |
平均クエリ数 | 101.00 |
最終ジャッジ日時 | 2024-07-16 20:00:38 |
合計ジャッジ時間 | 4,129 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
#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;}