結果
| 問題 |
No.513 宝探し2
|
| コンテスト | |
| ユーザー |
btk
|
| 提出日時 | 2017-05-05 22:41:19 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,361 bytes |
| コンパイル時間 | 1,457 ms |
| コンパイル使用メモリ | 166,480 KB |
| 実行使用メモリ | 25,604 KB |
| 平均クエリ数 | 67.50 |
| 最終ジャッジ日時 | 2024-07-16 12:58:56 |
| 合計ジャッジ時間 | 3,954 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 WA * 8 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
#define CIN_ONLY if(1)
struct cww{cww(){
CIN_ONLY{
ios::sync_with_stdio(false);cin.tie(0);
}
}}star;
#define fin "\n"
#define FOR(i,bg,ed) for(int i=(bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define pb push_back
#define DEBUG if(0)
#define REC(ret, ...) std::function<ret (__VA_ARGS__)>
template <typename T>inline bool chmin(T &l,T r)
{bool a=l>r;if(a)l=r;return a;}
template <typename T>inline bool chmax(T &l,T r)
{bool a=l<r;if(a)l=r;return a;}
template <typename T>
istream& operator>>(istream &is,vector<T> &v){
for(auto &it:v)is>>it;
return is;
}
LL calcy(){
LL ub=100001;
LL lb=-1;
LL x,y,z;
while(ub-lb>1){
const LL mid=(ub+lb)/2;
cout<<0<<" "<<mid<<endl;
cin>>y;
cout<<0<<" "<<mid+1<<endl;
cin>>x;
if(x<y)lb=mid;
else ub=mid;
}
return ub;
}
LL calcx(){
LL ub=100001;
LL lb=-1;
LL x,y,z;
while(ub-lb>1){
const LL mid=(ub+lb)/2;
cout<<mid<<" "<<0<<endl;
cin>>x;
cout<<mid+1<<" "<<0<<endl;
cin>>z;
if(z<x)lb=mid;
else ub=mid;
}
return ub;
}
int main(){
LL x=calcx();
LL y=calcy();
cout<<x<<y<<endl;
return 0;
}
btk