結果
| 問題 | No.246 質問と回答 |
| コンテスト | |
| ユーザー |
kotamanegi
|
| 提出日時 | 2016-02-12 18:29:27 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 41 ms / 2,000 ms |
| コード長 | 750 bytes |
| 記録 | |
| コンパイル時間 | 808 ms |
| コンパイル使用メモリ | 99,728 KB |
| 実行使用メモリ | 28,964 KB |
| 平均クエリ数 | 101.00 |
| 最終ジャッジ日時 | 2026-03-31 09:20:55 |
| 合計ジャッジ時間 | 3,475 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}
kotamanegi