結果
| 問題 | No.594 壊れた宝物発見機 | 
| コンテスト | |
| ユーザー |  ngtkana | 
| 提出日時 | 2020-04-04 13:33:43 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 143 ms / 2,000 ms | 
| コード長 | 863 bytes | 
| コンパイル時間 | 2,281 ms | 
| コンパイル使用メモリ | 195,644 KB | 
| 最終ジャッジ日時 | 2025-01-09 14:02:30 | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 20 | 
ソースコード
#include<bits/stdc++.h>
using lint=long long;
using real=long double;
void answer(std::vector<lint>const&a){
    std::cout<<"!";
    for(lint x:a)std::cout<<" "<<x;
    std::cout<<std::endl;
    exit(0);
}
lint query(std::vector<lint>const&a){
    std::cout<<"?";
    for(lint x:a)std::cout<<" "<<x;
    std::cout<<std::endl;
    lint x;std::cin>>x;
    return x;
}
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    std::vector<lint>ans(3);
    for(lint i=0;i<3;i++){
        auto query1=[&](lint x){
            ans.at(i)=x;
            return query(ans);
        };
        lint l=-100,r=101;
        while(1<r-l){
            lint c=(r+l)/2;
            (query1(c-1)<query1(c)?r:l)=c;
        }
        ans.at(i)=query1(l)<query1(r)?l:r;
    }
    answer(ans);
}
            
            
            
        