~/algor $ cat problems/bit-k-bitni-almashtirish
Flip the k-th bit
Easy
1000 ms
128 MB
20%
Integers $n$ and $k$ are given. Flip the $k$-th bit in the binary representation of $n$ ($0$ becomes $1$, $1$ becomes $0$). Bits are numbered from right to left, starting from $0$. Find the resulting number. For example, for $n = 5 = 101_{2}$, $k = 1$ the result is $111_{2} = 7$.
Input
One line with two integers: $n$ and $k$.
Output
One integer — the resulting number.
Note
$0 \le n \lt 2^{60}$
$0 \le k \le 60$
Examples
Input #1
5 1
Output #1
7
Input #2
8 3
Output #2
0