#include #include // A B XY C // 0 0 00 1 // 0 1 01 10 2 // 1 0 0 // 1 1 11 1 std::tuple count(uint32_t c, std::tuple t) { auto [l, r] = t; switch (c) { case 0: return {l, r}; case 1: return {0, 0}; case 2: return {0, l+2*r}; case 3: return {l, r}; } } int main() { uint32_t a,b; std::cin >> a >> b; auto t = std::make_tuple(1u, 0u); for (int i=31;i>=0;--i) { uint32_t ii = 1u << i; uint32_t aa = a&ii ? 1 : 0; uint32_t bb = b&ii ? 1 : 0; uint32_t c = aa + 2 * bb; t = count(c, t); } auto [l,r] = t; std::cout << l+r << std::endl; return 0; }