結果

問題 No.1429 Simple Dowsing
ユーザー kikagekikage
提出日時 2021-08-12 16:17:54
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 703 ms
コンパイル使用メモリ 83,756 KB
実行使用メモリ 25,592 KB
平均クエリ数 3.00
最終ジャッジ日時 2024-04-09 20:39:07
合計ジャッジ時間 2,614 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 17 ms
24,568 KB
testcase_02 WA -
testcase_03 AC 18 ms
25,460 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 17 ms
24,824 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main(void){
    int d[2],x,y;
    cout << "? 0 0" << endl << flush;
    cin >> d[0];
    cout << "? 1 0" << endl << flush;
    cin >> d[1];
// x^2+y^2=d[0],x^2-2*x+1+y^2=d[1]
    x = (d[0]-d[1]+1)/2;
    y = sqrt((d[0]-x*x)/2);
    cout << "! "+to_string(x)+" "+to_string(y) << endl <<flush;
    return 0;
}
0