結果

問題 No.594 壊れた宝物発見機
ユーザー kotamanegi
提出日時 2017-11-10 23:03:59
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 2,617 bytes
コンパイル時間 983 ms
コンパイル使用メモリ 106,976 KB
実行使用メモリ 25,616 KB
平均クエリ数 86.10
最終ジャッジ日時 2024-07-16 14:29:03
合計ジャッジ時間 4,543 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

#define _CRT_SECURE_NO_WARNINGS
#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 <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 3000000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
#define seg_size 524288
#define _CRT_SECURE_NO_WARNINGS
#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 <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 3000000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
#define seg_size 524288
int ans[3] = {};
int ask(int a, int c) {
cout << "?";
if (c == 0) {
cout << " " << a;
}
else {
cout << " " << ans[0];
}
if (c == 1) {
cout << " " << a;
}
else cout << " " << ans[1];
if (c == 2) {
cout << " " << a;
}
else cout << " " << ans[2];
cout << endl;
int temp = 0;
cin >> temp;
return temp;
}
int main() {
for (int i = 0;i < 3;++i) {
int bot = -150;
int top = 150;
while (top - bot > 2) {
int boto = (bot + bot + top) / 3;
int topo = (bot + top + top) / 3;
int getb = ask(boto, i), getc = ask(topo, i);
if (getb < getc) {
top = topo;
}
else {
bot = boto;
}
}
vector<pair<int, int>> wow;
for (int q = bot;q <= top;++q) {
int neko = ask(q, i);
wow.push_back(make_pair(neko, q));
}
sort(wow.begin(), wow.end());
ans[i] = wow[0].second;
}
cout << "! " << ans[0] << " " << ans[1] << " " << ans[2] << endl;
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0