結果

問題 No.1429 Simple Dowsing
ユーザー mine691mine691
提出日時 2021-03-14 13:12:51
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 680 bytes
コンパイル時間 6,308 ms
コンパイル使用メモリ 305,928 KB
実行使用メモリ 35,924 KB
最終ジャッジ日時 2023-09-24 09:58:01
合計ジャッジ時間 12,742 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using Int = long long;
#include "testlib.h"

int main(int argc, char *argv[])
{
	registerValidation(argc, argv);
	int p1 = 0, q1 = 0, p2 = 100, q2 = 0;
	cout << "? " << p1 << " " << q1 << endl;
	int d1, d2;
	d1 = inf.readInt(1, 100, "n");
	inf.readEoln();
	inf.readEof();
	cout << "? " << p2 << " " << q2 << endl;
	d2 = inf.readInt(1, 100, "n");
	inf.readEoln();
	inf.readEof();
	for (int i = 0; i <= 100; i++)
	{
		for (int j = 0; j <= 100; j++)
		{
			if ((p1 - i) * (p1 - i) + (q1 - j) * (q1 - j) == d1 and (p2 - i) * (p2 - i) + (q2 - j) * (q2 - j) == d2)
			{
				cout << "! " << i << " " << j << endl;
				return 0;
			}
		}
	}
}
0