Problems > Mirror the Bits

Mirror the Bits

Difficulty: 1200 2000 ms 128 MB

bitwise

Treat N as an unsigned 32-bit value and print the value with its 32 bits in reverse order.

Input: one integer N.

Output: the bit-reversed 32-bit value.

Constraints:

  • 0 ≤ N < 232

Sample Tests

Input 1
1
Output 1
2147483648
Input 2
43261596
Output 2
964176192

Read the Editorial

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.