結果
問題 | No.1429 Simple Dowsing |
ユーザー |
![]() |
提出日時 | 2021-03-14 14:08:55 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 26 ms / 2,000 ms |
コード長 | 634 bytes |
コンパイル時間 | 1,895 ms |
コンパイル使用メモリ | 191,912 KB |
最終ジャッジ日時 | 2025-01-19 16:33:18 |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 |
ソースコード
#include "bits/stdc++.h"#define int long longusing 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;}