Advertisement
myLoveOnlyForYou

Untitled

Mar 21st, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #include "pch.h"
  2. #include <iostream>
  3. #include <queue>
  4. #include <string>
  5. #include <iomanip>
  6. #include <regex>
  7. using namespace std;
  8.  
  9. int main() {
  10.     cout.flush();
  11.     double x, y, l, fun = 1000000, new_func = 100000000;
  12.     double x1 = 0, y1 = 0;
  13.     l = 0.749000;
  14.     cout << "? 0 0" << endl;
  15.     double eps = 0.000001;
  16.     cin >> x >> y >> fun;
  17.     while(true) {
  18.         x1 = x1 - l * x;
  19.         y1 = y1 - l * y;
  20.         cout << fixed << setprecision(6) << "? " << x1 << " " << y1 << endl;
  21.         if (abs(fun - new_func) <= eps)
  22.             break;
  23.         else {
  24.             cin >> x >> y >> new_func;
  25.             fun = new_func;
  26.         }
  27.     }
  28.     cout << fixed << setprecision(6) << "! " << x1 << " " << y1 << endl;
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement