結果

問題 No.514 宝探し3
ユーザー KlayKlay
提出日時 2017-05-10 19:47:49
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 898 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 52,284 KB
実行使用メモリ 24,396 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-23 14:00:13
合計ジャッジ時間 1,656 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
24,264 KB
testcase_01 AC 23 ms
23,928 KB
testcase_02 AC 24 ms
23,400 KB
testcase_03 AC 24 ms
23,328 KB
testcase_04 AC 23 ms
24,396 KB
testcase_05 AC 23 ms
23,736 KB
testcase_06 AC 23 ms
23,436 KB
testcase_07 AC 25 ms
23,868 KB
testcase_08 AC 24 ms
23,688 KB
testcase_09 AC 23 ms
23,412 KB
testcase_10 AC 24 ms
24,276 KB
testcase_11 AC 23 ms
23,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

int main(void)
{
	std::cout << "0 0" << std::endl;

	long long d0, d1, d2;

	std::cin >> d0;
	
	std::cout << d0 << " 0" << std::endl;
	
	std::cin >> d1;
	
	if(d1 != 2 * d0 && d1 != 0)
	{
		std::cout << d0 - d1 / 2 << " " << d1 / 2 << std::endl;
		std::cin >> d2;
		
		if(d2 != 0)
		{
			std::cout << d0 - d1 / 2 << " " << - d1 / 2 << std::endl;
			std::cin >> d2;
		}
	}
	else if(d1 == 2 * d0)
	{
		std::cout << - d0 << " 0" << std::endl;
		std::cin >> d1;
		
		if(d1 == 2 * d0)
		{
			std::cout << "0 " << d0 << std::endl;
			std::cin >> d2;
			
			if(d2 != 0)
			{
				std::cout << "0 " << -d0 << std::endl;
				std::cin >> d2;
			}
		}
		else if(d1 != 0)
		{
			std::cout << - d0 + d1 / 2 << " " << d1 / 2 << std::endl;
			std::cin >> d2;
			
			if(d2 != 0)
			{
				std::cout << - d0 + d1 / 2 << " " << - d1 / 2 << std::endl;
				std::cin >> d2;
			}
		}
	}
	
	return 0;
}
0