結果

問題 No.513 宝探し2
ユーザー Naoyk1212Naoyk1212
提出日時 2017-06-05 23:44:34
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,126 bytes
コンパイル時間 557 ms
コンパイル使用メモリ 71,320 KB
実行使用メモリ 24,552 KB
平均クエリ数 33.33
最終ジャッジ日時 2023-09-23 14:12:43
合計ジャッジ時間 3,328 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 24 ms
23,400 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
using namespace std;

signed main(){
    double in;

    int x = 0;
    int y = 0;
    cout << x << " " << y << endl;

    cin >> in;
    if(in == 0){
        return 0;
    }

    int high = 1e6;
    int low = 0;
    while(high - low > 1){
        int mid = (high + low) / 2;
        cout << mid << " " << y << endl;

        double tmp;
        cin >> tmp;

        if(tmp == 0){
            return 0;
        }
        if(in > tmp){
            in = tmp;
            low = mid;
        }else if(in < tmp){
            high = mid;
        }else{
            break;
        }
    }

    high = 1e6;
    low = 0;
    while(high - low > 1){
        int mid = (high + low) / 2;
        cout << x << " " << mid << endl;

        double tmp;
        cin >> tmp;

        if(tmp == 0){
            return 0;
        }
        if(in > tmp){
            in = tmp;
            low = mid;
        }else if(in < tmp){
            high = mid;
        }else{
            break;
        }
    }

}
0