Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. bool check(double x) {
  6.   return true;
  7. }
  8.  
  9. int main() {
  10.   double l = 0;
  11.   double r = 1e9;
  12.  
  13.   for (int i = 0; i < 64; ++i) {
  14.     double mid = (l + r) / 2;
  15.    
  16.     if (check(mid)) {
  17.       r = mid;
  18.     } else {
  19.       l = mid;
  20.     }
  21.   }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement