結果

問題 No.594 壊れた宝物発見機
ユーザー kotamanegikotamanegi
提出日時 2017-11-10 22:38:56
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,751 bytes
コンパイル時間 1,020 ms
コンパイル使用メモリ 104,732 KB
実行使用メモリ 24,396 KB
平均クエリ数 86.10
最終ジャッジ日時 2023-09-23 14:46:11
合計ジャッジ時間 4,474 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

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
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;
}
0