結果

問題 No.1429 Simple Dowsing
ユーザー yansi819
提出日時 2024-03-22 18:53:07
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 490 bytes
コンパイル時間 4,155 ms
コンパイル使用メモリ 249,784 KB
最終ジャッジ日時 2025-02-20 11:00:42
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

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