結果

問題 No.514 宝探し3
ユーザー T1610T1610
提出日時 2017-05-05 23:13:49
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 890 bytes
コンパイル時間 1,377 ms
コンパイル使用メモリ 164,564 KB
実行使用メモリ 24,216 KB
平均クエリ数 5.00
最終ジャッジ日時 2023-09-23 13:45:32
合計ジャッジ時間 2,763 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
24,192 KB
testcase_01 AC 23 ms
24,000 KB
testcase_02 AC 23 ms
24,048 KB
testcase_03 AC 24 ms
23,616 KB
testcase_04 AC 24 ms
23,748 KB
testcase_05 AC 23 ms
23,988 KB
testcase_06 AC 23 ms
23,436 KB
testcase_07 AC 24 ms
23,580 KB
testcase_08 AC 24 ms
23,568 KB
testcase_09 AC 23 ms
23,316 KB
testcase_10 AC 23 ms
23,328 KB
testcase_11 AC 23 ms
24,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
  
using namespace std;
  
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
const int INF = 1e9;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;

int main(){
	int dl, dh;
	int low = 0, high = 1e9;
	int mid = (low + high) /2;
	cout << low <<" " << low <<endl;
	cin >> dl;
	cout << high <<" " << low << endl;
	cin >> dh;
	int x;
	int dist = abs(dl - dh);
	if(dl < dh) x = (high - dist) / 2;
	else x = (high - dist) / 2 + dist;
	cout << x << " " << low << endl;
	cin >> dl;
	cout << x << " " << high << endl;
	cin >> dh;
	int y = dl;
	cout <<x <<" " << y << endl;
	cin >> dl;
	return 0;

}
0