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 | u652895610 | 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(sys.stdin.readline())\n\ndef div(a):\n return -(a // 2), a % 2\n\n\nres = []\nwhile N < 0 or 2 <= N:\n N, a = div(N)\n print(N, a)\n res.append(a)\nres.append(N)\n\nprint(''.join(map(str, reversed(res))))\n", "import sys\nN = int(sys.stdin.readline())\n\ndef div(a):\n return -(a // ... | ['Wrong Answer', 'Accepted'] | ['s870004407', 's514284379'] | [3060.0, 3060.0] | [17.0, 17.0] | [223, 207] |
p03286 | u653807637 | 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 main():\n\tn = int(input())\n\tans = ""\n\n\ti = 0\n\twhile n != 0:\n\t\tprint(n)\n\t\tif n % (2 ** (i + 1)) != 0:\n\t\t\tans += "1"\n\t\t\tn -= (-2) ** i\n\t\telse:\n\t\t\tans += "0"\n\n\t\ti += 1\n\n\tif n == 0:\n\t\tprint(0)\n\telse:\n\t\tprint(ans[::-1])\n\nif __name__ == \'__main__\':\n\tmain(... | ['Wrong Answer', 'Accepted'] | ['s953781664', 's962682095'] | [3060.0, 3060.0] | [17.0, 17.0] | [266, 259] |
p03286 | u656643475 | 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 + .... | ["# C\nN = int(input())\n\ndata = N\nre = ''\n\nwhile True:\n print(data)\n if data == 1:\n re = '1' + re\n break\n elif data == -1:\n re = '11' + re\n break\n elif data % -2 != 0:\n data += data // abs(data) \n re = '1' + re\n else:\n if data // -2 != 0:\... | ['Wrong Answer', 'Accepted'] | ['s876241236', 's169957315'] | [3060.0, 3060.0] | [17.0, 17.0] | [412, 361] |
p03286 | u658993896 | 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\nt = 0\nans = ''\nwhile N != 0:\n a = N%2\n if t % 2 == 0:\n ans = str(int(a)) + ans\n N -= a\n N /= 2\n else:\n ans = str(int(a)) + ans\n N += a\n N /= 2\n t +=1\n print(N)\nif ans == '':\n ans = '0'\nprint(ans)", "N = int(input())\n\nt =... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s037160085', 's957550551', 's252044268'] | [3188.0, 3064.0, 3060.0] | [17.0, 17.0, 17.0] | [273, 273, 260] |
p03286 | u665038048 | 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 = int(input())\nx = ''\nwhile n != 0:\n x = str(n % 2) + x\n n -= (n//2)\nprint(0 if x == '' else x)", "n = int(input())\nans = []\ncnt = 0\nwhile n != 0:\n ans.append(str(n % 2))\n n -= (n//2... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s081797170', 's555616940', 's802670529', 's405242101'] | [3672.0, 3672.0, 356248.0, 2940.0] | [2104.0, 2104.0, 2131.0, 17.0] | [103, 103, 110, 103] |
p03286 | u666198201 | 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 + .... | ["\nflaga=True\nS='1'\nN=int(input())\nD=N\nflag=0\np=1\nK=0\nif N==0:\n print(0)\n exit(0)\nelif N==1:\n print(1)\n exit(0)\nelif N>0:\n D-=1\n while flag==0:\n if D+1-p>0:\n D-=p\n p*=4\n K+=2\n else:\n print(D)\n for i in range(K)... | ['Wrong Answer', 'Accepted'] | ['s293276001', 's182764917'] | [3064.0, 3188.0] | [17.0, 17.0] | [1375, 1416] |
p03286 | u667024514 | 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:key = 1\nif n < 0:key = 0\nlis = []\nwhile abs(n) >= 1:\n if n % 2 == 1:\n n -= 1\n lis.insert(0,"1")\n else:\n lis.insert(0,"0")\n n = n // (-2)\nif n == 0:\n lis.append("0")\nprint("".join(lis))', 'n = int(input())\nif n > 0:key = 1\nif n < 0:key = 0\nlis = []\nif n == 0:\n ... | ['Wrong Answer', 'Accepted'] | ['s826687580', 's235013626'] | [3064.0, 3060.0] | [19.0, 17.0] | [223, 226] |
p03286 | u667458133 | 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())\nresult = '1'\n\nif N > 0:\n s = 1\n e = 1\n r = 4\n degit = 0\n \n while True:\n if N <= e:\n for i in range(degit):\n if i % 2 == 0:\n if N <= (s+e)//2:\n result += '1'\n e = (s+e)//2... | ['Wrong Answer', 'Accepted'] | ['s427006787', 's462029705'] | [3192.0, 2940.0] | [24.0, 18.0] | [1562, 247] |
p03286 | u668503853 | 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 B10n(X, n):\n if (int(X/n)):\n return B10n(int(X/n), n)+str(X%n)\n return str(X%n)\nans=B10n(N,-2)\nprint(ans.replace("-",""))', 'N=int(input())\nS=""\nif N==0:\n print(0)\n exit(0) \nwhile N!=0:\n r=N%(-2)\n N=N//(-2)\n if r<0:\n r+=2\n N+=1\n S+=str(r)\nprint(S[::-1])\n'] | ['Wrong Answer', 'Accepted'] | ['s114852266', 's844882303'] | [3060.0, 3064.0] | [17.0, 17.0] | [145, 144] |
p03286 | u672213161 | 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())\nsum=0\ns=''\n'''if a<0:\n b = abs(a)\n if b%2==1:\n b=b+1\n print(str(bin(b))[2:-1]+'1')\n else:\n print(str(bin(b))[2:-1])''\nif a!=0:\n while(a!=1):\n if a%(-2)==-1:\n s=s+'1'\n a=a-1\n a=a/-2\n else:\n s = s ... | ['Runtime Error', 'Accepted'] | ['s359652440', 's660650331'] | [2940.0, 3060.0] | [17.0, 17.0] | [433, 297] |
p03286 | u672475305 | 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 r = n % 2\n if r<0:\n r += 2\n n = (n-r) // (-2)\n s += str(r)\nans = s[::-1]\nif n==0:\n print(0)\nelse:\n print(ans)", "n = int(input())\ns = ''\nif n==0:\n print(0)\n exit()\nwhile(n!=0):\n r = n % 2\n if r<0:\n r += 2\n n = (n-r) ... | ['Wrong Answer', 'Accepted'] | ['s690690393', 's211658744'] | [3060.0, 3060.0] | [17.0, 17.0] | [172, 169] |
p03286 | u673338219 | 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 = []\nwhile n > 0:\n if n%2 ==0:\n n = n/(-2)\n a.append("0")\n else:\n n = (n-1)(-2)\n a.append("1")\n \nb = ""\nfor i in range(len(a)):\n b += a[len(a)-i-1]\n \nprint(b)\n \n ', 'n = int(input())\na = []\nif n ==0:\n print(0)\nelse:\n while n != 0:\n if n%2 ==0:\n n = ... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s032505424', 's380788615', 's420368767', 's006606085'] | [3188.0, 2940.0, 3060.0, 3060.0] | [18.0, 17.0, 17.0, 17.0] | [202, 232, 204, 252] |
p03286 | u677440371 | 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 if N %2 != 0:\n S = "1" + S\n N -= 1\n else:\n S = "0" + S\n N /= -2\nif N == 0:\n print("0")\nelse:\n print(S)', "n = int(input())\n\ns = ''\nflag = True\nwhile flag:\n if n % 2 != 0:\n s = '1' + s\n n -= 1\n else:\n ... | ['Wrong Answer', 'Accepted'] | ['s596937199', 's943400025'] | [2940.0, 2940.0] | [18.0, 17.0] | [178, 189] |
p03286 | u680851063 | 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\nl = [(-2)**_ for _ in range(100) if abs((-2)**_) <= 10**10]\n\nif n > 0:\n x = [1]\n for i in range(len(l)):\n if abs(l[i]) < abs(n):\n x.append(l[i+1])\n\nelif n < 0:\n x = []\n for j in range(len(l)):\n if abs(l[j]) < abs... | ['Runtime Error', 'Accepted'] | ['s310914553', 's404430051'] | [1663108.0, 3064.0] | [2217.0, 18.0] | [648, 347] |
p03286 | u686036872 | 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 + .... | ['S=str(bin(abs(int(input()))))\nprint(S[2:])', 's=int(input())\ns=0\nx=s\nlist=[]\nfor i in range(1000000000000000000):\n y=x%(-2)\n if y == -1:\n x = (x-1)//(-2)\n y = 1\n else:\n x=x//(-2)\n list.insert(0, y)\n if x == 0:\n print(*list, sep="")\n break', 'S=str(bin(i... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s416973706', 's650211357', 's829711099', 's415452600'] | [2940.0, 3060.0, 2940.0, 3060.0] | [17.0, 17.0, 17.0, 17.0] | [42, 242, 78, 238] |
p03286 | u687044304 | 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 math\n\ndef solve(N):\n bin_str = bin(N)\n if bin_str[0] == "-":\n bin_str = bin_str[3:]\n else:\n bin_str = bin_str[2:]\n\n print(bin_str)\n exit()\n j = 0\n for k in range(len(bin_str)-1, -1, -1):\n ans = bin_str[i] * j\n\ndef solve2(N):\n ... | ['Wrong Answer', 'Accepted'] | ['s909087007', 's590772893'] | [3188.0, 3064.0] | [19.0, 17.0] | [726, 2057] |
p03286 | u692632484 | 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())\nres=""\nwhile N!=0:\n\tif N%2==0:\n\t\tres+="0"\n\telse:\n\t\tN-=1\n\t\tres+="1"\n\tprint(N)\n\tN//=-2\nif len(res)==0:\n\tres="0"\nprint(res[::-1])\n', 'N=int(input())\nres=""\nwhile N!=0:\n\tif N%2==0:\n\t\tres+="0"\n\telse:\n\t\tN-=1\n\t\tres+="1"\n\t#print(N)\n\tN//=-2\nif len(res)==0:\n\tres="0"\... | ['Wrong Answer', 'Accepted'] | ['s954245502', 's050103532'] | [3064.0, 2940.0] | [17.0, 17.0] | [142, 143] |
p03286 | u695811449 | 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 + .... | ['x=int(input())\n\nLIST2=[1]\nLIST2X=[-2]\n\nN=1\nfor i in range(1,30):\n N=N+4**i\n LIST2.append(N)\nN=-2\nfor i in range(1,30):\n N=N-2*4**i\n LIST2X.append(N)\n\n\n\nLIST=[0]*60\n\ndef nex(N):\n if N>0:\n for i in range(30):\n if N<=LIST2[i]:\n break\n LIST[i*2... | ['Wrong Answer', 'Accepted'] | ['s157646743', 's346885265'] | [3064.0, 2940.0] | [17.0, 17.0] | [649, 141] |
p03286 | u698771758 | 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=""\nwhile n:\n a+=str(n%2)\n n//=-2\nprint(a[::-1] if n else 0)', 'n=-int(input())\na=""\nwhile n:\n a+=str(n%2)\n n//=-2\nprint(a[::-1] if a else 0)'] | ['Wrong Answer', 'Accepted'] | ['s144180904', 's114490822'] | [2940.0, 2940.0] | [17.0, 17.0] | [83, 83] |
p03286 | u709304134 | 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 exit()\n\ni=0\ns=''\nwhile(n!=0):\n if n%(2**(i+1))!=0:\n s+='1'\n n-=(-2)**i\n else:\n s+='0'\n i+=1\nprint (s[::-1])\n", "#coding:utf-8\nn = int(input())\n\nif n==0:\n print ('0')\n exit()\n\ni=0\ns=''\nwhile(n!=0):... | ['Runtime Error', 'Accepted'] | ['s763225635', 's758283334'] | [2940.0, 3060.0] | [17.0, 17.0] | [198, 199] |
p03286 | u721316601 | 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 = ''\n\nwhile N:\n if N % 2:\n N -= 1\n ans += '1'\n else:\n ans += '0'\n N //= -2\nif len(ans):\n print(ans)\nelse:\n print(0)", "N = int(input())\nans = ''\n\nwhile N:\n if N % 2:\n N -= 1\n ans += '1'\n else:\n ans += '0'\n N /... | ['Wrong Answer', 'Accepted'] | ['s713521154', 's747145495'] | [2940.0, 3060.0] | [17.0, 18.0] | [172, 178] |
p03286 | u722535636 | 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())\nabsn=abs(n)\nsign=[1,-1]\n\nb,cnt=1,0\nwhile b<absn*2:\n b*=2\n cnt+=1\nans=[]\nwhile cnt >= 0:\n sub=n-b*sign[cnt%2]\n if abs(sub)<abs(b) or abs(sub)<=abs(n):\n ans.append("1")\n n=sub\n else:\n ans.append("0")\n b//=2\n cnt-=1\nfor i in range(3):\n if ans... | ['Runtime Error', 'Accepted'] | ['s940327062', 's688410221'] | [3064.0, 3060.0] | [18.0, 17.0] | [340, 188] |
p03286 | u723792785 | 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())\nansl = []\nif n == 0:\n\tprint(0)\n exit()\nwhile n != 0:\n\tif n % 2 == 1:\n\t\tansl.append("1")\n\t\tn -= 1\n\telse:\n\t\tansl.append("0")\n\tn //= -2\nprint("".join(ansl)[::-1])', 'n = int(input())\nansl = []\nif n == 0:\n\tprint(0)\n\texit()\nwhile n != 0:\n\tif n % 2 == 1:\n\t\tansl.append("... | ['Runtime Error', 'Accepted'] | ['s009607490', 's617540017'] | [2940.0, 3060.0] | [17.0, 17.0] | [179, 176] |
p03286 | u729133443 | 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 s=str(n%2)+s\n n=-(n//2)\nprint(s*(if s)else 0)", "n=int(input())\ns=''\nwhile n!=0:\n s=str(n%2)+s\n n=-(n//2)\nprint(s*(s!='')else 0)", 'm=2**33//3;print(bin(int(input())+m^m)[2:])'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s020451144', 's378990049', 's618156320'] | [2940.0, 2940.0, 3064.0] | [17.0, 17.0, 17.0] | [80, 81, 43] |
p03286 | u729939940 | 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 = []\nif N == 0:\n a = ["0"]\nwhile N != 0:\n a.append(str(N % 2))\n N = -(N - N % 2) \nprint("".join(list(reversed(a))))', 'N = int(input())\na = []\nif N == 0:\n a = ["0"]\nwhile N != 0:\n a.append(str(N % 2))\n # N = -(N - N % 2) \nprint("".join(list(reversed(a))))', 'N = int(... | ['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted'] | ['s032355372', 's551264501', 's124406051'] | [300440.0, 443544.0, 2940.0] | [2123.0, 2131.0, 17.0] | [143, 145, 131] |
p03286 | u735008991 | 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 S = chr(N % (-2)) + S\n N /= (-2)\nprint(S)\n ', 'N = int(input())\nS = ""\nwhile N != 0:\n if N % 2 != 0:\n N -= 1\n S = "0" + S\n else:\n S = "1" + S\n N //= (-2)\nprint(S if S != "" else "0")\n', 'N = int(input())\nS = ""\nwhile N != 0:\... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s047537684', 's868217982', 's187423630'] | [3060.0, 2940.0, 2940.0] | [18.0, 17.0, 18.0] | [88, 166, 166] |
p03286 | u738835924 | 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 = "0"\nwhile(abs(N) > 1):\n S.append(str(abs(-N % (-2))))\n N += N % (-2)\n N = N // (-2)\n \nS.append(str(abs(N)))\nS.append("1")\nS.reverse()\n\nif S == []:\n print(ans)\nelse:\n ans = ""\n for i in S:\n ans += i\n \n print(ans)\n \n ', 'N = int(input())\nS = []\nans ... | ['Wrong Answer', 'Accepted'] | ['s844086815', 's056777967'] | [3060.0, 3060.0] | [18.0, 20.0] | [263, 226] |
p03286 | u740284863 | 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\ninput = sys.stdin.readline\nN, M = map(int, input().split(" "))\nA = [int(i) for i in input().split()]\ncount = 0\nfor i in range(N):\n for k in range(i,N):\n S = sum(A[i:k+1])\n if S % M ==0:\n count = count +1\n \nprint(count)\n', "n=int(input())\ns=''\nwhile n != 0:\n s =... | ['Runtime Error', 'Accepted'] | ['s436262658', 's172188112'] | [3060.0, 3064.0] | [18.0, 17.0] | [258, 104] |
p03286 | u741397536 | 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\nplus = []\nminus = []\nplus_sum = []\nminus_sum = []\n\ns_p = 0\ns_m = 0\nfor i in range(31):\n if i % 2 == 0:\n plus.append(2**i)\n s_p += 2**i\n plus_sum.append(s_p)\n else:\n minus.append(2**i)\n s_m += 2**i\n minus_sum.append(s_m)\n\ndef ten_four... | ['Wrong Answer', 'Accepted'] | ['s602526060', 's383663756'] | [3188.0, 3188.0] | [19.0, 19.0] | [1582, 1569] |
p03286 | u745087332 | 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\n\nn = input()\n\nif n == 0:\n print(0)\n exit()\n\nans = ''\nwhile abs(n) > 0:\n if n % 2 != 0:\n ans += '1'\n n -= 1\n n //= -2\n else:\n ans += '0'\n n //= -2\n\nprint(ans[::-1])", "# coding:utf-8\n\nn = int(input())\n\nif n == 0:\n print(0)\n exi... | ['Runtime Error', 'Accepted'] | ['s524814621', 's584447413'] | [3060.0, 3064.0] | [18.0, 20.0] | [225, 230] |
p03286 | u746849814 | 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\na = []\nwhile n != 0:\n if n%2 == 0:\n a.append(0)\n else:\n a.append(1)\n n -= 1\n n//=(-2)\n \nif n == 0:\n print(0)\nelse:\n print(''.join(map(str, a[::-1])))", "n = int(input())\n\nif n == 0:\n print(0)\n \nelse:\n a = []\n while n != 0:\n ... | ['Wrong Answer', 'Accepted'] | ['s551887056', 's271415297'] | [3060.0, 3060.0] | [17.0, 18.0] | [206, 243] |
p03286 | u757274384 | 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())\nif n == 0:\n print(0)\n exit()\nelse:\n pass\n\nm = math.floor(math.log2(abs(n)))\nans = []\nfor i in range(m+2):\n ans.append(n//((-2)**(m+1-i)))\n\nwhile True:\n if ans[0] == 0:\n ans = ans[1:len(ans)]\n else:\n break\n\nANS = [str(ans[i]) for i in range(len(ans))]\nprint(... | ['Runtime Error', 'Accepted'] | ['s344881557', 's202326136'] | [3188.0, 3060.0] | [18.0, 17.0] | [316, 224] |
p03286 | u767871438 | 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 n-=1\n ans = "1"+ans\n n//=-2 \n\nif n==0:\n print("0")\nelse\n print(ans)', 'n = int(input())\nans=""\nwhile n!=0:\n if n%2==0:\n ans = "0"+ans\n else:\n n-=1\n ans = "1"+ans\n n//=-2 \n\nif ans=="":\n print("0")... | ['Runtime Error', 'Accepted'] | ['s434958475', 's901945695'] | [2940.0, 2940.0] | [17.0, 17.0] | [152, 158] |
p03286 | u769698512 | 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())\nbin_n = bin(n)\nranges = []\n\ndef base_minus2(m, i, s):\n tmp = s\n if i == 1:\n return tmp + str(m%2)\n for j in range(i-1, -1, -1):\n if m >= ranges[j-1][0] and m <= ranges[j-1][1]:\n print(ranges[j-1], j)\n tmp += "1"\n print(tmp)\n ... | ['Runtime Error', 'Accepted'] | ['s515804432', 's269901466'] | [3064.0, 3064.0] | [19.0, 19.0] | [707, 735] |
p03286 | u770077083 | 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(0)\n\noddsum = [2, 10, 42, 170, 682, 2730, 10922, 43690, 174762, 699050, 2796202, 11184810, 44739242, 178956970, 715827882, 2863311530]\nevensum = [1, 5, 21, 85, 341, 1365, 5461, 21845, 87381, 349525, 1398101, 5592405, 22369621, 89478485, 357913941, 1431655765]\ntw... | ['Wrong Answer', 'Accepted'] | ['s693891699', 's843023590'] | [3064.0, 3192.0] | [18.0, 20.0] | [925, 929] |
p03286 | u782930273 | 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())\nif N == 0:\n print(0)\n exit()\n\nbits = []\nfor keta in range(int(math.log2(abs(N))) + 1)[::-1]:\n print(N, keta)\n if abs(N - (-2)**keta) <= abs(N):\n bits.append("1")\n N -= (-2)**keta\n else:\n bits.append("0")\n\n\nprint("".join(bits))', 'impor... | ['Wrong Answer', 'Accepted'] | ['s695133819', 's062458057'] | [3064.0, 3316.0] | [17.0, 21.0] | [292, 286] |
p03286 | u787562674 | 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 = ""\n\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 if ans == "":\n ans = "0"\n\nprint(ans) ', 'N = int(input())\nans = ""\n\nwhile N != 0:\n if N % 2 != 0:\n N -= 1\n ans = "1" + ans... | ['Wrong Answer', 'Accepted'] | ['s614592483', 's947387867'] | [2940.0, 3060.0] | [17.0, 20.0] | [197, 185] |
p03286 | u788137651 | 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\nans = []\nwhile N != 0:\n if N % (-2 ** i) == 0:\n ans.append(0)\n else:\n ans.append(1)\n N -= ((-2)**(i-1))\n i += 1\nprint("".join(map(str, ans)))', 'N = int(input())\ni = 1\nans = [0 for i in range(1) if N == 0]\nwhile N != 0:\n if N % (-2 ** i) == 0:\n ... | ['Wrong Answer', 'Accepted'] | ['s518129204', 's842829013'] | [3060.0, 3060.0] | [18.0, 20.0] | [194, 774] |
p03286 | u801512570 | 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%2==0:\n ans='0'\nelse:\n ans='1'\n \ni=2\nwhile abs(tmp)<=abs(N):\n if N%((-2)**i)==0:\n ans='0'+ans\n else:\n ans='1'+ans\n \nprint(ans)", "N=int(input())\n\nif N%2==0:\n ans='0'\nelse:\n ans='1'\n N-=1\n \ni=2\nwhile abs(N)>0:\n if N%((-2)**i)==0:\n ans='0'+ans\n else:\... | ['Runtime Error', 'Accepted'] | ['s271689277', 's937873130'] | [3064.0, 3060.0] | [19.0, 18.0] | [160, 185] |
p03286 | u807772568 | 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 = ""\n\nwhile n != 0:\n\ts = str(n%2) + s\n\ts = -(s//2)\n\nprint(s if s != "" else 0)', 'n = int(input())\n\ns = ""\n\nwhile n != 0:\n\ts = str(n%2) + s\n\tn = -(n//2)\n\nprint(s if s != "" else 0)'] | ['Runtime Error', 'Accepted'] | ['s459666178', 's089224313'] | [2940.0, 2940.0] | [18.0, 17.0] | [98, 98] |
p03286 | u845152373 | 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\nfrom collections import deque\n\nsys.setrecursionlimit(10 ** 6)\n\n\ndef input(): return sys.stdin.readline().rstrip()\n\n\nN = int(input())\nl = deque()\nwhile N != 0:\n x = (-2) ** len(l)\n y = (-2) * x\n if abs(N) % abs(y) != 0:\n N -= x\n l.appendleft('1')\n else:\n l.... | ['Wrong Answer', 'Accepted'] | ['s621493979', 's536968210'] | [3316.0, 3316.0] | [21.0, 21.0] | [350, 399] |
p03286 | u853185302 | 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 print("-n//2 : {}, -(n//2) : {}".format(-n//2,-(n//2)))\n n = -(n//2)\nprint(0 if x=="" else x)\n\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'] | ['Wrong Answer', 'Accepted'] | ['s005178542', 's902390074'] | [2940.0, 2940.0] | [18.0, 17.0] | [151, 93] |
p03286 | u853900545 | 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=''\nwhile a:\n b=str(a&1)+b\n a= a>>1\nprint(b if b else 0)\n", "a=int(input())\nb=''\nwhile a:\n b=str(a&1)+b\n a=-(a<<1)\nprint(b if b else 0)\n", "a=int(input())\nb=''\nwhile a:\n b=str(a&1)+b\n a= (a>>1)\nprint(b if b else 0)", "a=int(input())\nb=''\nwhile a:\n b=str(a&1)+b\n a=-(a>>1)\nprint(b ... | ['Wrong Answer', 'Time Limit Exceeded', 'Wrong Answer', 'Accepted'] | ['s255212535', 's437499668', 's987305737', 's474828653'] | [3660.0, 3456.0, 3672.0, 2940.0] | [2104.0, 2108.0, 2104.0, 18.0] | [73, 75, 74, 75] |
p03286 | u853952087 | 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=[]\nif n==0:\n print('0')\nelse: \n while n!=0:\n if n>0 and n%2==0:\n n=-n//2\n L.append('0')\n elif n>0 and n%2==1:\n n=(-n+1)//2\n L.append('1')\n elif n<0 and -n%2==0:\n n=-n//2\n L.append('0')\n ... | ['Wrong Answer', 'Accepted'] | ['s192276350', 's471204050'] | [3064.0, 3064.0] | [20.0, 17.0] | [440, 578] |
p03286 | u854144714 | 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=""\nfor i in range(50):\n if N%(-2)==0:\n S=S+"0"\n else:\n S=S+"1"\n N-=1\n N=N//(-2)\nprint(int(S))', '\nN=int(input())\nS=""\nfor i in range(50):\n if N%(-2)==0:\n S="0"+S\n else:\n S="1"+S\n N-=1\n N=N//(-2)\nprint(int(S))'] | ['Wrong Answer', 'Accepted'] | ['s836166913', 's454593046'] | [3064.0, 2940.0] | [17.0, 17.0] | [140, 141] |
p03286 | u856232850 | 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 = ''\na = 2\nwhile True:\n\tif n == 0:\n\t\tbreak\n\tif n % a == 0:\n\t\tans += '0'\n\telse:\n\t\tans += '1'\n\t\tn -= (a//2)\n\n\tn = n//2\n\tif a == 2:\n\t\ta = -2\n\telse:\n\t\ta = 2\n\n\nans = ans[::-1]\nif n == 0:\n\tprint(0)\nelse:\n\tprint(ans)", "n = int(input())\nnn = n\nans = ''\na = 2... | ['Wrong Answer', 'Accepted'] | ['s900529689', 's389762144'] | [3064.0, 3064.0] | [18.0, 18.0] | [230, 238] |
p03286 | u858136677 | 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 + .... | ['invtwos = [1]\ni = 0\nwhile abs(invtwos[i]) <= 10**10:\n invtwos.append(invtwos[i]*(-2))\n i += 1\ninvtwos.append(invtwos[-1]*(-2))\n\nn = int(input())\nans = []\ni = 0\nwhile n != 0:\n if n%abs(invtwos[i+1]) != 0:\n ans.append(1)\n n -= invtwos[i]\n else:\n ans.append(0)\n i += 1\... | ['Wrong Answer', 'Accepted'] | ['s665743559', 's370330358'] | [3064.0, 3064.0] | [17.0, 17.0] | [478, 486] |
p03286 | u858670323 | 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 = list()\nif N==0:\n print(0)\n exit()\nelif N>0:\n while N>0:\n S.append(N%2)\n N//=2\n S.append(0)\n S.append(0)\n for i in range(len(S)-1):\n if i%2==1 and S[i]==1:\n S[i+1] += 1\n if S[i]==2:\n S[i]=0\n S[i+1]+=1\nelse:\n N *= -1\n while N>0:\n S.append(N%... | ['Wrong Answer', 'Accepted'] | ['s806192627', 's363601999'] | [9100.0, 9276.0] | [32.0, 30.0] | [544, 547] |
p03286 | u859897687 | 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=abs(int(input()))\nm=n\ni=0\nnn=0\nwhile m//2>0:\n nn+=m%2*(2**i)\n i+=1\n m//=2\nn+=nn\na=[]\nwhile n//2>2:\n a.append(n%2)\n n//=2\nans=""\nfor i in range(len(a)-1,-1,-1):\n ans+=str(a[i])\nprint(ans)', 'n=abs(int(input()))\nm=n\ni=0\nnn=0\nwhile m//2>0:\n nn+=m%2*(2**(i+1))\n i+=1\n m//=2\nn+=nn\na=[]\n... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s315744188', 's604547316', 's630874831', 's927470761', 's966313826', 's801900443'] | [3064.0, 3064.0, 3060.0, 3060.0, 3064.0, 2940.0] | [17.0, 18.0, 2104.0, 2104.0, 18.0, 19.0] | [194, 198, 98, 102, 213, 105] |
p03286 | u860002137 | 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 % 2 == 1:\n ans += "1"\n n = n - 1\n n //= -2\n else:\n ans += "0"\n n //= -2\n\nprint(ans[::-1] if n != 0 else 0)', 'n = int(input())\nN = n\n\nans = ""\n\nwhile n != 0:\n if n % 2 == 1:\n ans += "1"\n n = ... | ['Wrong Answer', 'Accepted'] | ['s619071857', 's438205003'] | [9048.0, 9108.0] | [31.0, 24.0] | [195, 201] |
p03286 | u879870653 | 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) == 0 :\n S = "0"+S\n else :\n S = "1"+S\n N -= 1\n N = N / 2\nif len(S) != 0 :\n print(S)\nelse :\n print(0)\n\n', 'N = int(input())\nS = ""\nwhile N != 0 :\n if N % (-2) != 0 :\n S = "1" + S\n N -= 1\n else... | ['Wrong Answer', 'Accepted'] | ['s144146448', 's650064672'] | [3672.0, 3064.0] | [2104.0, 18.0] | [189, 201] |
p03286 | u887207211 | 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"\n else:\n ans += "1"\n N -= 1\n N //= -2\nif(bit == ""):\n ans = ""\nprint(ans[::-1]) ', 'N = int(input())\nans = ""\nwhile N:\n if(N%2 == 0):\n ans += "0"\n else:\n ans += "1"\n N -= 1\n N //= -2\nif(ans == ""):\n ans = "... | ['Runtime Error', 'Accepted'] | ['s422763157', 's776434929'] | [2940.0, 2940.0] | [18.0, 18.0] | [160, 152] |
p03286 | u892340697 | 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 + .... | ['\nans = ""\nif N == 1:\n print("1")\nelif N == -1:\n print("10")\nelse:\n while True:\n r = N % 2\n N = (N-r) /-2\n ans = str(int(r)) + ans\n if N == 0 or N == 1:\n ans = str(int(N)) + ans\n break\n\n print(ans)', 'import math\nN = int(input())\n\nans = ""... | ['Runtime Error', 'Accepted'] | ['s561835110', 's039954446'] | [9032.0, 9072.0] | [26.0, 27.0] | [258, 318] |
p03286 | u911507660 | 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\nidx = 0\nwhile True:\n idx += 1\n left = sum([(-2)**i for i in range(idx+1) if i%2==1])\n right = sum([(-2)**i for i in range(idx+1) if i%2==0])\n if left <= N <= right:\n break\n \nmax_idx = idx\ncoeff = [0 for _ in range(max_id... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s059603229', 's175352370', 's113095222'] | [3064.0, 3064.0, 3064.0] | [18.0, 18.0, 18.0] | [643, 709, 711] |
p03286 | u918601425 | 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 ls=[]\n while(n!=0):\n ls.append(n%2)\n n=-1*(n-n%2)//2\nls.sort(reverse:True)\nprint(ls)\n \n \n ", 'N=int(input())\nls=[]\nwhile True:\n ls.append(N%2)\n N=-(N//2)\n if N==0:\n break\nprint(*reversed(ls),sep="")'] | ['Runtime Error', 'Accepted'] | ['s603073677', 's508348066'] | [3064.0, 2940.0] | [17.0, 17.0] | [149, 110] |
p03286 | u921773161 | 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 order2(x):\n if x > 0 :\n k = 0\n check = 0\n while check == 0 :\n s = 0\n for i in range(0, k+1, 2):\n s += (-2)**i\n ans = i\n if s >= x:\n check = 1\n k += 2\n elif x < 0 :\n k = 1\n check = 0\n while check == 0 :\n ... | ['Runtime Error', 'Accepted'] | ['s806333743', 's253032804'] | [3188.0, 3188.0] | [19.0, 19.0] | [1127, 1098] |
p03286 | u923662841 | 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)\nif x = "":\n print(0)\nelse:\n print(x)', 'n=int(input())\nx = ""\nwhile n!=0:\n x = str(n%2) + x\n n = -(n//2)\nif x == "":\n print(0)\nelse:\n print(x)\n'] | ['Runtime Error', 'Accepted'] | ['s826477905', 's032334304'] | [8956.0, 9068.0] | [29.0, 29.0] | [113, 115] |
p03286 | u924406834 | 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(30):\n if n == 0:\n break\n if n % 2 ** (i + 1) == 0: \n ans = ans + '0'\n else:\n n -= (-2)**i\n ans = ans + '1'\nprint(ans)", "n = int(input())\nans = ''\nfor i in range(30):\n if n == 0:\n break\n if n % 2 ** (i + 1) == 0:... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s008952914', 's392820302', 's669148306'] | [2940.0, 2940.0, 3060.0] | [17.0, 17.0, 17.0] | [195, 200, 267] |
p03286 | u932868243 | 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()\nif n==1:\n print(1)\n exit()\nans=[]\nwhile n!=1:\n r=n%(-2)\n ans.append(str(r))\n n=(n-r)//(-2)\nans.append(str(1))\nans.reverse()\nprint(''.join(ans))\n ", "n=int(input())\nans=''\nwhile n!1:\n r=n%(-2)\n ans+=r\n n=n//(-2)\nans+=n\nans.reverse()\nprint(... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s339032226', 's855400402', 's067732789'] | [338584.0, 2940.0, 3064.0] | [2125.0, 17.0, 18.0] | [199, 103, 196] |
p03286 | u934868410 | 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())\npow_m2 = [1]\nfor i in range(100):\n pow_m2.append(pow_m2[-1]*-2)\ndiv = 2\nk = 0\nbit_m2 = []\nwhile div < 2 * n:\n if (n % div - k) // (div / 2) == 1:\n bit_m2.append('1')\n else:\n bit_m2.append('0')\n k = n % div\n div *= 2\nprint(''.join(reversed(bit_m2)))", "n = int(input())\nif n =... | ['Wrong Answer', 'Accepted'] | ['s002879371', 's539382073'] | [3064.0, 3060.0] | [17.0, 18.0] | [276, 222] |
p03286 | u940102677 | 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 =""\nk = 0\nwhile n!=0:\n if n%(2**(k+1)) == 2**k:\n if k%2 == 0:\n n -= 2**k\n else:\n n += 2**k\n s += "1"\n else:\n s += "0"\n k += 1\n\nif s="":\n s="0"\n\nprint("".join(s))', 'n = int(input())\ns = ""\nk = 0\nwhile n!=0:\n if n%(2**(k+1)) == 2**k:\n if k%2 == 0:\... | ['Runtime Error', 'Accepted'] | ['s240908113', 's272551407'] | [2940.0, 3060.0] | [17.0, 17.0] | [206, 210] |
p03286 | u943657163 | 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 = ''\n\nif n == 0:\n print(0)\n exit()\n\ni = 0\nwhile n != 0:\n if n % (2 ** (i+1)) != 0:\n s += '1'\n n -= (-2) ** i\n else:\n s += '0'\n print(s)\n i += 1\nprint(s[::-1])", "n = int(input())\ns = ''\n \nif n == 0:\n print(0)\n exit()\n \ni = 0\nwhile... | ['Wrong Answer', 'Accepted'] | ['s600985261', 's013500557'] | [3060.0, 3060.0] | [17.0, 17.0] | [216, 205] |
p03286 | u946996108 | 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 + .... | ['mod = 10 ** 9 + 7\nmod2 = 2 ** 61 + 1\nfrom collections import deque\nimport heapq\nfrom bisect import bisect_left, insort_left, bisect_right\n\n_NUMINT_ALL = list(range(10))\n\n\ndef main():\n ans = solve()\n\n if ans in [True, False]:\n YesNo(ans)\n elif ans is not None:\n print(ans)\n\n\ndef... | ['Wrong Answer', 'Accepted'] | ['s490152046', 's863372896'] | [41588.0, 3444.0] | [2104.0, 22.0] | [5378, 5157] |
p03286 | u970899068 | 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 print(0)\n exit()\n \nfor i in range(100):\n if n==0:\n break\n if n%(2**(i+1))==0:\n ans.append('0')\n else:\n if i%2==0:\n n-=2**i\n else:\n n+=2**i\n ans.append('1')\n\nprint(''.join(map(str, ans)))", 'n=... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s019080878', 's869663163', 's208942754'] | [3060.0, 3060.0, 3064.0] | [18.0, 20.0, 17.0] | [294, 285, 307] |
p03286 | u977389981 | 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 = []\n\nwhile n != 0:\n if n % -2 == -1:\n n = n // -2 + 1\n ans.append('1')\n else:\n n = n // -2\n ans.append('0')\n \nans.reverse()\n\nif n == 0:\n print('0')\nelse:\n print(''.join(ans))", "n = int(input())\nbinary = []\nflag = 0\n\nif n == 0:\n ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s244335958', 's405623939', 's633440578', 's941446732'] | [3060.0, 3060.0, 3060.0, 3060.0] | [18.0, 17.0, 18.0, 18.0] | [239, 272, 283, 245] |
p03286 | u985170143 | 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 is_even(n):\n if n % 2 == 0:\n return True\n else:\n return False\n\ndef mainas_number():\n N = int(input())\n\n k =[]\n if N == 0:\n print(0)\n exit()\n\n if is_even(N):\n k.append(0)\n else:\n N -= 1\n k.append(1)\n\n for i in range(1,100)... | ['Wrong Answer', 'Accepted'] | ['s807353002', 's691529062'] | [3064.0, 3064.0] | [18.0, 20.0] | [533, 586] |
p03286 | u987164499 | 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\nn = int(stdin.readline().rstrip())\ndef num(n):\n if n%2 == 0:\n return num(n//(-2)) + "0"\n else:\n return num(n//(-2)) + "1"\n\nif n == 0:\n print(0)\n exit()\n\nprint(num(n))', 'n = int(input())\n\nif n == 0:\n print(0)\n exit()\n\ns = ""\n\nwhile True:\n i... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s542794157', 's625018748', 's850315239'] | [3864.0, 2940.0, 3060.0] | [73.0, 18.0, 17.0] | [214, 217, 223] |
p03286 | u989345508 | 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())\ns=""\n\ni=0\nwhile n!=0:\n #print(s)\n if abs(n)%2==0:\n s="0"+s\n n=n//2\n else:\n if i%2==0:\n n=(n-1)//2\n else:\n n=(n+1)//2\n s="1"+s\n i+=1\nif n!=0:\n print(s)\nelse:\n print(0)', '\n\nfrom itertools import dr... | ['Wrong Answer', 'Accepted'] | ['s711928558', 's898217264'] | [3064.0, 3316.0] | [17.0, 21.0] | [265, 681] |
p03286 | u993435350 | 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 + .... | ['Z = int(input())\nn = (-2)\n\nans = ""\n\nwhile abs(Z) >= 1:\n r = Z % n\n if r < 0:\n r = r + 2\n Z = int((Z - r) / n)\n ans += str(r)\n\nans = "".join(list(reversed(ans)))\n\nif Z == 0:\n print(0)\nelse:\n print(int(ans))', 'Z = int(input())\nn = (-2)\n\nans = ""\n\nwhile abs(Z) >= 1:\n r = Z % n\n if r ... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s237215639', 's384440465', 's878967191'] | [3060.0, 3060.0, 3060.0] | [17.0, 18.0, 18.0] | [215, 151, 236] |
p03287 | u046187684 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ["def solve(string):\n n, m, *a = map(int, string.split())\n for i in range(1, n):\n a[i] += a[i - 1]\n l = [0] * m\n print(a)\n for i in range(n):\n l[a[i] % m] += 1\n ans = l[0]\n for i in range(m):\n ans += l[i] * (l[i] - 1) // 2\n return str(ans)\n\n\nif __name__ == '__m... | ['Runtime Error', 'Accepted'] | ['s986806798', 's743063859'] | [876476.0, 24872.0] | [2147.0, 111.0] | [360, 423] |
p03287 | u062147869 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['N, M = list(map(int, input().split()))\nP=map(int, input().split()):\nAcnt = [0 for i in range(M)]\nsym = 0\n\nfor A in P:\n sym = (sym + A) % M\n Acnt[sym] += 1\n\nprint(int(Acnt[0] + sum([cnt * (cnt - 1) for cnt in Acnt]) / 2))\n\n', 'from collections import Counter\nfrom itertools import accumulate\nN,M=map(... | ['Runtime Error', 'Accepted'] | ['s873411476', 's270745093'] | [2940.0, 14808.0] | [17.0, 76.0] | [228, 213] |
p03287 | u071680334 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['#include<stdio.h>\n#include<string.h>\n#include<math.h>\n#include<stdlib.h>\n#include<limits.h>\n\n#define rep(i,begin,end) for(int i=begin; i<end; i++)\n\n\n\nint cmpAsc(const void* a, const void* b){\n int x = *(int*)a, y = *(int*)b;\n if(x > y){\n return 1;\n }\n if(x < y){\n return -1;\n... | ['Runtime Error', 'Accepted'] | ['s320829014', 's928179930'] | [2940.0, 14252.0] | [17.0, 87.0] | [927, 489] |
p03287 | u096820121 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['# coding: utf-8\nimport collections\nimport math\nlist = input().split()\nN = int(list[0])\nM = int(list[1])\na = input().split()\nx = 0\nhako = [0]\nfor i in a:\n hako.append(int(i))\nB = []\nb = 0\nfor i in hako:\n b += i\n B.append(b%M)\nc = collections.Counter(B)\naaa =[]\nfor i in c:\n if c[i] >= 2:\... | ['Runtime Error', 'Accepted'] | ['s983678784', 's510368479'] | [22884.0, 22884.0] | [114.0, 408.0] | [433, 434] |
p03287 | u102126195 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['import math\ndef PC(n, r):\n return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\nB = []\nj = 0\nfor i in A:\n if j == 0:\n B.append(i)\n else:\n B.append(B[j - 1] + i)\n j += 1\nfor i in range(len(B))... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s058744727', 's164587324', 's858897208', 's600563811'] | [15020.0, 15020.0, 15020.0, 15020.0] | [454.0, 177.0, 188.0, 180.0] | [698, 1362, 1362, 1379] |
p03287 | u102461423 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['import numpy as np\nN,M = map(int,input().split())\nA = np.array([0]+[int(x) for x in input().split()],dtype=np.int64)\nA_cum = np.mod(A.cumsum(),M)\n\ncounter = np.bincount(A_cum)\ncounter[0] += 1 \nanswer = (counter * (counter-1)).sum() // 2\nprint(answer)', 'import numpy as np\nN,M = map(int,input().split())\nA = ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s111993210', 's575476377', 's895569844'] | [27296.0, 23060.0, 24308.0] | [1689.0, 185.0, 224.0] | [257, 273, 270] |
p03287 | u102902647 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ["import numpy as np\nN, M = 13, 17\nA = [int(i) for i in '29 7 5 7 9 51 7 13 8 55 42 9 81'.split()]\nar = np.eye(N) * A\n\nfor h in range(0, N):\n for w in range(1, h+1):\n ar[-h-1, -h-1+w] = ar[-h, -h-1+w] + ar[-h-1, -h-2+w] - ar[-h, -h-2+w]\nprint(int(sum(sum(ar % M == 0)) - sum(np.linspace(1, N-1, N-1))))... | ['Wrong Answer', 'Accepted'] | ['s526400023', 's891087638'] | [12512.0, 14480.0] | [149.0, 152.0] | [310, 649] |
p03287 | u118642796 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | [',M = map(int,input().split())\nA = map(int,input().split())\n\nB = [0]*M\nB[0] = 1\ntmp = 0\nans = 0\n\n\n\nfor a in A:\n tmp = (tmp+a)%M\n ans += B[tmp]\n B[tmp] += 1\n\nprint(ans)', 'N,M = map(int,input().split())\nA = map(int,input().split())\n \nB = {0: 1}\ntmp = 0\nans = 0\n \nfor a in A:\n ... | ['Runtime Error', 'Accepted'] | ['s452799046', 's414829725'] | [2940.0, 16100.0] | [17.0, 99.0] | [187, 199] |
p03287 | u170201762 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['from scipy.misc import comb\nimport numpy as np\nfrom collections import defaultdict\nN,M = map(int,input().split())\nA = list(map(int,input().split()))\nA = np.cumsum(A)\nA %= M\nd = defaultdict(lambda:0)\nd[0] = 1\nfor i in range(N):\n d[A[i]] += 1\nans = 0\nfor k in d:\n ans += comb(d[k],2)\nprint(int(ans))'... | ['Wrong Answer', 'Accepted'] | ['s259598819', 's370566366'] | [24752.0, 14224.0] | [2110.0, 115.0] | [303, 258] |
p03287 | u198905553 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['from collections import Counter\n \nn, m = map(int, input().split())\nA = list(map(int, input().split()))\n \nB = [0] * (n + 1)\n \nfor i in range(n):\n B[i + 1] = accr[i] + A[i] \n\nli = [i % m for i in B] \n\nC = Counter(li) \n\nans = 0\nfor v in C.values():\n if v > 1:\n ans += v * (v - 1) // 2\n \nprint(ans)... | ['Runtime Error', 'Accepted'] | ['s075565539', 's899179855'] | [14636.0, 18844.0] | [47.0, 99.0] | [507, 504] |
p03287 | u201234972 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['N, M = map( int, input().split())\nA = list( map( int, input().split()))\nprint(A)\nA = [ x%M for x in A]\nSUM = [0]\nfor i in range(N):\n SUM.append(SUM[-1]+A[i])\nans = 0\ncnt = 1\nfor l in range(N):\n if A[l] == 0:\n ans += cnt\n cnt += 1\n else:\n PART = 0\n for r in range(l+1... | ['Wrong Answer', 'Accepted'] | ['s306181166', 's906616361'] | [15144.0, 14424.0] | [2104.0, 112.0] | [472, 192] |
p03287 | u239528020 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['#!/usr/bin/env python3\n\nimport numpy as np\nfrom scipy.special import comb\n\nn, m = list(map(int, input().split()))\na = list(map(int, input().split()))\n\na_sum = np.cumsum(a)\n\n\nre_list = {}\nfor i in a_sum:\n re = i % m\n if re in re_list:\n re_list[re] += 1\n else:\n re_list[re] = 1\nr... | ['Runtime Error', 'Accepted'] | ['s557126367', 's080714411'] | [54116.0, 54156.0] | [262.0, 285.0] | [419, 421] |
p03287 | u288087195 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['import collections\nn, m = map(int, input().split())\nA = [int(i) for i in input().split()]\n\nR = [0]*n\na = 0\nfor i in range(n):\n a += A[i]\n a %= m\n R[i] = a\n\n\ndef nc2(n):\n return n*(n-1)//2\n\n\nc = collections.Counter(R)\nans = 0\nfor r in set(R):\n ans += nc2(c[r])\nprint(ans)\n', 'import ... | ['Wrong Answer', 'Accepted'] | ['s921894441', 's574898509'] | [17096.0, 17096.0] | [121.0, 128.0] | [286, 287] |
p03287 | u338824669 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['N,M=map(int,input().split())\nA=list(map(int,input().split()))\n\na=0\nm=[0]*N\nfor i in range(N):\n a+=A[i]%M\n a%=M\n m[i]=a\n\nm.sort()\nans=0\ncnt=0\nfor i in range(N-1):\n if m[i]==m[i+1]:\n cnt+=1\n else:\n ans+=cnt*(cnt-1)//2\n cnt=1\nans+=cnt*(cnt-1)//2\nprint(ans)', 'N,M=m... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s072109201', 's543624284', 's317304162'] | [14224.0, 14696.0, 14224.0] | [113.0, 115.0, 115.0] | [289, 291, 297] |
p03287 | u342563578 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['N,M = map(int,input().split())\nAlist = list(map(int, input().strip().split()))\nr = list(range(len(Alist)))\nr[0] = Alist[0]\nfor i in range(1,len(Alist)-1):\n r[i] = r[i-1] + Alist[i]\nfor i in range(len(r)):\n r[i] = r[i]%M\np = [0] * M\nfor i in range(len(r)):\n p[r[i]] = p[r[i]] + 1\ndef kaijou(n):\n ... | ['Runtime Error', 'Accepted'] | ['s505050150', 's369089240'] | [887700.0, 14480.0] | [2119.0, 163.0] | [655, 625] |
p03287 | u375616706 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['from collections import Counter\nN, M = (list)(map(int, input().split()))\nA = (list)(map(int, input().split()))\nA[0] %= M\n\nfor i in range(1, N):\n A[i] += A[i-1]\n A[i] %= M\n\nans = 0\n\nC = Counter(A)\nfor num, val in C:\n if num == 0:\n ans += val\n if val >= 2:\n ans += val*(val-1)//... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s028545042', 's246442845', 's274280555'] | [14920.0, 2940.0, 14636.0] | [87.0, 18.0, 100.0] | [315, 377, 323] |
p03287 | u398942100 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['n,m=map(int,input().split())\na=list(map(int,input().split()))\na[0]%=m\nfor i in range(1,n):\n\ta[i]+=a[i-1]\n\ta[i]%=m\na.sort()\np=0\ns=0\nfor i in range(1,n):\n\tif a[i]-a[p]:\n\t\tp=i-p\n\t\ts+=p*(p-1)/2\n\t\tp=i\np=n-p\ns+=p*(p+1)/2\nprint(s)n,m=map(int,input().split())\na=list(map(int,input().split()))\na[0]%=... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s228779471', 's279584826', 's715929722', 's752296015', 's862335487', 's726242282'] | [3064.0, 3060.0, 14228.0, 14252.0, 14252.0, 14252.0] | [17.0, 17.0, 106.0, 104.0, 114.0, 104.0] | [462, 116, 236, 223, 239, 234] |
p03287 | u404676457 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['import numpy as np\n(n, m) = list(map(int, input().split()))\na = np.array(list(map(int, input().split()))).astype("int64") \na = np.cumsum(a)', 'import numpy as np', 'import numpy as np\n(n, m) = list(map(int, input().split()))\na = np.array(list(map(int, input().split()))).astype("int64") \na = np.cumsum(a)\na %= m... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s181109326', 's198235227', 's241234891', 's258836789', 's511827094', 's834178349', 's079441851'] | [23072.0, 18920.0, 23444.0, 23048.0, 23368.0, 23112.0, 17572.0] | [185.0, 300.0, 189.0, 183.0, 181.0, 186.0, 159.0] | [139, 18, 219, 169, 122, 222, 433] |
p03287 | u445624660 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['\n# [(0, 8, 136), (0, 12, 323), (1, 10, 204), (2, 2, 34), (5, 7, 119), (6, 8, 85), (6, 12, 272), (10, 11, 187)]\n# [(0, 8, 136), (0, 12, 323), (1, 2, 34), (4, 7, 119), (5, 8, 85), (5, 12, 272), (9, 9, 136), (9, 11, 187)]\n\nn, m = map(int, input().split())\narr = list(map(int, input().split()))\nruiseki_arr = [0] * n... | ['Wrong Answer', 'Accepted'] | ['s408037823', 's734527426'] | [17804.0, 14224.0] | [2104.0, 133.0] | [930, 387] |
p03287 | u467736898 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['from collections import defaultdict\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\n\nd = defaultdict(int)\nans = 0\ns = 0\nd[0] = 1\nfor i, a in enumerate(A):\n a %= M\n s += a\n ans += d[s%M]\n d[s % M] += 1\n\nprint(ans, d)', 'from collections import defaultdict\nN, M = map(int,... | ['Wrong Answer', 'Accepted'] | ['s647005987', 's510439711'] | [16552.0, 14668.0] | [138.0, 119.0] | [248, 245] |
p03287 | u476604182 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ["from collections import Counter\nfrom itertools import accumulate\nN, M, *A = map(int, open('0').read().split())\nB = [b%M for b in accumulate(A)]\nC = Counter(B)\nans = C[0]\nans += sum(C[k]*(C[k]-1)//2 for k in C.keys())\nprint(ans)", 'from collections import Counter\nfrom itertools import accumulate\nN, M, *A = ma... | ['Runtime Error', 'Accepted'] | ['s022248312', 's695295577'] | [3316.0, 16600.0] | [20.0, 89.0] | [227, 225] |
p03287 | u497046426 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['from collections import defaultdict\n\nN, M = map(int, input().split())\nA = list(map(int, input().split()))\ncumS = [0]\nfor a in A:\n cumS.append(a + cumS[-1])\ncumS_rem = defaultdict(int)\nfor c in cumS:\n r = c % M\n cumS_rem[r] += 1\nans = 0\nfor r, n_r in cumS_rem.items()\n if n_r > 1:\n ans ... | ['Runtime Error', 'Accepted'] | ['s036371795', 's774896274'] | [2940.0, 16808.0] | [17.0, 111.0] | [332, 333] |
p03287 | u497625442 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['from collections import Counter\nfrom itertools import accumulate\nfrom functools import reduce\n\nN, M = map(int, input().split())\nA = [int(x) for x in input().split()]\n\nc = Counter([0] + [x % M for x in accumulate(A)])\nans = reduce(add, [v*(v-1)//2 for v in c.values()])\nprint(ans)\n', 'from collections import ... | ['Runtime Error', 'Accepted'] | ['s107228836', 's261394752'] | [16840.0, 16832.0] | [72.0, 85.0] | [280, 291] |
p03287 | u517152997 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['# -*- coding: utf-8 -*-\n# \nimport math\nimport sys\nimport itertools\nimport numpy as np\n\n\nn,m = map(int, input().split())\n\n\na = [int(i) for i in input().split()]\nb = [0]*(n)\nc ={0:1}\nbb=0\nfor i in range(0,n) :\n bb = ( bb+a[i] ) % m\n c[bb] = c.get(bb,0) + 1\n \n \nanswer = 0\nprint(c)\n\nfor... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s653858769', 's724419190', 's832076470'] | [24288.0, 963792.0, 24148.0] | [257.0, 2132.0, 232.0] | [448, 452, 449] |
p03287 | u518042385 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['n,m=map(int,input().split())\nl=list(map(int,input().split()))\ndic={}\nl1=[]\nc=0\nfor i in l:\n c=(c+i)%m\n l1.append(c)\nprint(len(l)-len(set(l1))) ', 'from collections import defaultdict\nimport math\ndic=defaultdict(int)\nn,m=map(int,input().split())\nl=list(map(int,input().split()))\nl1=[]\nc=0\ncount=0\nfor... | ['Wrong Answer', 'Accepted'] | ['s419811374', 's957760045'] | [14696.0, 14924.0] | [65.0, 394.0] | [146, 334] |
p03287 | u543954314 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['n,m = map(int, input().split())\nans = 0\ndef kx(t):\n return int(t)%m\na = list(map(kx, input().split()))\nb = [0]*(n+1)\nfor i in range(1,n+1):\n a[i] = a[i-1] + b[i-1]\nf = [0]*m\nfor i in b:\n f[i] += 1\nfor i in f:\n ans += i*(i-1)//2\nprint(ans)', 'from collections import defaultdict as dd\nd = dd(int)\nd[0... | ['Runtime Error', 'Accepted'] | ['s968385899', 's236678069'] | [14032.0, 14912.0] | [81.0, 114.0] | [242, 249] |
p03287 | u553348533 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['N, M = map(int,input().split())\nA = [int(i) for i in input().split()]\nsumA = [0 for i in range(N + 1)]\nfor i in range(1, N + 1):\n sumA[i] = (A[i] + A[i - 1]) % M\nans = 0\n\nfor j in range(N):\n ans += sumA[j:].count(sumA[j]) - 1\n\nprint(ans)', 'from collections import defaultdict as dict\nd = dict(int)\nN... | ['Runtime Error', 'Accepted'] | ['s283876004', 's781829126'] | [14252.0, 16568.0] | [76.0, 128.0] | [243, 308] |
p03287 | u562016607 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['N,M=map(int,input().split())\nA=[int(i) for i in input().split()]\nS=[0 for i in range(N+1)]\nfor i in range(N):\n S[i+1]=(S[i]+A[i])%M\nD=dict()\nfor i in range(N+1):\n if S[i] in D:\n D[S[i]]+=1\n else:\n D[S[i]]=1\nprint(D)\nfor si in D:\n print(D[si])\nprint(S)', 'N,M=map(int,input().spl... | ['Wrong Answer', 'Accepted'] | ['s440617490', 's255992427'] | [19512.0, 15444.0] | [166.0, 119.0] | [277, 323] |
p03287 | u571444155 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['n, m = map(int, input().split())\n\na = list(map(int, input().split()))\n\ns = 0\ncount = 0\n\nfor l in range(n):\n for r in range(n):\n s = sum(a[l:r+1])\n if s % m == 0:\n count += 1\n\nprint(count/2)\n', 'N, M = list(map(int, input().split()))\n\nD = list(map(int, input().split()))\n\nS... | ['Wrong Answer', 'Accepted'] | ['s398104895', 's310952204'] | [15020.0, 14224.0] | [2108.0, 90.0] | [218, 247] |
p03287 | u600402037 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ['import sys\nimport numpy as np\n\nstdin = sys.stdin\n \nri = lambda: int(rs())\nrl = lambda: list(map(int, stdin.readline().split()))\nrs = lambda: stdin.readline().rstrip() # ignore trailing spaces\n\nN, M = rl()\nA0 = rl()\nA = np.array(A0)\nA_cum = A.cumsum()\nA_cum %= M\nanswer = 0\n\nfor i in range(N):\n ans... | ['Wrong Answer', 'Accepted'] | ['s182485095', 's462239069'] | [23132.0, 23100.0] | [2109.0, 510.0] | [368, 525] |
p03287 | u603253967 | 2,000 | 1,048,576 | There are N boxes arranged in a row from left to right. The i-th box from the left contains A_i candies. You will take out the candies from some consecutive boxes and distribute them evenly to M children. Such being the case, find the number of the pairs (l, r) that satisfy the following: * l and r are both intege... | ["\n\n# c = 0\n#\n# for i, A in enumerate(As):\n# A %= M\n\n\n# if A == 0:\n# c += 1\n# continue\n#\n# ccc = {A: 1}\n# for k in prev.keys():\n\n# newv = (k + A) % M\n# if newv in ccc:\n# ccc[newv] += v\n# ... | ['Wrong Answer', 'Accepted'] | ['s910684265', 's341183574'] | [15564.0, 15572.0] | [87.0, 89.0] | [1256, 1281] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.