Advertisement
noshin98

uva 11714

Oct 21st, 2016
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<algorithm>
  3. #include<math.h>
  4. using namespace std;
  5. typedef unsigned long long ULL;
  6. int main()
  7. {
  8.     unsigned long long n;
  9.  
  10.     while(scanf("%llu",&n)==1)
  11.     {
  12.         printf("%llu\n",n-1+(ULL)log2(n-1));
  13.     }
  14.     return (0);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement