結果
| 問題 |
No.594 壊れた宝物発見機
|
| コンテスト | |
| ユーザー |
kotamanegi
|
| 提出日時 | 2017-11-10 22:38:56 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,751 bytes |
| コンパイル時間 | 1,094 ms |
| コンパイル使用メモリ | 108,264 KB |
| 実行使用メモリ | 25,616 KB |
| 平均クエリ数 | 86.10 |
| 最終ジャッジ日時 | 2024-07-16 14:25:54 |
| 合計ジャッジ時間 | 4,607 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 20 |
ソースコード
#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, i));
}
sort(wow.begin(), wow.end());
ans[i] = wow[0].second;
}
cout << "! " << ans[0] << " " << ans[1] << " " << ans[2] << endl;
return 0;
}
kotamanegi