Advertisement
Plabon_dutta

UVA 12643 - Tennis Rounds

Apr 27th, 2021
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #include <math.h>
  3. #include<string>
  4. #define pi acos(-1.0)
  5. #define ll long long int
  6. #define sc scanf
  7. #define pf printf
  8.  
  9. using namespace std;
  10.  
  11. int main() {
  12.     ll n, i, j, r;
  13.     while(sc("%lld %lld %lld", &n, &i, &j)==3) {
  14.         i=(i-1)/2;
  15.         j=(j-1)/2;
  16.         for(r=1; i!=j; r++) {
  17.             i/=2;
  18.             j/=2;
  19.         }
  20.         cout << r << "\n";
  21.     }
  22.     return 0;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement