結果

問題 No.513 宝探し2
コンテスト
ユーザー Naoyk1212
提出日時 2017-06-05 23:44:34
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 1,126 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 616 ms
コンパイル使用メモリ 93,356 KB
実行使用メモリ 28,976 KB
平均クエリ数 33.33
最終ジャッジ日時 2026-03-31 02:00:39
合計ジャッジ時間 3,610 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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