結果
問題 | No.594 壊れた宝物発見機 |
ユーザー |
![]() |
提出日時 | 2017-11-11 00:07:16 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,742 bytes |
コンパイル時間 | 1,805 ms |
コンパイル使用メモリ | 169,796 KB |
実行使用メモリ | 25,616 KB |
平均クエリ数 | 30.60 |
最終ジャッジ日時 | 2024-07-16 14:40:37 |
合計ジャッジ時間 | 5,201 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 WA * 15 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;//typedef long long ll;#define INF (1LL << 31 - 1)#define INFLL ((1LL << 62) - 1)#define MOD int(1e9+7)#define repi(i,j,n) for(int i = (j); i < (n); ++i)#define rep(i,n) repi(i,0,n)#define rrep(i,n) for (int i = n; i >= 0; --i)#define fi first#define se second#define all(v) (v).begin(), (v).end()int vx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, vy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};inline bool check(int ux, int uy, int x, int y) {return (0 <= x and x < ux and 0 <= y and y < uy);}inline void init() {cin.tie(0);ios::sync_with_stdio(false);}int bx, ux, by, uy, bz, uz, x, y, z;ll d, l, r;inline void answer(int X, int Y, int Z) {cout << "!" << " " << X << " " << Y << " " << Z << endl;}inline ll query(int X, int Y, int Z) {ll ret;cout << "?" << " " << X << " " << Y << " " << Z << endl;cin >> ret;return ret;}int main() {init();bx = by = bz = -150;ux = uy = uz = 150;x = y = z = INF;while (ux - bx > 1) {l = query(bx, by, bz);r = query(ux, by, bz);if (l == r) {x = (bx + ux) / 2;break;}else if (l < r) {ux = (bx + ux) / 2;}else {bx = (bx + ux) / 2;}}while (uy - by > 1) {l = query(x, by, bz);r = query(x, uy, bz);if (l == r) {y = (by + uy) / 2;break;}else if (l < r) {uy = (by + uy) / 2;}else by = (by + uy) / 2;}while (uz - bz > 1) {l = query(x, y, bz);r = query(x, y, uz);if (l == r) {z = (bz + uz) / 2;break;}else if (l < r) {uz = (bz + uz) / 2;}else bz = (bz + uz) / 2;}answer(x, y, z);return 0;}