結果

問題 No.1429 Simple Dowsing
ユーザー Example0911Example0911
提出日時 2021-03-14 14:08:55
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 634 bytes
コンパイル時間 2,013 ms
コンパイル使用メモリ 197,724 KB
実行使用メモリ 24,348 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-24 10:01:12
合計ジャッジ時間 3,512 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
23,796 KB
testcase_01 AC 23 ms
23,796 KB
testcase_02 AC 24 ms
24,036 KB
testcase_03 AC 24 ms
24,348 KB
testcase_04 AC 23 ms
23,640 KB
testcase_05 AC 23 ms
23,652 KB
testcase_06 AC 23 ms
24,240 KB
testcase_07 AC 24 ms
24,312 KB
testcase_08 AC 23 ms
24,036 KB
testcase_09 AC 23 ms
23,796 KB
testcase_10 AC 22 ms
24,024 KB
testcase_11 AC 23 ms
23,664 KB
testcase_12 AC 21 ms
23,388 KB
testcase_13 AC 24 ms
24,048 KB
testcase_14 AC 23 ms
23,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"

#define int long long
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll INF = (1LL << 61);
ll mod = 1000000007;


signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << '?' << " " << 0 << " " << 0 << endl;
	fflush(stdout);
	int d; cin >> d;
	cout << '?' << " " << 52 << " " << 36 << endl;
	fflush(stdout);
	int d2; cin >> d2;
	for (int a = 0; a <= 100; a++) {
		for (int b = 0; b <= 100; b++) {
			if (a * a + b * b == d) {
				if ((52 - a)*(52 - a) + (36 - b)*(36 - b) == d2) {
					cout << '!' << " " << a << " " << b << endl; return 0;
				}
			}
		}
	}
	return 0;
}
0