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

By |2018-04-18T13:34:59+06:00April 18th, 2018|Categories: C/C++, Programming|Tags: , , , , , , |

#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; }