結果

問題 No.1429 Simple Dowsing
コンテスト
ユーザー mine691
提出日時 2021-03-14 13:14:38
言語 C++17(gcc12)
(gcc 12.4.0 + boost 1.89.0)
コンパイル:
g++-12 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
RE  
実行時間 -
コード長 631 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 6,726 ms
コンパイル使用メモリ 336,524 KB
実行使用メモリ 30,260 KB
平均クエリ数 1.13
最終ジャッジ日時 2026-06-18 18:28:08
合計ジャッジ時間 8,363 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 15
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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(0, 100, "n");
	inf.readEoln();
	cout << "? " << p2 << " " << q2 << endl;
	d2 = inf.readInt(0, 100, "n");
	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