結果

問題 No.514 宝探し3
ユーザー PulmnPulmn
提出日時 2017-05-05 19:26:11
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,505 bytes
コンパイル時間 956 ms
コンパイル使用メモリ 88,792 KB
実行使用メモリ 24,300 KB
平均クエリ数 63.00
最終ジャッジ日時 2023-09-23 13:15:47
合計ジャッジ時間 4,128 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <fstream>
#include <cassert>
#include <typeinfo>
#include <vector>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#include <random>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<57;
const double pi=acos(-1);
const double eps=1e-6;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,-0};
const int DX[8]={-1,-1,-1,0,1,1,1,0},DY[8]={1,0,-1,-1,-1,0,1,1};

const int e=1000000000;

int main(){
	int s=-1,t=e,r;
	cout<<e<<' '<<0<<endl;
	cin>>r;
	while(t-s>1){
		int m=(s+t)/2,f;
		cout<<m<<' '<<0<<endl;
		cin>>f;
		if(e-m==r-f) t=m;
		else s=m;
	}
	cout<<t<<' '<<e<<endl;
	cin>>r;
	int S=-1,T=e;
	while(T-S>1){
		int m=(S+T)/2,f;
		cout<<t<<' '<<m<<endl;
		cin>>f;
		if(e-m==r-f) T=m;
		else S=m;
	}
	assert(0<=t&&t<=e&&0<=T&&T<=e);
	cout<<t<<' '<<T<<endl;
}
0