結果

問題 No.1429 Simple Dowsing
ユーザー Example0911Example0911
提出日時 2021-03-14 14:06:42
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 640 bytes
コンパイル時間 2,419 ms
コンパイル使用メモリ 197,676 KB
実行使用メモリ 24,240 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-24 10:00:23
合計ジャッジ時間 3,439 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
23,796 KB
testcase_01 AC 22 ms
23,664 KB
testcase_02 AC 23 ms
24,216 KB
testcase_03 WA -
testcase_04 AC 23 ms
23,400 KB
testcase_05 AC 23 ms
23,592 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 22 ms
23,664 KB
testcase_09 AC 24 ms
23,352 KB
testcase_10 AC 24 ms
23,664 KB
testcase_11 AC 23 ms
23,664 KB
testcase_12 WA -
testcase_13 AC 24 ms
23,628 KB
testcase_14 AC 22 ms
23,640 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 << '?' << " " << 100 << " " << 100 << 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 ((100 - a)*(100 - a) + (100 - b)*(100 - b) == d2) {
					cout << '!' << " " << a << " " << b << endl; return 0;
				}
			}
		}
	}
	return 0;
}
0