結果
| 問題 | No.594 壊れた宝物発見機 | 
| コンテスト | |
| ユーザー |  wk1080id | 
| 提出日時 | 2019-01-10 00:16:20 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 115 ms / 2,000 ms | 
| コード長 | 2,376 bytes | 
| コンパイル時間 | 856 ms | 
| コンパイル使用メモリ | 83,300 KB | 
| 実行使用メモリ | 25,232 KB | 
| 平均クエリ数 | 102.75 | 
| 最終ジャッジ日時 | 2024-07-16 16:35:19 | 
| 合計ジャッジ時間 | 4,136 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 20 | 
ソースコード
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
using namespace std;
#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vp;
int gcd(int a, int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int lcm(int a, int b){
    return a*b/gcd(a,b);
}
pii f(int i, int j){
    int a = 1000*i/(i+j)+5;
    int b = 1000*j/(i+j)+5;
    return pii(a/10,b/10);
}
int f(int x, int y, int z){
    cout << "?" << " " << x << " " << y << " " << z << endl;
    int ret;
    cin >> ret;
    return ret;
}
signed main(void) {
    int x,y,z,lb,ub,t;
    x = y = z = 1;
    lb = -150, ub = 150;
    rep(_,15){
        int m1 = (lb+lb+ub)/3;
        int m2 = (lb+ub+ub)/3;
        int t1 = f(m1,y,z);
        int t2 = f(m2,y,z);
        if(t1 < t2) ub = m2;
        else lb = m1;
    }
    t = f(lb,y,z);
    loop(i,lb,ub+1){
        int tmp = f(i,y,z);
        if(t > tmp){
            t = tmp;
            lb = i;
        }
    }
    x = lb;
    lb = -150, ub = 150;
    rep(_,15){
        int m1 = (lb+lb+ub)/3;
        int m2 = (lb+ub+ub)/3;
        int t1 = f(x,m1,z);
        int t2 = f(x,m2,z);
        if(t1 < t2) ub = m2;
        else lb = m1;
    }
    t = f(x,lb,z);
    loop(i,lb,ub+1){
        int tmp = f(x,i,z);
        if(t > tmp){
            t = tmp;
            lb = i;
        }
    }
    y = lb;
    lb = -150, ub = 150;
    rep(_,15){
        int m1 = (lb+lb+ub)/3;
        int m2 = (lb+ub+ub)/3;
        int t1 = f(x,y,m1);
        int t2 = f(x,y,m2);
        if(t1 < t2) ub = m2;
        else lb = m1;
    }
    t = f(x,y,lb);
    loop(i,lb,ub+1){
        int tmp = f(x,y,i);
        if(t > tmp){
            t = tmp;
            lb = i;
        }
    }
    z = lb;
    cout << "!" << " " << x << " " << y << " " << z << endl;
}
            
            
            
        