AtCoder Beginner Contest 105
翻译中…
Problem Statement
翻译中…
Given an integer $N$, find the base $-2$ representation of $N$.
翻译中…
Here, $S$ is the base $-2$ representation of $N$ when the following are all satisfied:
翻译中…
$S$is a string consisting of0and1.- Unless
$S =$0, the initial character of$S$is1. - Let
$S = S_k S_{k-1} ... S_0$, then$S_0 \times (-2)^0 + S_1 \times (-2)^1 + ... + S_k \times (-2)^k = N$.
翻译中…
It can be proved that, for any integer $M$, the base $-2$ representation of $M$ is uniquely determined.
翻译中…
Constraints
翻译中…
- Every value in input is integer.
$-10^9 \leq N \leq 10^9$
翻译中…
Input
翻译中…
Input is given from Standard Input in the following format:
翻译中…
N
翻译中…
Output
翻译中…
Print the base $-2$ representation of $N$.
翻译中…
样例
Input #1
-9
Output #1
1011
As $(-2)^0 + (-2)^1 + (-2)^3 = 1 + (-2) + (-8) = -9$, `1011` is the base $-2$ representation of $-9$.
Input #2
123456789
Output #2
11000101011001101110100010101
Input #3
0
Output #3
0
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。