You are viewing a single comment's thread. Return to all comments →
long sumXor(long n) { long count = 0; long binary = n; while (binary > 0) { count += binary & 1 ? 0 : 1; binary >>= 1; } return 1L << count; } int main() { long n; scanf("%ld", &n); printf("%ld\n", sumXor(n)); #Pratham Gupta return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Sum vs XOR
You are viewing a single comment's thread. Return to all comments →