結果

問題 No.594 壊れた宝物発見機
ユーザー ngtkanangtkana
提出日時 2020-04-04 13:33:43
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 863 bytes
コンパイル時間 2,124 ms
コンパイル使用メモリ 201,884 KB
実行使用メモリ 24,444 KB
平均クエリ数 53.10
最終ジャッジ日時 2023-09-24 03:16:01
合計ジャッジ時間 4,969 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
23,628 KB
testcase_01 AC 89 ms
23,664 KB
testcase_02 AC 91 ms
23,892 KB
testcase_03 AC 89 ms
23,436 KB
testcase_04 AC 88 ms
23,580 KB
testcase_05 AC 89 ms
24,240 KB
testcase_06 AC 90 ms
23,676 KB
testcase_07 AC 90 ms
23,856 KB
testcase_08 AC 91 ms
23,640 KB
testcase_09 AC 89 ms
23,388 KB
testcase_10 AC 90 ms
24,444 KB
testcase_11 AC 87 ms
23,856 KB
testcase_12 AC 89 ms
24,276 KB
testcase_13 AC 88 ms
24,288 KB
testcase_14 AC 87 ms
24,048 KB
testcase_15 AC 95 ms
23,676 KB
testcase_16 AC 93 ms
24,048 KB
testcase_17 AC 88 ms
24,432 KB
testcase_18 AC 88 ms
23,472 KB
testcase_19 AC 88 ms
23,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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);
}
0