結果
| 問題 |
No.1429 Simple Dowsing
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-14 16:54:11 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 2,000 ms |
| コード長 | 834 bytes |
| コンパイル時間 | 1,000 ms |
| コンパイル使用メモリ | 96,832 KB |
| 最終ジャッジ日時 | 2025-01-19 17:05:24 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 |
ソースコード
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>
static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;
template<class T> constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;
int main() {
auto ask = [&](int a, int b){
cout << "? " << a << " " << b << endl;
int res;
cin >> res;
return res;
};
int a = ask(0, 0), b = ask(0, 100);
for (int i = 0; i <= 100; ++i) {
for (int j = 0; j <= 100; ++j) {
if(i*i+j*j == a && i*i+(100-j)*(100-j) == b){
cout << "! " << i << " " << j << endl;
return 0;
}
}
}
return 0;
}