結果

問題 No.513 宝探し2
ユーザー kosakkunkosakkun
提出日時 2017-05-09 17:58:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 970 bytes
コンパイル時間 750 ms
コンパイル使用メモリ 80,544 KB
実行使用メモリ 24,396 KB
平均クエリ数 15.50
最終ジャッジ日時 2023-09-23 13:59:32
合計ジャッジ時間 2,679 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
typedef long long ll;

int dist;

int judge(int x, int y){
    cout << x << " " << y << endl;
    int t; cin >> t;
    return t;
}

int main(){
    
    dist = judge(0,0);
    if(dist == 0) return 0;
    
    int x_low = 0, x_high = 100000;
    while(x_high - x_low > 1){
        int mid=(x_low + x_high) / 2;
        int dist_t = judge(mid,0);
        if(dist_t == 0) return 0;
        else if(dist_t < dist) {
            x_low = mid;
            dist = dist_t;
        }
        else x_high = mid;
    }
    
    judge(x_low,dist);
    
    return 0;
}
0