結果

問題 No.594 壊れた宝物発見機
ユーザー gzlcpgzlcp
提出日時 2017-11-10 22:39:50
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,735 bytes
コンパイル時間 752 ms
コンパイル使用メモリ 92,080 KB
実行使用メモリ 24,444 KB
平均クエリ数 10.50
最終ジャッジ日時 2023-09-23 14:46:39
合計ジャッジ時間 4,292 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 #

#include<iostream>
#include<iomanip>
#include<math.h>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<string>
#define INF 1000000000ll
#define MOD 1000000007ll
#define EPS 1e-10
#define REP(i,m) for(long long i=0; i<m; i++)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define DUMP(a) for(long long dump=0; dump<(ll)a.size(); dump++) { cout<<a[dump]; if(dump!=(ll)a.size()-1) cout<<" "; else cout<<endl; }
#define ALL(v) v.begin(),v.end()
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef long double ld;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll lx=-150,rx=150,ly=-150,ry=150,lz=-150,rz=150;
	ll retx=0,rety=0,retz=0;
	REP(i,33) {
		ll nl,nr;
		cout<<"?"<<" "<<lx<<" "<<ly<<" "<<lz<<endl;
		cin>>nl;
		cout<<"?"<<" "<<rx<<" "<<ly<<" "<<lz<<endl;
		cin>>nr;
		if(nl<=nr) {
			if(nr-nl>1) rx=(lx+rx)/2;
			else {
				retx=lx;
				break;
			}
		} else {
			if(nr-nl>1) lx=(lx+rx)/2;
			else {
				retx=rx;
				break;
			}
		}
	}
	REP(i,33) {
		ll nl,nr;
		cout<<"?"<<" "<<retx<<" "<<ly<<" "<<lz<<endl;
		cin>>nl;
		cout<<"?"<<" "<<retx<<" "<<ry<<" "<<lz<<endl;
		cin>>nr;
		if(nl<=nr) {
			if(nr-nl>1) ry=(ly+ry)/2;
			else {
				rety=ly;
				break;
			}
		} else {
			if(nr-nl>1) ly=(ly+ry)/2;
			else {
				rety=ry;
				break;
			}
		}
	}
	REP(i,33) {
		ll nl,nr;
		cout<<"?"<<" "<<retx<<" "<<rety<<" "<<lz<<endl;
		cin>>nl;
		cout<<"?"<<" "<<retx<<" "<<rety<<" "<<rz<<endl;
		cin>>nr;
		if(nl<=nr) {
			if(nr-nl>1) rz=(lz+rz)/2;
			else {
				retz=lz;
				break;
			}
		} else {
			if(nr-nl>1) lz=(lz+rz)/2;
			else {
				retz=rz;
				break;
			}
		}
	}
	cout<<"!"<<" "<<retx<<" "<<rety<<" "<<retz<<endl;
}

0