結果

問題 No.594 壊れた宝物発見機
ユーザー mint6421mint6421
提出日時 2019-12-30 23:33:20
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 1,791 bytes
コンパイル時間 1,383 ms
コンパイル使用メモリ 166,400 KB
実行使用メモリ 24,276 KB
平均クエリ数 31.60
最終ジャッジ日時 2023-09-23 19:21:33
合計ジャッジ時間 6,051 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
24,204 KB
testcase_01 AC 98 ms
24,276 KB
testcase_02 AC 96 ms
23,628 KB
testcase_03 AC 95 ms
24,012 KB
testcase_04 AC 96 ms
24,000 KB
testcase_05 AC 97 ms
23,388 KB
testcase_06 AC 95 ms
24,204 KB
testcase_07 AC 97 ms
23,412 KB
testcase_08 AC 98 ms
23,820 KB
testcase_09 AC 99 ms
24,036 KB
testcase_10 AC 95 ms
24,000 KB
testcase_11 AC 97 ms
24,264 KB
testcase_12 AC 96 ms
23,400 KB
testcase_13 AC 96 ms
23,676 KB
testcase_14 AC 94 ms
24,036 KB
testcase_15 AC 94 ms
23,376 KB
testcase_16 AC 94 ms
23,544 KB
testcase_17 AC 94 ms
24,252 KB
testcase_18 AC 95 ms
23,688 KB
testcase_19 AC 97 ms
24,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
#define vi vector<int>
#define IP pair<int,P>
#define PI pair<P,int>
#define PP pair<P,P>
#define Yes(f){cout<<(f?"Yes":"No")<<endl;}
#define YES(f){cout<<(f?"YES":"NO")<<endl;}


signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);

  int xl=-150,xr=150;
  int dl,dr;
  cout<<"? -150 0 0"<<endl;
  cin>>dl;
  cout<<"? 150 0 0"<<endl;
  cin>>dr;

  while(xr-xl>1){
    int x=(xl+xr)/2;
    cout<<"? "<<x<<" 0 0"<<endl;
    int d;
    cin>>d;
    if(dl>dr){
      dl=d;
      xl=x;
    }
    else{
      dr=d;
      xr=x;
    }
  }
  int x=(dl>dr?xr:xl);

 
  int yl=-150,yr=150;
  
  cout<<"? 0 -150 0"<<endl;
  cin>>dl;
  cout<<"? 0 150 0"<<endl;
  cin>>dr;

  while(yr-yl>1){
    int y=(yl+yr)/2;
    cout<<"? 0 "<<y<<" 0"<<endl;
    int d;
    cin>>d;
    if(dl>dr){
      dl=d;
      yl=y;
    }
    else{
      dr=d;
      yr=y;
    }
  }
  int y=(dl>dr?yr:yl);

  int zl=-150,zr=150;
  
  cout<<"? 0 0 -150"<<endl;
  cin>>dl;
  cout<<"? 0 0 150"<<endl;
  cin>>dr;

  while(zr-zl>1){
    int z=(zl+zr)/2;
    cout<<"? 0 0 "<<z<<endl;
    int d;
    cin>>d;
    if(dl>dr){
      dl=d;
      zl=z;
    }
    else{
      dr=d;
      zr=z;
    }
  }
  int z=(dl>dr?zr:zl);


  cout<<"! "<<x<<' '<<y<<' '<<z<<endl;

}
0