結果
| 問題 |
No.513 宝探し2
|
| コンテスト | |
| ユーザー |
ngtkana
|
| 提出日時 | 2020-03-17 22:24:50 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 740 bytes |
| コンパイル時間 | 3,262 ms |
| コンパイル使用メモリ | 195,008 KB |
| 最終ジャッジ日時 | 2025-01-09 07:33:50 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 12 |
ソースコード
#include<bits/stdc++.h>
using lint=long long;
lint query(lint x, lint y){
std::cout<<x<<" "<<y<<'\n';
lint ans;
std::cin>>ans;
if(!ans)exit(0);
return ans;
}
int main(){
std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
lint max=100000;
std::vector<lint>ans(2);
for(lint i=0;i<2;i++){
auto cal=[&](lint x){
std::vector<int>a(2);
a.at(i)=x;
return query(a.at(0),a.at(1));
};
lint l=0,r=max+1;
while(1<r-l){
lint c=(l+r)/2;
(cal(c-1)>cal(c)?l:r)=c;
}
ans.at(i)=l;
}
std::cout<<ans.at(0)<<" "<<ans.at(1)<<'\n';
}
ngtkana