結果

問題 No.1429 Simple Dowsing
ユーザー 👑 hitonanodehitonanode
提出日時 2021-03-14 15:50:52
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 510 bytes
コンパイル時間 1,854 ms
コンパイル使用メモリ 197,308 KB
実行使用メモリ 24,324 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-24 10:07:40
合計ジャッジ時間 3,322 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define REP(i, n) FOR(i,0,n)


int main() {
    cout << "? 0 0" << endl;
    int D1, D2;
    cin >> D1;
    cout << "? 0 100" << '\n';
    cin >> D2;
    REP(i, 101) REP(j, 101) {
        int d1 = i * i + j * j;
        int d2 = i * i + (100 - j) * (100 - j);
        if (d1 == D1 and d2 == D2) {
            cout << "! " << i << ' ' << j << endl;
            return 0;
        }
    }
}
0