daily pastebin goal
51%
SHARE
TWEET

Untitled

myLoveOnlyForYou Mar 21st, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top