結果

問題 No.1429 Simple Dowsing
ユーザー kpinkcatkpinkcat
提出日時 2023-09-09 13:26:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 632 bytes
コンパイル時間 2,055 ms
コンパイル使用メモリ 198,772 KB
実行使用メモリ 24,324 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-09 13:26:10
合計ジャッジ時間 3,391 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
23,688 KB
testcase_01 AC 21 ms
23,676 KB
testcase_02 AC 22 ms
23,568 KB
testcase_03 AC 21 ms
24,288 KB
testcase_04 AC 22 ms
23,472 KB
testcase_05 AC 22 ms
24,324 KB
testcase_06 AC 22 ms
23,808 KB
testcase_07 AC 21 ms
23,568 KB
testcase_08 AC 21 ms
23,688 KB
testcase_09 AC 21 ms
24,096 KB
testcase_10 AC 22 ms
23,412 KB
testcase_11 AC 22 ms
23,820 KB
testcase_12 AC 21 ms
23,412 KB
testcase_13 AC 22 ms
23,940 KB
testcase_14 AC 21 ms
23,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
#include<string>
using ll = long long;
using namespace std;

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

0