problem_id
stringlengths
6
6
user_id
stringlengths
10
10
time_limit
float64
1k
8k
memory_limit
float64
262k
1.05M
problem_description
stringlengths
48
1.55k
codes
stringlengths
35
98.9k
status
stringlengths
28
1.7k
submission_ids
stringlengths
28
1.41k
memories
stringlengths
13
808
cpu_times
stringlengths
11
610
code_sizes
stringlengths
7
505
p03286
u102960641
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n = int(input())\na = []\nb = 0\nwhile n != 0:\n c = (-2) ** b\n if n % (c*(-2)) != 0:\n n -= c\n a.append("1")\n else:\n a.append("0")\n b += 1\nelse:\n a.append("0")\nans = "".join(reversed(a))\nprint(ans)\n', 'n = int(input())\na = []\nb = 0\nwhile n != 0:\n c = (-2) ** b\n ...
['Wrong Answer', 'Accepted']
['s302794779', 's856545528']
[3188.0, 3060.0]
[21.0, 18.0]
[230, 230]
p03286
u105124953
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["n = int(input())\nif n == 0:\n print(0)\n exit()\nflag = True\nans_str = ''\nwhile True:\n if n // (-2) == 0:\n ans_str = '1' + ans_str\n print(int(ans_str))\n exit()\n else:\n ans_str = n%(-2) + ans_str", "n = int(input())\nif n == 0:\n print(0)\n exit()\nflag = True\nan...
['Runtime Error', 'Accepted']
['s258120473', 's554074644']
[2940.0, 3064.0]
[19.0, 17.0]
[231, 504]
p03286
u106297876
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["N = int(input())\nS = ''\nans_l = []\nif N != 0:\n\twhile N != 0:\n\t\tif N % 2 == 0:\n\t\t\tN = N // (-2)\n \t\t\tS = '0' + S\n\t\telse:\n \t\t\tN = (N-1) // (-2)\n \t\t\tS = '1' + S\nelse:\n\tS = '0'\nprint(S)\n", "N = int(input())\nS = ''\nans_l = []\nif N != 0:\n\twhile N != 0:\n\t\tif N % 2 == 0:\n\t\t\tN = N...
['Runtime Error', 'Accepted']
['s325041342', 's586645585']
[3188.0, 3064.0]
[17.0, 17.0]
[184, 179]
p03286
u112002050
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['ans = ""\nN = int(input())\n\nwhile N != 0:\n if N % 2 != 0:\n ans = "0" + ans\n N -= 1\n else:\n ans = "1" + ans\n N /= -2\nprint("".join(ans))\n', 'ans = ""\nN = int(input())\n\nwhile N != 0:\n if N % 2 != 0:\n ans = "1" + ans\n N -= 1\n else:\n ans = "0" + a...
['Wrong Answer', 'Accepted']
['s303097809', 's840291578']
[2940.0, 2940.0]
[17.0, 17.0]
[165, 189]
p03286
u121921603
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["n=int(input())\nif n==0:print(0)\nbi=''\nwhile n!=0:\n bi+=str(n%abs(k))\n if k<0:n=-(-n//k)\n else:n=n//k\nprint(bi[::-1])\n", "N=int(input())\nif N==0:print(0)\nbi=''\nwhile n!=0:\n bi+=str(n%abs(k))\n if k<0:n=-(-n//k)\n else:n=n//k\nprint(bi[::-1])", "n=int(input())\nif n==0:print(0)\nk=-2\nbi='...
['Runtime Error', 'Runtime Error', 'Accepted']
['s390054547', 's783368499', 's166336242']
[2940.0, 3060.0, 2940.0]
[17.0, 17.0, 17.0]
[126, 125, 131]
p03286
u125505541
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n = int(input())\nans = ""\nfor i in range(100):\n while n != 0:\n r = (n % 2)\n n = (n - r) // (-2)\n ans = str(r) + ans\nif n==0:\n print("0")\nelse:\n print(ans)', 'n = int(input())\nps = [0] * (1 << 16)\nfor i in range(1 << 16):\n temp = 0\n for j in range(16):\n if (i >...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s069306619', 's737694603', 's617304118']
[3060.0, 5800.0, 3060.0]
[17.0, 372.0, 17.0]
[184, 949, 192]
p03286
u131264627
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["n = int(input())\nans = ''`\nwhile n != 0:\n if n % (-2) == 0:\n ans = '0' + ans\n else:\n ans = '1' + ans\n n -= 1\n n /= -2\nif ans == '':\n ans = '0'\nprint(ans)", "n = int(input())\nans = ''\nwhile n != 0:\n if n % (-2) == 0:\n ans = '0' + ans\n else:\n ans = '...
['Runtime Error', 'Accepted']
['s676543591', 's773107381']
[2940.0, 3060.0]
[17.0, 18.0]
[186, 185]
p03286
u136395536
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['N = int(input())\n\nans = str(bin(N))\n\nstring = ""\n\nif N<0:\n for i in range(3,len(ans)):\n string = string + ans[i]\nelse:\n for i in range(2,len(ans)):\n string = string + ans[i]\n \nprint(string)', 'N = int(input())\n\n\nans = ""\ndivide = 1\n\nif N == 0:\n ans = "0"\nelse:\n while...
['Wrong Answer', 'Accepted']
['s478336588', 's114742644']
[3060.0, 2940.0]
[17.0, 17.0]
[212, 255]
p03286
u142415823
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["import sys\n\nN = int(input())\n\nk = 0\nS = []\nwhile 1:\n print(k, N)\n if N % 2 == 0:\n S.append(0)\n else:\n N -= (-1) ** k\n S.append(1)\n N /= 2\n k += 1\n if N == 0:\n break\n\nfor i in S[::-1]:\n sys.stdout.write(str(i))\nsys.stdout.write('\\n')\n", "import sys...
['Wrong Answer', 'Accepted']
['s287679759', 's109930748']
[3060.0, 3060.0]
[17.0, 17.0]
[282, 266]
p03286
u162612857
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['import numpy as np\nfrom functools import reduce\n\nn = int(input())\n\nX = 35\ni = np.arange(X, dtype=np.int64)[::-1]\n\n\ni = (-2)**i\nprint(i.dtype)\n\nans = np.zeros(X, dtype=np.int64)\n\nfor digit in range(X):\n\n\ti[digit]\n\tsum_of_opposite = i[digit+1::2].sum() \n\n\tif i[digit] > 0 and i[digit] + sum_of_oppo...
['Wrong Answer', 'Accepted']
['s003370774', 's145181021']
[12492.0, 12512.0]
[151.0, 150.0]
[601, 586]
p03286
u166306121
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
[" N = int(input())\n minus_bit = ''\n if N == 0:\n minus_bit = '00'\n while N != 0:\n mod = N % 4\n if mod == 0:\n minus_bit = minus_bit + '00'\n N = N//4\n elif mod == 1:\n minus_bit = minus_bit + '10'\n N = (N-1)//4\n elif mod == 2:\n minus_bi...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s388648353', 's545866396', 's068519648']
[2940.0, 3064.0, 3064.0]
[17.0, 18.0, 18.0]
[508, 533, 466]
p03286
u170324846
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['import math\n\ndef dnt(n):\n if n >= 0:\n return (-1) * (n // 2)\n else:\n return math.ceil((-1) * (n / 2))\n\nN = int(input())\nS = ""\n\nwhile N != 1:\n if N % 2 == 1:\n S = "1" + S\n else:\n S = "0" + S\n N = dnt(N)\n print(N)\n\nprint("1"+S)', 'import math\n\ndef dnt(...
['Wrong Answer', 'Accepted']
['s407495840', 's661661978']
[4720.0, 3060.0]
[2104.0, 18.0]
[272, 317]
p03286
u175426149
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["import math\n\nN = int(input())\n\ndef calc_power(num):\n if num > 1:\n m = 5\n power = 2\n while True:\n if num <= m:\n return_num = power\n break\n else:\n m = m * 4 + 1\n power += 2 \n elif num == 1:\n ...
['Wrong Answer', 'Accepted']
['s682327793', 's220804568']
[3064.0, 3064.0]
[18.0, 18.0]
[937, 991]
p03286
u185034753
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['N=int(input())\n\nm = 2\ns = ""\nsgn = 1\nwhile N!=0:\n r = N % m\n s += "1" if r != 0 else "0"\n m *= -2\n N = N -r \nif N == 0:\n print(0)\nelse:\n print(s[::-1])\n', 'N=int(input())\n\nif N == 0:\n print(0)\nelse:\n m = 2\n s = ""\n sgn = 1\n while N!=0:\n r = N % m\n ...
['Wrong Answer', 'Accepted']
['s175201125', 's924105480']
[2940.0, 2940.0]
[17.0, 18.0]
[170, 203]
p03286
u187205913
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["n = int(input())\nans = []\ni=2\nj=0\nk = 0\nwhile True:\n if k==n:\n break\n if (n-k)%i==0:\n ans.append(0)\n else:\n k += i>>1 if j%2==0 else -i>>1\n ans.append(1)\n print(k)\n i = i<<1\n j+=1\nfor i in ans[::-1]:\n print(i,end='')\nprint()", "n = int(input())\nans =...
['Wrong Answer', 'Accepted']
['s929122030', 's933974853']
[3060.0, 3064.0]
[18.0, 18.0]
[273, 301]
p03286
u201802797
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['# solution\n\ndata=int(input())\n\na="";k=1\n\nwhile data:\n\tt=k;k*=-2\n\tif n%k:n-=t;a+="1"\n\telse:a+="0"\nprint(a[::-1]or 0)', '# solution\nimport io\nimport math\n\ndata = int(input())\nresult=""\ncounter=1\nif data==0:\n\tresult="0"\nwhile data:\n\tt=counter\n\tcounter*=-2\n\tif data%counter:\n\t\tdata-=t\n\t\t...
['Runtime Error', 'Accepted']
['s290589614', 's437007943']
[2940.0, 3060.0]
[17.0, 17.0]
[115, 216]
p03286
u201856486
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['# coding: utf-8\nimport sys\nimport bisect\n\n\n"""Template"""\n\n\nclass IP:\n \n def __init__(self):\n self.input = sys.stdin.readline\n\n def I(self):\n \n return int(input())\n\n def IL(self):\n \n return list(map(int, self.input().split()))\n\n def SL(self):\n ...
['Wrong Answer', 'Accepted']
['s702405162', 's652454700']
[25408.0, 3316.0]
[643.0, 19.0]
[3292, 2948]
p03286
u202570162
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["N=int(input())\nans=''\nwhile N:\n ans=str(N%2)+ans\n N//=(-2)\nprint(ans)", "N=int(input())\nans=''\nwhile N:\n ans=str(N%2)+ans\n N=-(N//2)\nprint(ans if ans else 0)"]
['Wrong Answer', 'Accepted']
['s115383345', 's329786968']
[2940.0, 2940.0]
[17.0, 17.0]
[71, 86]
p03286
u214434454
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n = int(input())\ns = []\ndiv = -2\ni = 0\nwhile n!=0:\n r = n % div\n if r == 0:\n s.append(0)\n else:\n s.append(1)\n n -= (-2) ** i\n div *= 2\n i += 1\nans = ""\nfor i in range(len(s)):\n ans = str(s[i]) + ans\nif n != 0:\n print(ans)\nelse:\n print(0)', 'n = int(inpu...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s052037097', 's468016543', 's925911847', 's928159061', 's962435769']
[3064.0, 3064.0, 3064.0, 2940.0, 3064.0]
[17.0, 17.0, 17.0, 18.0, 18.0]
[283, 213, 376, 282, 286]
p03286
u215115622
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n = int(input())\nif n == 0:\n\t print ("0")\nout = []\nwhile n != 0:\n\t n, rem = divmod(n, -2)\n\t if rem < 0:\n\t \t n += 1\n\t \t rem -= ^2\n\t out.append(rem)\nprint ("".join(map(str, out[::-1])))', 'n = int(input())\nif n == 0:\n\t print ("0")\nout = []\nwhile n != 0:\n\t n, rem = divmod(n, -2)\n\t if rem < 0:\...
['Runtime Error', 'Accepted']
['s581100373', 's415019696']
[3064.0, 2940.0]
[17.0, 17.0]
[183, 184]
p03286
u223904637
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["n=int(input())\nans=''\ni=1\nk=n\nwhile k>0:\n if n%(2**i)!=0:\n ans='1'+ans\n k-=(-2)**(i-1)\n else:\n ans='0'+ans\n i+=1\nprint(ans)", "n=int(input())\nif n==0:\n print(0)\n exit()\nans=''\ni=1\nk=n\nwhile k!=0:\n if k%(2**i)!=0:\n ans='1'+ans\n k-=(-2)**(i-1)\n ...
['Wrong Answer', 'Accepted']
['s780831829', 's709453470']
[3060.0, 3060.0]
[17.0, 17.0]
[153, 188]
p03286
u225388820
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n=int(input())\ns=""\nwhile n:\n print(n)\n s=str(n&1)+s\n n=-(n>>1)\n print(s)\nprint(s if s else 0)', 'n=int(input())\ns=""\nwhile n:\n s=str(n&1)+s\n n=-(n>>1)\nprint(s if s else 0)']
['Wrong Answer', 'Accepted']
['s988618122', 's406371768']
[2940.0, 2940.0]
[17.0, 17.0]
[106, 80]
p03286
u228223940
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n = int(input())\n\n\nans = ""\n\nwhile(n != 0):\n if n % 2 == 0:\n ans = "0" + ans\n else:\n ans = "1" + ans\n n = n // (-2)\n \nprint(ans)', 'n = int(input())\n\n\nans = ""\n\nwhile(n != 0):\n if n % 2 == 0:\n ans = "0" + ans\n else:\n n -= 1\n ans = "1" + ans\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s553837672', 's792971096', 's818963782']
[2940.0, 3064.0, 2940.0]
[17.0, 17.0, 17.0]
[154, 189, 224]
p03286
u231122239
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["n = int(input())\nx=''\nwhile n != 0:\n x = str(n%2) + x\n n = - n//2\nprint(0 if x == '' else x)\n", "n = int(input())\nx=''\nwhile n != 0:\n x = str(n%2) + x\n n = - (n//2)\nprint(0 if x == '' else x)\n"]
['Wrong Answer', 'Accepted']
['s280259963', 's134008438']
[2940.0, 2940.0]
[17.0, 18.0]
[99, 101]
p03286
u235084192
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["N = int(input())\n\nif N == 0:\n print(0)\nelif N == 1:\n print(1)\nelse:\n s = 2\n j = 2\n i = 1\n while s + j**2 <= N:\n i += 1\n s += j**2\n j*= 2\n \n k = 2 * i + 1\n print('1' + bin(int('10'*i, 2)^(N-s))[2:])", "N = int(input())\nif N >= 0:\n if N == 0:\n print(0)\n elif N == 1:\n print...
['Wrong Answer', 'Accepted']
['s658248723', 's929349658']
[3064.0, 3064.0]
[18.0, 17.0]
[215, 458]
p03286
u240793404
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nn=int(input())\nl=list(map(int,str(bin(n))[2:]))\nfor i in range(1,len(l)+3): \n if l[-i] == 2: \n l[-i] = 0\n try:\n l[-(i+1)]+=1\n except:\n l.insert(0,1)\n if i%2==0 and l[-i]==1: \n try: \n l[-(i+1...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s199092092', 's626580561', 's767047991', 's315561061']
[3064.0, 3064.0, 3064.0, 3064.0]
[19.0, 19.0, 19.0, 18.0]
[448, 361, 344, 483]
p03286
u245870380
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['N = int(input())\n\nans = ""\n\nif N == 0:\n print(0)\nelse:\n while True:\n if N == 0:\n break\n if N % -2 == 0:\n ans = ans + "0"\n N = N // -2\n else:\n ans = ans + "1"\n N = (N-1) // -2\n print(ans)', 'N = int(input())\n\nans = "...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s233478096', 's686772489', 's682006936']
[2940.0, 3064.0, 2940.0]
[17.0, 18.0, 18.0]
[271, 324, 277]
p03286
u250583425
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['import sys\ndef input(): return sys.stdin.readline().rstrip()\n\ndef main():\n N = int(input())\n\n ans = []\n while N != 0:\n r = N % 2\n if r < 0:\n r += 2\n ans.append(r)\n N -= r\n N //= -2\n print("".join(map(str, ans)))\n\nif __name__ == \'__main__\':\n ...
['Wrong Answer', 'Accepted']
['s809694371', 's941001307']
[2940.0, 3060.0]
[19.0, 17.0]
[309, 363]
p03286
u251515715
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['import sys\nn = int(input())\ns=[]\ni=0\nif n==0:\n print(0)\n sys.exit()\nwhile n > 0:\n if n%(2**(i+1))!=0:\n a=1\n else:\n a=0\n s.append(a)\n n=n-a*(-2)**i\n i+=1\n\ns.reverse()\nm=""\nfor ss in s:\n m+=str(ss)\nprint(m)', 'import sys\nn = int(input())\ns=[]\ni=0\nif n==0:\n print(0)\n sys.exit()\...
['Wrong Answer', 'Accepted']
['s938561944', 's634101122']
[3064.0, 3060.0]
[17.0, 17.0]
[218, 219]
p03286
u254871849
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["import sys\n\nn = int(sys.stdin.readline().rstrip())\n\ndef base_convert(n, b):\n res = ''\n while n:\n r = abs(n % b)\n res = str(r) + res\n n = (n - r) // b\n\n return int(res) if res else 0\n\ndef main():\n return base_convert(n, 3)\n\nif __name__ == '__main__':\n ans = main()\n...
['Wrong Answer', 'Accepted']
['s646833530', 's748199532']
[3684.0, 3060.0]
[2104.0, 18.0]
[314, 297]
p03286
u255280439
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['import sys\nimport math\nimport collections\nimport itertools\nimport array\nimport inspect\n\n\nsys.setrecursionlimit(10000)\n\n\n# Debug output\ndef chkprint(*args):\n names = {\n id(v): k\n for k, v in inspect.currentframe().f_back.f_locals.items()\n }\n print(\', \'.join(\n names.get...
['Wrong Answer', 'Accepted']
['s308862655', 's812803793']
[5052.0, 5052.0]
[263.0, 258.0]
[2730, 2712]
p03286
u256464928
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n=int(input())\nx=""\nwhile n!=0:\n x=str(n%2)+x\n n=-(n//2)\n print(x,n)\nprint(0 if x=="" else x)', 'n=int(input())\nx=""\nwhile n!=0:\n x=str(n%2)+x\n n=-(n//2)\nprint(0 if x=="" else x)\n']
['Wrong Answer', 'Accepted']
['s520189091', 's642758653']
[3060.0, 2940.0]
[18.0, 18.0]
[102, 88]
p03286
u263654061
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['N = int(input())\nts = fetch_Hosu(N)\n\nle = len(ts)\nnuml = [0]* 15\n\nfor i in range(15):\n tmp = int(ts[2*i+1:2*i+3])\n \n if tmp ==1:\n numl[i] += 11\n elif tmp ==11:\n if i>1:\n numl[i-1] += 11\n numl[i] += 1\n else:\n numl[i] += tmp\n \n# print(nu...
['Runtime Error', 'Runtime Error', 'Accepted']
['s069035308', 's079663383', 's660482009']
[3064.0, 3064.0, 3060.0]
[17.0, 17.0, 17.0]
[784, 750, 228]
p03286
u263830634
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["N = int(input())\n\nS = str()\ncount = 1\nmemo = 0\nwhile a:\n amari = N%(2 ** count)\n# print ('amari', amari)\n if (amari- memo) == 2 ** (count-1):\n s = 1\n else:\n s = 0\n memo = memo + s * (-2) **(count-1)\n# print ('momo', memo)\n S = str(s) + S\n count += 1\n if memo ==...
['Runtime Error', 'Accepted']
['s477805662', 's423098681']
[3060.0, 3060.0]
[17.0, 18.0]
[342, 221]
p03286
u268792407
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n=int(input())\ns=""\nwhile n>0:\n if n % 2 == 1:\n s = "1" + s\n n = (n-1)//2*(-1)\n else:\n s="0"+s\n n=n//2*(-1)\nprint(s)', 'n=int(input())\nif n==0:\n print(0)\n exit()\ns=""\nwhile n!=0:\n if n % 2 == 1:\n s = "1" + s\n n = (n-1)//2*(-1)\n else:\n s="0"+s\n n=n//2*(-1)\nprint(s)']
['Wrong Answer', 'Accepted']
['s629058816', 's974496385']
[2940.0, 2940.0]
[17.0, 17.0]
[130, 160]
p03286
u272557899
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n = int(input())\nli = []\nres = n % (-2)\nans = n // (-2)\nli.append(res)\np = 0\nwhile p == 0:\n res = ans % (-2)\n ans = ans // (-2)\n li.append(res)\n if ans == 0 or ans == 1:\n p = 1\n if ans == 1:\n li.append(ans)\nli = [str(n) for n in li]\npr = ""\nfor i in range(len(li)):\n pr += li[-1-i]\npr...
['Wrong Answer', 'Accepted']
['s609123211', 's716253983']
[3064.0, 3064.0]
[19.0, 18.0]
[307, 549]
p03286
u278670845
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['from math import *\na = int(input())\n\n# imax =\nflag1 = a%2!=0\nflag2 = a <=0\n\nif flag1:\n a -=1\n\ndef Base_10_to_n(X, n):\n print(int(X/n))\n if (int(X/n)):\n return Base_10_to_n(int(X/n), n)+str(abs(X%n))\n return str(abs(X%n))\n\nx2 = Base_10_to_n(a, -2)\n\nif flag1:\n print(x2[:-1]+"1")...
['Wrong Answer', 'Accepted']
['s684326572', 's874017842']
[3188.0, 3060.0]
[19.0, 17.0]
[319, 127]
p03286
u278868910
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["N = int(input())\n\nif N == 0:\n print (0)\n exit(0)\n\nflag = N < 0\nN = N + 1\nans = ''\nfor i in range(100,0,-1):\n if N == 0:\n break;\n if (flag and i % 2 == 0) or (not(flag) and i%2 == 1):\n ans = ans + '0'\n continue\n x = (-2) ** i\n if abs(N) >= abs(x):\n N = N -...
['Wrong Answer', 'Accepted']
['s466211166', 's937534489']
[3064.0, 3316.0]
[17.0, 21.0]
[381, 181]
p03286
u280978334
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['from math import log2\n\ndef main():\n N = int(input())\n if N == 0:\n print(0)\n return\n Ans = []\n while N != 1:\n r = N%2\n Ans.append(r)\n N = -1*( N // 2)\n print(*Ans[::-1],sep="")\n return\n\nif __name__ == "__main__":\n main()', 'from math import log2\...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s407133196', 's595968163', 's499593740']
[3060.0, 3188.0, 3060.0]
[17.0, 19.0, 17.0]
[276, 310, 276]
p03286
u281303342
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['N = int(input())\n\nprint(N%(-2),N//(-2))\n\nAns = ""\nwhile N!=0:\n Ans = str(N%2) +Ans\n N = (N - N%2)//2\n N *= -1\n\nprint(Ans)', 'N = int(input())\n\nAns = 0\nwhile N!=0:\n Ans = str(N%2) +Ans\n N = (N - N%2)//2\n N *= -1\n\nprint(Ans)', 'N = int(input())\n\nAns = ""\nwhile N!=0:\n Ans = str...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s461242950', 's757390627', 's483255964']
[3060.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[130, 106, 125]
p03286
u282228874
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n = int(input())\nif n == 0:\n\tprint(0)\n\texit()\nres = ""\nwhile True:\n\tif n == 0:\n\t\tbreak\n\telse:\n\t\tif n%2 == 0:\n\t\t\tres += \'0\'\n\t\telse:\n\t\t\tres += \'1\'\n\t\t\tn -= 1\n\t\tn //= -2\n\t\tprint(n)\nprint(res[::-1])', 'N = int(input())\nif N == 0:\n print(0)\n exit()\nres = ""\nwhile N != 1...
['Wrong Answer', 'Accepted']
['s769934534', 's334781364']
[2940.0, 3060.0]
[20.0, 17.0]
[193, 206]
p03286
u285443936
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['N = int(input())\n\nans = []\n\nwhile N != 0:\n if N < 0:\n N = abs(N)+2\n b = N % 2\n N = N // (-2)\n ans.append(b)\n #print(N,b,ans)\n\nans = map(str, ans)\nans_str = "".join(ans)\nprint(ans_str[::-1])', 'N = int(input())\ni = 0\nans = []\nif N == 0:\n print(0)\n exit()\nwhile N:\n if N%(2)**(i+1) > 0:\n...
['Wrong Answer', 'Accepted']
['s203791464', 's650416022']
[46232.0, 3064.0]
[2106.0, 17.0]
[197, 207]
p03286
u314050667
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["N=int(input())\nans=[]\nt=N\nwhile t > 0:\n if t%(-2)==0:\n ans.append('0')\n t //= -2\n else:\n ans.appappend('1')\n t=(t-1)//(-2)\n \nprint(''.join(reversed(ans)))\n ", "N=int(input())\nans=[]\nt=N\nwhile t != 0:\n if t%(-2)==0:\n ans.append('0')\n t ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s705016533', 's996609401', 's140697134']
[2940.0, 2940.0, 3064.0]
[17.0, 17.0, 17.0]
[204, 214, 599]
p03286
u316464887
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["from itertools import product\ndef main():\n N = int(input())\n if N == 0:\n return 0\n l = set()\n while N != 0:\n if N > 0:\n r = plus(N)\n l.add(r)\n N -= pow(2, r)\n else:\n r = minus(N)\n l.add(r)\n N += pow(2, r)\...
['Wrong Answer', 'Accepted']
['s495114783', 's798030994']
[3064.0, 3064.0]
[18.0, 19.0]
[765, 713]
p03286
u318127926
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["n = int(input())\ni = 1\ns = []\nwhile n!=0:\n if n%2**i>0:\n s.append('1')\n n -= (-2)**(i-1)\n else:\n s.append('0')\n i += 1\nif n==0:\n print('0')\nelse:\n print(''.join(s[::-1]))", "n = int(input())\nans = []\nfor i in range(100):\n if n%(2**(i+1))>0:\n ans.append('1...
['Wrong Answer', 'Accepted']
['s682931462', 's263638076']
[3060.0, 3060.0]
[17.0, 17.0]
[206, 201]
p03286
u327465093
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['N = int(input())\n\ns = ""\nwhile abs(N) > 0:\n m = N % (-2)\n if m != 0:\n s = "1" + s\n else:\n s = "0" + s\n N = (N+m) // (-2)\n print(m, N)\nprint(s)\n', 'N = int(input())\n\nif N == 0:\n print(0)\nelse:\n s = ""\n while abs(N) > 0:\n m = N % (-2)\n if m != 0:\n...
['Wrong Answer', 'Accepted']
['s221475067', 's213488025']
[3060.0, 2940.0]
[19.0, 17.0]
[172, 222]
p03286
u332906195
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["N = int(input())\n\nif N == 0:\n print('0')\nelse:\n ans, d = '', 2\n while abs(N) > 0:\n ans = '0' + ans if N % d == 0 else '1' + ans\n N, d = N - N % d, d * (-2)\n\n print(ans)\n", "N = int(input())\n\nn, ans, d = N, '', 2\nwhile abs(n) > 0:\n ans = '0' + ans if n % d == 0 else '1' ...
['Wrong Answer', 'Accepted']
['s334743496', 's412258852']
[2940.0, 2940.0]
[17.0, 17.0]
[199, 167]
p03286
u342563578
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['N,K = map(int,input().split())\nAlist = list(map(int, input().strip().split()))\np = 1\nfor i in range(len(Alist)-1):\n if Alist[i]*Alist[i+1] <= 0:\n q = i\n p = p*(-1)\nlength = 10**10\nans2 = 10**10\nif p == 1:\n if Alist[0] > 0:\n ans = Alist[K-1]\n if Alist[0] < 0:\n ans = -A...
['Runtime Error', 'Accepted']
['s032817890', 's505151528']
[3064.0, 3064.0]
[18.0, 19.0]
[902, 1071]
p03286
u344813796
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n=int(input())\nans=""\nwhile n!=0:\n if (n%2)!=0:\n n-=1\n ans="1"+ans\n else:\n ans="1"+ans\n n/=-2\nif ans=="":\n ans="0"\nprint(ans)', 'n=int(input())\nans=""\nwhile n!=0:\n if (n%2)!=0:\n n-=1\n ans="1"+ans\n else:\n ans="0"+ans\n n/=-2\nif ans=="":\n ans="0"\nprint(ans)']
['Wrong Answer', 'Accepted']
['s142703942', 's693534505']
[2940.0, 3064.0]
[19.0, 17.0]
[138, 138]
p03286
u347640436
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["import sys\nn = int(input())\nif n == 0:\n print('0')\n sys.exit()\nt = []\nwhile n != 0:\n r = n % 2\n t.append(str(r))\n n = (n - r) // -2\nprint(t[::-1])\n", "import sys\nn = int(input())\nif n == 0:\n print('0')\n sys.exit()\nt = []\nwhile n != 0:\n r = n % 2\n t.append(str(r))\n n = (n - r) // -2\nprin...
['Wrong Answer', 'Accepted']
['s637615550', 's256197292']
[2940.0, 2940.0]
[17.0, 18.0]
[152, 161]
p03286
u359474860
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['import math\nn = int(input())\nx = []\n\nif n == 0:\n print(0)\nelse:\n if n > 0:\n a = math.ceil(math.log2(n * 3 + 1) / 2) \n b = 2 * a - 1\n print(b)\n x = [[]] * (b)\n print(x)\n else:\n a = math.ceil(math.log2((-3 * n + 2) / 2) / 2)\n b = 2 * a\n x ...
['Wrong Answer', 'Accepted']
['s721399705', 's816547353']
[3064.0, 3064.0]
[18.0, 19.0]
[852, 704]
p03286
u359747364
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['a = int(input())\nif a == 0:\n print("0")\nelse:\n digits = []*10\n base = 1\n i = 0\n while a != 0:\n if a%(base*2) == 0:\n digits.append(\'0\')\n else:\n digits.append(\'1\')\n a -= base\n i += 0\n base *= -2\n print(\'\'.join(digits))\n...
['Wrong Answer', 'Accepted']
['s447840756', 's017544790']
[2940.0, 3060.0]
[17.0, 17.0]
[296, 301]
p03286
u360515075
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['N = int(input())\n\nB = ""\ni = 0\nwhile N != 0:\n B = str(abs(N % (-2))) + B\n if i % 2 == 0:\n N = (N + (N % (-2))) // 2\n else:\n N = (N - (N % (-2))) // 2\n i += 1\nelse:\n print (0)\nprint (B)\n', 'N = int(input())\n\nB = ""\ni = 0\nif N == 0:\n print (0)\nelse:\n while N != 0:\n B = str(abs(N % ...
['Wrong Answer', 'Accepted']
['s190330070', 's973032825']
[3060.0, 3064.0]
[17.0, 17.0]
[196, 223]
p03286
u364862909
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['import itertools\nN = int(input())\n\nif N == 0:\n print(0)\n exit()\nans = []\nwhile N !=0:\n ans.append(N%2)\n N = -(N-N%2)//2\nprint("".join(list(map(str,ans))))', 'import itertools\nN = int(input())\n\nif N == 0:\n print(0)\n exit()\nans = []\nwhile N !=0:\n ans.append(N%2)\n N = -(N-N%2)/...
['Wrong Answer', 'Accepted']
['s256566124', 's715444601']
[8976.0, 9116.0]
[29.0, 29.0]
[166, 180]
p03286
u365364616
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["N = int(input())\nif N == 0:\n print('0')\nelse:\n k = 0\n ans = []\n while(True):\n if N % (-2) ** k == 0:\n ans.append('0')\n else:\n ans.append('1')\n N -= (-2) ** (k - 1)\n if N == 0:\n break\n else:\n k += 1\n print...
['Wrong Answer', 'Accepted']
['s774318647', 's584387111']
[3188.0, 3060.0]
[18.0, 17.0]
[322, 324]
p03286
u371763408
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n = int(input())\nif n ==0:\n print(0)\ns=\'\'\nwhile n !=0:\n if n%2==1:\n s="1"+s\n n-=1\n else:\n s=\'0\'+s\n n-=n//2\nprint(s)\n', 'n = int(input())\nif n ==0:\n print(0)\ns=\'\'\nwhile n !=0:\n if n%2==1:\n s="1"+\n n-=1\n else:\n s=\'0\'+s\n n-=n//2\nprint(s)\n', 'n = int(input())\nif ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s041686844', 's454214173', 's895611597']
[3684.0, 3064.0, 2940.0]
[2104.0, 18.0, 17.0]
[129, 128, 128]
p03286
u391066416
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['def sigma4jou(k):\n total = 0\n for i in range(k):\n total += 4 ** (i)\n return(total)\n\ndef pketa(N):\n k = 1\n while N - sigma4jou(k) > 0:\n k += 1\n return(2 * k - 1)\n\ndef mketa(N):\n k = 1\n while N + 2 * sigma4jou(k) < 0:\n k += 1\n return(2 * k)\n\ndef getResul...
['Runtime Error', 'Accepted']
['s825971735', 's240463070']
[3064.0, 3064.0]
[17.0, 17.0]
[1266, 1271]
p03286
u397531548
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['N=int(input())\nif N==0:\n print(0)\nelif N>0:\n a=0\n i=31\n while i>=0:\n if N%(2**i)==0:\n if i%2==1:\n a+=2**(i+1)+2**i\n break\n else:\n a+=2**i\n break\n else:\n if N>2**i:\n N-=...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s039172838', 's191905204', 's326256255', 's505887297']
[3064.0, 3064.0, 3064.0, 3064.0]
[18.0, 18.0, 18.0, 18.0]
[886, 892, 856, 478]
p03286
u398942100
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["a=int(input())\nb=[]\nif a==0:\n print(0)\nelse:\n while a:\n\tb.append(a&1)\n\ta=int((a-(a&1))/(-2))\n print(''.join(map(str,b)))", "a=int(input())\nb=[]\nwhile a:\n\tprint(str(a)+' '+str(a&1))\n\tb.append(a&1)\n\ta=int((a-(a&1))/(-2))\nprint(''.join(map(str,b)))", "a=int(input())\nb=[]\nif a==0:\n\tprint(0)\nwhi...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s160153425', 's173163610', 's426963169', 's556193131', 's576626122', 's622821313', 's764300600', 's891892843']
[3060.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 3060.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[123, 121, 112, 110, 76, 120, 110, 74]
p03286
u415905784
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["N = int(input())\ndef n_aray_notation(N, n):\n if N == 0:\n return '0'\n else:\n s = ''\n while N:\n s = str(N % abs(n)) + s\n N -= N % abs(n)\n N //= n\n return s\nprint(n_array_notation(N, -2))", "N = int(input())\ndef n_ary_notation(N, n):\n if N == 0:\n return '0'\n else:\n s ...
['Runtime Error', 'Accepted']
['s837720224', 's588127721']
[2940.0, 2940.0]
[17.0, 17.0]
[213, 210]
p03286
u417169160
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['N=int(input())\ni=0\ns=[]\nn=N\nwhile 1:\n k=pow(2,i+1)\n d=n%k\n if d!=0:\n s.append(1)\n n=n-pow(-2,i)\n elif n//k!=0:\n s.append(0)\n else:\n break\n i=i+1\nwhile s:\n print(s.pop())\n ', 'N=int(input())\ni=0\ns=[]\nn=N\nwhile 1:\n k=pow(2,i+1)\n d=n%k\n ...
['Wrong Answer', 'Accepted']
['s487383292', 's277451905']
[3060.0, 3064.0]
[19.0, 18.0]
[223, 269]
p03286
u434282696
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["N = int(input())\nif N == 0:\n print(0)\nelse:\n li = []\n ind = 0\n while N != 0:\n if N % 2**(ind + 1) == 0:\n li.insert(0,0)\n ind += 1\n else:\n li.insert(0,1)\n N -= (-2)**(ind)\n ind += 1 \n x = ''.join([str(l...
['Wrong Answer', 'Accepted']
['s267748832', 's718368948']
[3064.0, 3064.0]
[17.0, 17.0]
[356, 340]
p03286
u445380615
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['def mainusbin(num):\n base = -2\n dst = ""\n i = 0\n if abs(base) > num:\n return num\n while abs(base**i) <= num:\n i += 1\n amari = num % base**i\n if amari:\n dst = "1" + dst\n num -= base**(i-1)\n else:\n dst = "0" + dst\n retur...
['Wrong Answer', 'Accepted']
['s555028321', 's689183798']
[3060.0, 3060.0]
[18.0, 18.0]
[361, 371]
p03286
u445927145
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['from itertools import permutations\n\n\nclass Solver(object):\n def __init__(self):\n self.n = int(input())\n\n def solve(self):\n number_string = ""\n n = self.n\n while True:\n remainder = abs(n % (-2))\n number_string = str(remainder) + number_string\n ...
['Wrong Answer', 'Accepted']
['s601479803', 's818659413']
[3064.0, 3064.0]
[17.0, 21.0]
[581, 610]
p03286
u451017206
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['def EncodeNegBase(n, b): #Converts from decimal\n\tif n == 0:\n\t\treturn "0"\n\tout = []\n\twhile n != 0:\n\t\tn, rem = divmod(n, b)\n\t\tif rem < 0:\n\t\t\tn += 1\n\t\t\trem -= b\n\t\tout.append(rem)\n\treturn "".join(map(str, out[::-1]))\n \ndef DecodeNegBase(nstr, b): #Converts to decimal\n\tif nstr == "0":\n\t\t...
['Wrong Answer', 'Accepted']
['s181984457', 's953751631']
[3060.0, 3060.0]
[17.0, 17.0]
[381, 134]
p03286
u457683760
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n=int(input())\n\nif n==0:\n print(0)\nelse:\n ans=""\n while n!=0:\n ans=str(n%2)+ans\n n=n//(-2)\nans=int(ans)\nprint(ans)', 'n=int(input())\n\nif n==0:\n ans="0"\nelse:\n ans=""\n while n!=0:\n ans=str(n%2)+ans\n n=-1*(n//2)\nans=int(ans)\nprint(ans)']
['Runtime Error', 'Accepted']
['s292804792', 's418146484']
[2940.0, 3060.0]
[19.0, 18.0]
[137, 138]
p03286
u457901067
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['N = int(input())\ni = 0\nansw = []\n\nif N == 0:\n print("0")\n exit(0)\n\nif ( N == abs(N)):\n sign = 1\n base = 0\n i = 0\n while(1):\n if N <= (-2) ** i + base:\n break\n else:\n base = base + (-2) ** i\n i = i + 2\nelse:\n sign = -1\n base = 0\n i = 1\n while(1):\n if N >= (-2) *...
['Wrong Answer', 'Accepted']
['s718322866', 's627532911']
[3064.0, 2940.0]
[17.0, 17.0]
[882, 213]
p03286
u472065247
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["n = 0\nl = []\n\nif n == 0:\n l.append('0')\n\nwhile n:\n if n % 2:\n l.append('1')\n else:\n l.append('0')\n n = -(n // 2)", "n = 0\nl = []\n\nif n == 0:\n l.append('0')\n\nwhile n:\n if n % 2:\n l.append('1')\n else:\n l.append('0')\n n = -(n // 2)\n\nprint(''.joi...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s318995132', 's963692650', 's070294535']
[2940.0, 2940.0, 2940.0]
[18.0, 17.0, 17.0]
[138, 167, 180]
p03286
u474270503
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["N=-int(input())\nif N=0:\n print(0)\nelse:\n tmp=[]\n while N!=0:\n tmp.insert(0,N%(2))\n N=-N//2\n s=''.join([str(_) for _ in tmp])\n print(s)\n", "N=-int(input())\nif N==0:\n print(0)\nelse:\n tmp=[]\n while N!=0:\n tmp.insert(0,N%(2))\n N=-N//2\n s=''.join([st...
['Runtime Error', 'Accepted']
['s115916752', 's562559622']
[2940.0, 2940.0]
[16.0, 17.0]
[164, 165]
p03286
u475675023
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['N=int(input())\nL=[]\nM=""\nwhile N!=0:\n M=int((-1)*(N%(-2)))\n if N<0:\n N=int((N-1)/(-2))\n else:\n N=int(N/(-2))\n L.insert(0,str(M))\nif N=0:\n print(0)\nelse:\n print("".join(L))', 'N=int(input())\nL=[]\nM=""\nwhile N!=0:\n M=int((-1)*(N%(-2)))\n if N<0:\n N=int((N-1)/(-2))\n else:\n N=int(...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s338344401', 's866589198', 's973874022']
[2940.0, 3060.0, 3060.0]
[17.0, 18.0, 17.0]
[183, 184, 181]
p03286
u494058663
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["N = int(input())\n\nans = []\ntmp = 0\n\ndef algo(n):\n if n == 0:\n return\n \n if n%2 == 0:\n tmp = 0 \n else:\n tmp = 1\n ans.append(tmp)\n algo((n-tmp)//(-2))\n\nalgo(N)\nStr = ''\nfor i in range(len(ans)):\n Str=Str+str(ans[i])\nprint(Str)", "import sys\nN = int(input())...
['Wrong Answer', 'Accepted']
['s090203844', 's987753957']
[3064.0, 3064.0]
[18.0, 17.0]
[296, 362]
p03286
u497625442
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n = int(input())\ns=""\nt=-2\nwhile n != 0:\n z = 0 if n % t ==0 else 1\n s = s + str(z)\n n = n - z*t/(-2)\n t = t*(-2)\nprint(s)\n', 'n = int(input())\nif n==0:\n print("0")\n exit()\ns=""\nt=-2\nwhile n != 0:\n z = 0 if n % t ==0 else 1\n s = str(z)+s\n n = n - z*t/(-2)\n t = t*(-2)\nprint(s)']
['Wrong Answer', 'Accepted']
['s426393482', 's527191303']
[2940.0, 2940.0]
[17.0, 17.0]
[127, 155]
p03286
u500990280
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n = map(int,input())\n\n\ndef base-2(n):\n a = ()\n while n! = 0:\n r = n % 2:\n if (r < 0):\n r += 2\n\n n = (n - r)/2\n a.append(str(r))\n if(a = ""):\n a = "0"\n reversed(a)\nprint(base(n))', 'n = int(input())\ndef basen(n):\n a = []\n while n!= 0...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s187895505', 's607905235', 's634620566', 's955580839', 's519032488']
[3064.0, 3060.0, 3060.0, 3064.0, 3064.0]
[17.0, 17.0, 17.0, 18.0, 18.0]
[239, 257, 264, 275, 276]
p03286
u502389123
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["N = int(input())\nstr = ''\n\nwhile(N != 0):\n if N % 2:\n N -= 1\n N //= -2\n str += '1'\n else:\n N //= -2\n str += '0'\n \nif N == 0:\n print(0)\nelse:\n print(str[::-1])\n", "N = int(input())\nstr = ''\n\nwhile(N != 0):\n if N % 2:\n N -= 1\n ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s684848520', 's850694638', 's829174429']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[213, 215, 208]
p03286
u513081876
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["import math\nN = int(input())\n\ndef minus_2(n):\n ans = ''\n \n if n == 1:\n ans += '1'\n elif n == 0:\n ans += '0'\n else:\n for i in range(10**9):\n if n % 2 == 0:\n ans += '0'\n else:\n ans += '1'\n n = math.ceil(n/...
['Wrong Answer', 'Accepted']
['s342267844', 's150648857']
[3064.0, 2940.0]
[17.0, 17.0]
[444, 244]
p03286
u518042385
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['a=int(input())\nl=[]\nif a==0:\n print(a)\nelse:\n while a!=1:\n if a<0:\n l.append(abs(a)%2)\n if abs(a)%2==1:\n a=abs(a-1)//2\n else:\n a=abs(a)//2\n elif a>0:\n l.append(-(a%2))\n a=-(a//2)\n l.append(a)\n s=""\n for i in l:\n s+=str(i)\n print(s)\n \n \n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s045002530', 's859184352', 's697441789']
[3060.0, 3064.0, 3064.0]
[17.0, 17.0, 17.0]
[296, 282, 302]
p03286
u519923151
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n = int(input())\n\ndp =[0]*40\n\nif n ==0:\n print(0)\n\nelif n >0:\n x = bin(n)\n bx = x[2:]\n lx = len(bx)\n for i in range(lx-1,-1,-1):\n dp[i] = int(bx[lx-1-i])\n for i in range(40):\n if i % 2 ==1 and dp[i]==1:\n dp[i+1] +=1\n while max(dp) >1:\n for i in ran...
['Runtime Error', 'Accepted']
['s976058202', 's146813258']
[9348.0, 9136.0]
[27.0, 30.0]
[1205, 1206]
p03286
u528981315
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['import sys\nimport math\ny = int(input().split()[0])\nresult = ""\ni = 0\nwhile True:\n print(i)\n z = (-2) ** (i+1)\n x = y % z\n print(x)\n if x != 0:\n y = y + x\n result = "1" + result\n else:\n result = "0" + result\n if y == 0:\n break\n i = i + 1\nprint(resul...
['Wrong Answer', 'Accepted']
['s970774917', 's793749066']
[3188.0, 3188.0]
[18.0, 19.0]
[302, 277]
p03286
u551909378
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["\ndef change_2r(N):\n if N==0:\n return [0]\n list=[]\n while N>=2:\n list.append(N%2)\n N=int((N-N%2)/2)\n list.append(1)\n return list\n \n\ndef moveup(N,i):\n if len(N)<=i:\n N.append(1)\n else:\n if N[i]==0:\n N[i]=1\n elif N[i]==1:\n ...
['Wrong Answer', 'Accepted']
['s260786306', 's588036674']
[3064.0, 3064.0]
[17.0, 17.0]
[817, 804]
p03286
u553348533
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['N = int(input())\nans = ""\nif N == 0:\n ans = "0"\nwhile N != 0:\n if N % 2 != 0:\n N -= 1\n ans = "1" + ans\n else:\n ans = "0" + ans\n N //= -2\n\nprint(int(ans))', 'N = int(input())\nans = ""\nif N == 0:\n ans = "0"\nwhile N != 0:\n if N % 2 != 0:\n N -= 1\n ...
['Wrong Answer', 'Accepted']
['s217495654', 's487032896']
[2940.0, 2940.0]
[17.0, 17.0]
[190, 187]
p03286
u559823804
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["from math import ceil\n\nn=int(input())\nif n==0:\n print(0)\n exit()\n\nans=''\n\nwhile n!=0:\n ans+=str(abs(n)%2)\n n=ceil(n/-2)\n print(n)\nprint(ans[::-1])", "from math import ceil\n\nn=int(input())\nif n==0:\n print(0)\n exit()\n\nans=''\n\nwhile n!=0:\n ans+=str(abs(n)%2)\n n=ceil(n/-...
['Wrong Answer', 'Accepted']
['s478848495', 's283088123']
[3060.0, 3060.0]
[17.0, 17.0]
[161, 148]
p03286
u571444155
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["n = int(input())\n\nans = ''\n\nwhile n != 0:\n r = n % 2 \n print(r)\n\n if r < 0:\n r = r + 2\n \n n = (n-r) / (-2)\n\n ans = ans + str(int(r))\n\nans = list(ans) \nprint(ans)\nans.reverse()\nprint(''.join(ans))", "n = int(input())\n\nans = ''\n\nif n == 0:\n print('0')\n\nwhile n != ...
['Wrong Answer', 'Accepted']
['s249815213', 's943805387']
[3060.0, 3060.0]
[17.0, 17.0]
[223, 226]
p03286
u576432509
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n=int(input())\n\n#n=-9\n#ans=1011\n\n#n=123456789\n#ans=11000101011001101110100010101\n#ans="01 10 00 10 10 11 00 11 01 11 01 00 01 01 01"\n\n#n=4\n\n#n=0\n#ans=0\n\nkp=0\nkm=0\nk=0\nwhile not(km<=n and n<=kp):\n k=k+1\n km=-int(2*(4**k-1)/(4-1))\n kp=int((4**k-1)/(4-1))\n# print("n=",n,"k=",k,"km=",km,"...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s041759597', 's746967937', 's551609057']
[3064.0, 3064.0, 3064.0]
[18.0, 17.0, 17.0]
[824, 515, 263]
p03286
u582333355
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["N = int(input())\n\nans = ''\n\ndef divide(n):\n\tif n % (-2) != 0:\n\t\tp = (n//(-2))+1\n\t\tq = n - p * (-2)\n\telse:\n\t\tp = n//(-2)\n\t\tq = n - p * (-2)\n\treturn p,q\n\nwhile True:\n\tp,q = divide(N)\n\tif p == 1 or p == 0:\n\t\tans = str(p) + ans\n\t\tbreak\n\tN = p\n\tans = str(q) + ans\nprint(ans)", "N = in...
['Wrong Answer', 'Accepted']
['s509320951', 's848266836']
[3064.0, 3064.0]
[17.0, 17.0]
[269, 300]
p03286
u585742242
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["# -*- coding: utf-8 -*-\nn = int(input())\n\nif n == 0:\n print(0)\n\nelse:\n s = ''\n cnt = 1\n while n > 0:\n s += str(1) if n % (-2)**cnt != 0 else str(0)\n n -= (-2)**(cnt - 1) if n % (-2)**cnt != 0 else 0\n cnt += 1\n print(s[::-1])\n", "# -*- coding: utf-8 -*-\nn = int(input(...
['Wrong Answer', 'Accepted']
['s528053000', 's564504158']
[2940.0, 2940.0]
[17.0, 17.0]
[261, 262]
p03286
u593005350
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['N=int(input())\n\nx=[]\nif N != 0:\n\tflag = N // abs(N)\nN=abs(N)\nwhile N != 0:\n\tx.insert(0,N % 2 * flag )\n\tN //= 2\n\tflag *= -1\nx.insert(0,0)\nx.insert(0,0)\n\n# 2 = (-1)*(-2) = (-2+1)*(-2) = (-2)^2+(-2)\nfor i in range(len(x))[::-1]:\n\tif x[i] == -1:\n\t\tx[i] = 1\n\t\tx[i-1] += 1\n\tif x[i] == 2:\n\t\tx[i...
['Wrong Answer', 'Accepted']
['s345186936', 's365988793']
[3064.0, 2940.0]
[17.0, 17.0]
[534, 86]
p03286
u597374218
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n=int(input())\nx=""\nwhile n!=0:\n x+=str(n%2)\n n=-(n//2)\nprint("0" if x=="" else x)', 'n=int(input())\nx=""\nwhile n!=0:\n x=str(n%2)+x\n n=-(n//2)\nprint(0 if x=="" else x)']
['Wrong Answer', 'Accepted']
['s362132784', 's230186365']
[2940.0, 2940.0]
[18.0, 18.0]
[88, 87]
p03286
u598812605
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n = int(input())\nif n == 0:\n print("0")\n exit()\nans = ""\nwhile n != 0:\n if n % (2) == 0:\n n = n // (-2)\n ans = ans + "0"\n else:\n n = (n - 1) // (-2)\n ans = ans + "1"\nprint(ans)', 'n = int(input())\nif n == 0:\n print(0)\n exit()\nans = ""\nwhile n != 0:\n i...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s233257882', 's728798557', 's909416938', 's922206606']
[3060.0, 3060.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0, 20.0]
[216, 210, 217, 214]
p03286
u600402037
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['N = int(input())\nprint(bin(N)[2:])', 'N = int(input())\nprint(bin(N)[3:] if N != 0 else 0)', "# coding: utf-8\nimport sys\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\n\ndef F(x):\n if x == 0:\n return ''\n if x % 2 == 0:\n retur...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s435306774', 's535522890', 's775029715']
[3064.0, 2940.0, 3060.0]
[18.0, 18.0, 18.0]
[34, 51, 337]
p03286
u612721349
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\ndef solve():\n n = int(input())\n ans, m = "", 1\n while n != 0:\n m *= (-2)\n if abs(n) % abs(m) > 0:\n ans += "1"\n n -= m // (-2)\n else:\n ans += "0"\n print(ans if ans else 0)\n\nif __name__=="__ma...
['Wrong Answer', 'Accepted']
['s888996550', 's906981281']
[3060.0, 3060.0]
[17.0, 17.0]
[321, 327]
p03286
u616217092
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["from sys import stdin\nstdin = open('sample.txt')\n\n\ndef main():\n N = int(stdin.readline().rstrip())\n\n if N == 0:\n print('0')\n return\n\n ans = ''\n base = 2\n while N != 1:\n ans = str(abs(N % base)) + ans\n N = N // base\n N = -1 * N\n print('1' + ans)\n\n...
['Runtime Error', 'Accepted']
['s275447274', 's780275080']
[3060.0, 3060.0]
[17.0, 17.0]
[338, 311]
p03286
u617037231
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["N = int(input())\ns = ''\ns2 = ''\nwhile N != 0:\n if N % 2 == 0:\n s += '0'\n N //= (-2)\n if N % 2 == -1 or N % 2 == 1:\n s += '1'\n N //= (-2)\n N += 1\ns2 = s[::1]\nprint(s2)\n \n \n ", "import sys\nN = int(input())\ns = ''\ns2 = ''\nif N == 0:\n print(0)\n sys.exit(0)\nwhile N != 0:\n...
['Wrong Answer', 'Accepted']
['s259220708', 's761748268']
[2940.0, 3060.0]
[17.0, 17.0]
[198, 232]
p03286
u617203831
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n=int(input())\nx=""\nwhile n!=0:\n x=str(n%2)+x\n s=-(n//2)\nprint(0 if x=="" else x)', 'n=int(input())\nx=""\nwhile n!=0:\n x=str(n%2)+x\n n=-(n//2)\nprint(0 if x=="" else x)']
['Time Limit Exceeded', 'Accepted']
['s076644795', 's812971757']
[3672.0, 2940.0]
[2104.0, 17.0]
[87, 87]
p03286
u620846115
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['N = input()\na = ""\nif N ==0:\n a =0\nwhile N !=0:\n if N%2 != 0:\n a = "1" + a\n else:\n a = "0" + a\n N = - (N//2)\nprint(a)', 'N = int(input())\na = ""\nif N ==0:\n a =0\nwhile N !=0:\n if N%2 != 0:\n a = "1" + a\n else:\n a = "0" + a\n N = - (N//2)\nprint(a)']
['Runtime Error', 'Accepted']
['s955141747', 's249635458']
[8988.0, 9184.0]
[23.0, 30.0]
[127, 132]
p03286
u623687794
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n=int(input())\nans=""\ni=1\nwhile True:\n if n==0:break\n else:\n if n%(2**i)==0:ans="0"+ans;n-=2**i;i+=1\n else:ans="1"+ans;n-=2**i;i+=1\nprint(ans)', 'n=int(input())\nans=""\ni=1\nwhile True:\n if n==0:break\n else:\n if n%(2**i)==0:ans="0"+ans;i+=1\n else:ans="1"+ans;n-=(-2)**(i-1);i+=1\nprint(ans...
['Wrong Answer', 'Accepted']
['s984148694', 's134074541']
[3060.0, 2940.0]
[2104.0, 17.0]
[150, 168]
p03286
u627691992
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["n = int(input())\n\ns = ''\nwhile(n != 0):\n s = str(n % 2)+s\n n = -(n//2)\n print(s)\n", 'n = int(input())\n\ns = \'\'\nwhile(n != 0):\n s = str(n % 2)+s\n n = -(n//2)\nprint(0 if(s == "") else s)\n']
['Wrong Answer', 'Accepted']
['s097177505', 's819457524']
[9168.0, 9148.0]
[27.0, 29.0]
[90, 105]
p03286
u628262476
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["n = int(input())\nret = ''\nwhile n > 0:\n d, r = n / (-2), n % (-2)\n if r == -1: # (d+1) * (-2) + 1 = n\n r = 1\n d += 1\n ret += str(r)\n n = d\nif ret == '':\n ret = '0'\nelse:\n ret = ret[::-1]\nprint(ret)\n ", "n = int(input())\nret = ''\nwhile n != 0:\n d, r = n // (-2), n % (-2)\n if r == -1: #...
['Wrong Answer', 'Accepted']
['s529895732', 's494148262']
[2940.0, 2940.0]
[19.0, 17.0]
[212, 214]
p03286
u631914718
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["input()\nprint('11000101011001101110100010101')", 'def determine_digit(digit_num, acm, n):\n mod = 2 ** (digit_num + 1)\n if (n - acm) % mod:\n return 1\n else:\n return 0\n\n\ndef convert(n):\n if n == 0:\n return \'0\'\n\n result = \'\'\n acm = 0\n digit_num = 0\n # prin...
['Wrong Answer', 'Accepted']
['s799682767', 's181658629']
[2940.0, 3064.0]
[17.0, 17.0]
[46, 606]
p03286
u652081898
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
['n = int(input())\n\nif N == 0:\n print(0)\n exit()\n\ns = ""\nwhile n != 0:\n s += str(n%2)\n n = (n-n%2)//(-2)\n\nprint(s[::-1])', 'n = int(input())\n\nif n == 0:\n print(0)\n exit()\n\ns = ""\nwhile n != 0:\n s += str(n%2)\n n = (n-n%2)//(-2)\n\nprint(s[::-1])\n']
['Runtime Error', 'Accepted']
['s585550889', 's288125584']
[3060.0, 2940.0]
[17.0, 17.0]
[130, 131]
p03286
u652656291
2,000
1,048,576
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 of `0` and `1`. * Unless S = `0`, the initial character of S is `1`. * Let S = S_k S_{k-1} ... S_0, then S_0 \times (-2)^0 + S_1 \times (-2)^1 + ....
["n = int(input())\nx = ''\nwhile n != 0:\n x += str(n%2)\n n = -(n//2)\n \nif x == '':\n print(0)\nelse:\n print(x)\n", 'n=int(input())\nx=""\nWhile n != 0:\n x = str(n%2) + x\n n = -(n//2)\nprint(0 if x == "" else x)\n', "n = int(input())\nx = ''\nWhile n != 0:\n x += str(n%2)\n n = -(n//2)\n \nif x == ...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s091981563', 's235933379', 's960371868', 's075654456']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 18.0, 17.0, 18.0]
[111, 98, 110, 98]