結果

問題 No.513 宝探し2
ユーザー nksk38nksk38
提出日時 2017-06-22 19:46:56
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 626 bytes
コンパイル時間 488 ms
コンパイル使用メモリ 72,900 KB
実行使用メモリ 24,552 KB
平均クエリ数 83.58
最終ジャッジ日時 2023-09-23 14:14:28
合計ジャッジ時間 3,351 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<cstdio>
#include <iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>

using namespace std;
typedef long long ll;
typedef pair<int, int> Pr;

int x = 100000;
int y = 100000;
int dy = 50000;
int dx = 50000;
int pre_d = 10000000;

int main()
{
	for (int i = 0; i < 100; i++) {
		cout << x  << " " << y  << endl;
		int d;
		cin >> d;
		if (d == 0)return 0;
		if (pre_d > d) {
			x -= dx;
			y -= dy;
			dx /= 2;
			dy /= 2;
		}
		else {
			x += dx;
			y += dy;
		}
		pre_d = d;
	}
	return	0;
}
0