#include <stdio.h>

int main(int argc, char** argv)
{
    int target;
    int ans = 0;
    int shiftIndex = 0;

    scanf(\"%d\", &target);

    for(int i = 1; i <= target; i *= 2 )
    {
        int cnt = (target / (i * 2)) * i;
        int mod = target % (i * 2);
        cnt += (mod >= i) ? (mod - (i - 1)) : 0;

        ans |= (cnt & 0x01) << shiftIndex++;
    }

    printf(\"%x\", ans);

    return 0;
}

먼지 알겠지? 카운트 이용한거임
비트 자리수가 시간복잡도임


B까지 구하고 A-1 까지 구해서 XOR하면됨 ㅅㄱ