結果

問題 No.513 宝探し2
ユーザー EtoNagisaEtoNagisa
提出日時 2017-05-05 22:59:08
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,477 bytes
コンパイル時間 2,022 ms
コンパイル使用メモリ 165,196 KB
実行使用メモリ 24,396 KB
平均クエリ数 31.00
最終ジャッジ日時 2023-09-23 13:29:02
合計ジャッジ時間 4,466 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"

#define REP(i,n) for(ll i=0;i<n;++i)
#define RREP(i,n) for(ll i=n-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<n;++i)
#define RFOR(i,m,n) for(ll i=n-1;i>=m;--i)
#define ALL(v) (v).begin(),(v).end()
#define PB(a) push_back(a)
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define DUMP(v) REP(i, (v).size()) { cout << v[i]; if (i != v.size() - 1)cout << " "; else cout << endl; }
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

const int dx[8] = { 1,1,0,-1,-1,-1,0,1 };
const int dy[8] = { 0,1,1,1,0,-1,-1,-1 };


using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll max(ll a, int b) { return max(a, ll(b)); }
ll max(int a, ll b) { return max(ll(a), b); }
ll min(ll a, int b) { return min(a, ll(b)); }
ll min(int a, ll b) { return min(ll(a), b); }
///(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)///
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int l = -1, r = 100001;
	int d1, d2;
	while (r - l > 1) {
		int a1 = (l + 2 * r) / 3, a2 = (2 * l + r) / 3;
		cout << "l:" << l << " r:" << r << endl;
		cout << a1<< " " << 0 << endl;
		cin >> d1;
		cout << a2 << " " << 0 << endl;
		cin >> d2;
		if (d1 <= d2) {
			l = a1;
		}
		else {
			r = a2;
		}
	}
	if(d1<d2)cout << l << " " << d1 << endl;
	else cout << r << " " << d2 << endl;
	return 0;
}
0