結果

問題 No.513 宝探し2
ユーザー EtoNagisaEtoNagisa
提出日時 2017-05-05 23:07:02
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,434 bytes
コンパイル時間 1,138 ms
コンパイル使用メモリ 144,300 KB
実行使用メモリ 24,348 KB
平均クエリ数 22.00
最終ジャッジ日時 2023-09-23 13:31:39
合計ジャッジ時間 3,175 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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 << 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