結果
問題 | No.1429 Simple Dowsing |
ユーザー |
![]() |
提出日時 | 2024-11-22 00:22:03 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 25 ms / 2,000 ms |
コード長 | 703 bytes |
コンパイル時間 | 2,796 ms |
コンパイル使用メモリ | 246,928 KB |
実行使用メモリ | 25,208 KB |
平均クエリ数 | 3.00 |
最終ジャッジ日時 | 2024-11-22 00:22:08 |
合計ジャッジ時間 | 4,679 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 |
ソースコード
#include <bits/stdc++.h>using namespace std;#ifdef LOCAL#include "settings/debug.cpp"#else#define Debug(...) void(0)#endif#define rep(i, n) for (int i = 0; i < (n); ++i)using ll = long long;using ull = unsigned long long;int main() {cout << "? 0 0" << endl;cout << "? 0 100" << endl;int a, b;cin >> a >> b;vector<pair<int, int>> cand;for (int x = 0; x <= 100; ++x) {for (int y = 0; y <= 100; ++y) {int dist_a = x * x + y * y;int dist_b = x * x + (y - 100) * (y - 100);if (dist_a == a && dist_b == b) cand.push_back({ x, y });}}assert(cand.size() == 1);cout << "! " << cand[0].first << ' ' << cand[0].second << endl;return 0;}