~/algor $ cat problems/bit-32-bitni-teskari
Reverse 32 bits
Easy
1000 ms
128 MB
25%
A number $0 \le n \lt 2^{32}$ is given. Write it in binary with exactly $32$ bits (padding with zeros on the left), reverse the order of the bits and print the resulting number in decimal. For example, $6 = 00\ldots0110_{2}$ becomes $0110\ldots00_{2} = 1610612736$.
Input
One integer $n$.
Output
One integer — the number with its bits reversed.
Note
$0 \le n \lt 2^{32}$
Examples
Input #1
6
Output #1
1610612736
Input #2
1
Output #2
2147483648