結果
| 問題 |
No.513 宝探し2
|
| コンテスト | |
| ユーザー |
beet
|
| 提出日時 | 2018-07-27 15:51:34 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 29 ms / 2,000 ms |
| コード長 | 456 bytes |
| コンパイル時間 | 1,702 ms |
| コンパイル使用メモリ | 166,592 KB |
| 実行使用メモリ | 25,476 KB |
| 平均クエリ数 | 67.42 |
| 最終ジャッジ日時 | 2024-07-17 01:51:00 |
| 合計ジャッジ時間 | 2,953 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
//INSERT ABOVE HERE
Int ask(Int x,Int y){
cout<<x<<" "<<y<<endl;
Int d;
cin>>d;
if(d==0) exit(0);
return d;
}
signed main(){
Int l=-1,r=1e6;
while(l+1<r){
Int m=(l+r)>>1;
if(ask(m,0)<ask(m+1,0)) r=m;
else l=m;
}
Int x=(ask(l,0)<ask(r,0)?l:r);
l=-1;r=1e6;
while(l+1<r){
Int m=(l+r)>>1;
if(ask(x,m)<ask(x,m+1)) r=m;
else l=m;
}
return 0;
}
beet