結果

問題 No.594 壊れた宝物発見機
ユーザー ミドリムシミドリムシ
提出日時 2017-11-10 23:31:28
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,358 bytes
コンパイル時間 519 ms
コンパイル使用メモリ 68,352 KB
実行使用メモリ 44,168 KB
最終ジャッジ日時 2023-09-23 15:43:43
合計ジャッジ時間 6,982 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main(){
    int x_position;
    cout << "? 0 0 0" << endl;
    int back;
    cin >> back;
    int left = -100;
    int right = 100;
    int middle = 0;
    while(left < right){
        cout << "? " << middle - 1 << " 0 0" << endl;
        int distance;
        cin >> distance;
        if(distance < back){
            right = middle;
        }else{
            left = middle;
        }
        middle = (left + right) / 2;
    }
    x_position = left;
    left = -100;
    right = 100;
    middle = 0;
    int y_position;
    while(left < right){
        cout << "? 0 " << middle - 1 << " 0" << endl;
        int distance;
        cin >> distance;
        if(distance < back){
            right = middle;
        }else{
            left = middle;
        }
        middle = (left + right) / 2;
    }
    y_position = left;
    left = -100;
    right = 100;
    middle = 0;
    int z_position;
    while(left < right){
        cout << "? 0 0 " << middle - 1 << endl;
        int distance;
        cin >> distance;
        if(distance < back){
            right = middle;
        }else{
            left = middle;
        }
        middle = (left + right) / 2;
    }
    z_position = left;
    cout << "! " << x_position << " " << y_position << " " << z_position << endl;
}
0