結果
問題 | No.1429 Simple Dowsing |
ユーザー |
|
提出日時 | 2021-08-12 16:17:54 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 387 bytes |
コンパイル時間 | 948 ms |
コンパイル使用メモリ | 81,368 KB |
最終ジャッジ日時 | 2025-01-23 17:45:32 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 WA * 12 |
ソースコード
#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; }