結果

問題 No.594 壊れた宝物発見機
ユーザー jimmyo0705jimmyo0705
提出日時 2017-11-10 22:49:08
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,696 bytes
コンパイル時間 591 ms
コンパイル使用メモリ 84,420 KB
実行使用メモリ 24,408 KB
平均クエリ数 181.00
最終ジャッジ日時 2023-09-23 14:48:14
合計ジャッジ時間 4,111 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 109 ms
23,844 KB
testcase_02 WA -
testcase_03 AC 108 ms
24,024 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 106 ms
23,412 KB
testcase_07 AC 108 ms
23,544 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 108 ms
24,024 KB
testcase_12 AC 110 ms
24,024 KB
testcase_13 AC 109 ms
24,048 KB
testcase_14 WA -
testcase_15 AC 107 ms
23,664 KB
testcase_16 WA -
testcase_17 AC 105 ms
24,348 KB
testcase_18 WA -
testcase_19 AC 109 ms
23,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>
#include <tuple>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e12;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1
#define MAX_N 100100

int ask(int x, int y, int z) {
	int d;
	cout << "?" << " " << x << " " << y << " " << z << endl;
	cin >> d;
	cin.ignore();
	return d;
}

void answer(int x, int y, int z) {
	cout << "!" << " " << x << " " << y << " " << z << endl;
}

int main(void) {
	ll lx = -150, ux = 150;
	ll ly = -150, uy = 150;
	ll lz = -150, uz = 150;
	ll ansx, ansy, ansz;
	rep(i, 30) {
		ll ld = ask(lx, 0, 0), ud = ask(ux, 0, 0);
		if (ld < ud)ux = (lx + ux) / 2;
		else lx= (lx + ux) / 2;
	}
	ansx = lx;
	rep(i, 30) {
		ll ld = ask(ansx, ly, 0), ud = ask(ansx, uy, 0);
		if (ld < ud)uy = (ly + uy) / 2;
		else ly = (ly + uy) / 2;
	}
	ansy = ly;
	rep(i, 30) {
		ll ld = ask(ansx, ansy, lz), ud = ask(ansx, ansy, uz);
		if (ld < ud)uz = (lz + uz) / 2;
		else lz = (lz + uz) / 2;
	}
	ansz = lz;
	answer(ansx, ansy, ansz);
	return 0;
}
0