14402022-10-07 11:29:26860917882DNScpp11Time limit exceeded 0/40381ms3604 KiB
#include<bits/stdc++.h>
using namespace std;

int hammingDistance(int x, int y) {
        int ans = 0;
        while(x || y) {
            int nx = x % 2;
            int ny = y % 2;
            if(nx != ny) {
                ++ans;
            }
            nx /= 2;
            ny /= 2;
        }
        return ans;
    }
int main() {
    cout<<hammingDistance(2,1)<<endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/40
1Time limit exceeded0/0368ms1088 KiB
2Time limit exceeded0/0361ms1968 KiB
3Time limit exceeded0/2381ms2232 KiB
4Time limit exceeded0/2377ms2488 KiB
5Time limit exceeded0/2372ms2692 KiB
6Time limit exceeded0/2361ms2892 KiB
7Time limit exceeded0/2347ms3052 KiB
8Time limit exceeded0/4370ms3196 KiB
9Time limit exceeded0/4361ms3444 KiB
10Time limit exceeded0/4354ms3372 KiB
11Time limit exceeded0/4368ms3476 KiB
12Time limit exceeded0/4340ms3604 KiB
13Time limit exceeded0/5356ms3604 KiB
14Time limit exceeded0/5372ms3372 KiB