Sponsors

Tag: problem: (E) Mahmoud and Ehab and the xor-MST Solution In C/C++

Codeforces Round #473 (Div....

#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("%I64dn",res); return 0; }

Advertisement

spot_img