Codeforces Round #473 (Div. 2), problem: (E) Mahmoud and Ehab and the xor-MST Solution In C/C++

#include <stdio.h>
long long n,res,a=1;
int main()
{
for (scanf(“%I64d”,&n);a<n;res+=(n-1)/a*(a-(a>>1)),a<<=1ll);
printf(“%I64d\n”,res);
return 0;
}

(Visited 10 times, 1 visits today)

About the Author:

Leave A Comment