結果

問題 No.1429 Simple Dowsing
ユーザー yansi819yansi819
提出日時 2024-03-22 18:53:07
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 490 bytes
コンパイル時間 4,832 ms
コンパイル使用メモリ 262,416 KB
実行使用メモリ 24,000 KB
平均クエリ数 3.00
最終ジャッジ日時 2024-03-22 18:53:14
合計ジャッジ時間 7,022 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
24,000 KB
testcase_01 AC 23 ms
24,000 KB
testcase_02 AC 23 ms
24,000 KB
testcase_03 AC 24 ms
24,000 KB
testcase_04 AC 23 ms
24,000 KB
testcase_05 AC 23 ms
24,000 KB
testcase_06 AC 24 ms
24,000 KB
testcase_07 AC 26 ms
24,000 KB
testcase_08 AC 24 ms
24,000 KB
testcase_09 AC 25 ms
24,000 KB
testcase_10 AC 23 ms
24,000 KB
testcase_11 AC 24 ms
24,000 KB
testcase_12 AC 26 ms
24,000 KB
testcase_13 AC 23 ms
24,000 KB
testcase_14 AC 23 ms
24,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;

int main() {
  int d1, d2;
  cout << "? 0 0" << endl;
  cin >> d1;
  cout << "? 100 0" << endl;
  cin >> d2;
  for (int x = 0; x <= 100; x++) {
    for (int y = 0; y <= 100; y++) {
      if (x * x + y * y == d1 && (x - 100) * (x - 100) + y * y == d2) {
        cout << "! " << x << " " << y << endl;
        return 0;
      }
    }
  }
  return 0;
}
0