結果

問題 No.1429 Simple Dowsing
ユーザー mine691
提出日時 2021-03-14 13:18:50
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 634 bytes
コンパイル時間 7,229 ms
コンパイル使用メモリ 322,828 KB
最終ジャッジ日時 2025-01-19 16:25:37
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 15
権限があれば一括ダウンロードができます

ソースコード

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;
	cin >> d1;
	// assert(0 <= d1 <= 20000);
	cout << "? " << p2 << " " << q2 << endl;
	cin >> d2;
	// assert(0 <= d2 <= 20000);
	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