Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<algorithm>
- #include<math.h>
- using namespace std;
- typedef unsigned long long ULL;
- int main()
- {
- unsigned long long n;
- while(scanf("%llu",&n)==1)
- {
- printf("%llu\n",n-1+(ULL)log2(n-1));
- }
- return (0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement