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 |
|---|---|---|---|---|---|---|---|---|---|---|
p04001 | u183657342 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["s = str(input())\nans = 0\n\nfor i in 2**(len(s)-1):\n x = s[0]\n\n for j in range(len(s)-1):\n if (i>>j) & 1:\n x += '+'\n x += s[j+1]\n \n ans += sum(map(int,x.split('+')))\nprint(ans)", "s = str(input())\nans = 0\n\nfor i in range(2**(len(s)-1)):\n x = s[0]\n\n for j ... | ['Runtime Error', 'Accepted'] | ['s534885835', 's791132015'] | [3060.0, 3060.0] | [17.0, 20.0] | [215, 222] |
p04001 | u192165179 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['from sys import stdin\ninput = stdin.readline\n\nS = input()\nn = len(S)\n\ntot = 0\n\nfor i in range(2**(n-1)):\n f = S[0]\n for j in range(n-1):\n if ((i >> j) & 1):\n f += " "\n f += S[j+1]\n \n tot += sum(map(int, f.split(" ")))\n\nprint(tot)', 'S = input()\nn = len(S)\n\ntot = 0\n\nfor i i... | ['Runtime Error', 'Accepted'] | ['s532178637', 's804677068'] | [9100.0, 8952.0] | [29.0, 34.0] | [252, 206] |
p04001 | u193019328 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['S = input()\nn = len(S)\nans = 0\nfor bit in range(1 << (n-1)):\n f = S[0]\n for i in range(n-1):\n if bit & (1 << (n-1)):\n f += "+"\n f += S[i+1]\n ans += sum(map(int,f.split("+")\nprint(ans) ', 'a = input()\nsum = int(a)\nfor i in range(len(a)-1):\n sum += int(a[:i]) + int(a[i+1:])\npr... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s633352290', 's674017588', 's567969696'] | [2940.0, 2940.0, 3064.0] | [17.0, 17.0, 20.0] | [212, 101, 200] |
p04001 | u201856486 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['import sys\n\n# import math\n# import itertools\n# import numpy as np\n# import collections\n\n"""Template"""\n\n\nclass IP:\n \n\n def __init__(self):\n self.input = sys.stdin.readline\n\n def I(self):\n \n return int(self.input())\n\n def S(self):\n \n return self.inpu... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s066854928', 's193682000', 's875872911', 's449432987'] | [3192.0, 3192.0, 3192.0, 3192.0] | [19.0, 28.0, 19.0, 20.0] | [4952, 3097, 3047, 4970] |
p04001 | u209620426 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['def search(i,s):\n\tif i == n-1:\n\t\tli = []\n\t\ts = "".join(s)\n\t\tli = list(map(int,s.split("+")))\n\t\ttotal.append(sum(li))\n\t\treturn\n\n\telse:\n\t\tsearch(i+1,s)\n\n\t\t_s = s[:-(n-i)+1] + ["+"] + s[-(n-i)+1:]\n\t\tsearch(i+1,_s)\n\nsearch(0,s)\nprint(sum(total))', 's = list(input())\ntotal = []\nn = len(s... | ['Runtime Error', 'Accepted'] | ['s188029785', 's007235456'] | [3060.0, 3064.0] | [17.0, 20.0] | [241, 282] |
p04001 | u235783479 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s = input()\n# print(s)\n\nscore = 0\nfor blocksize in range(1,len(s)+1):\n for startpoint in range(len(s)):\n \n if startpoint+blocksize >= (len(s)+1): continue\n block = s[startpoint:startpoint+blocksize]\n ss = int(block) * math.factorial(startpoint) * math.factorial(len(s) - (startp... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s616971222', 's957929333', 's595646934'] | [3060.0, 3060.0, 3060.0] | [17.0, 17.0, 18.0] | [500, 389, 484] |
p04001 | u254086528 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['sr = input()\nn = len(sr)\n\nblist = []\nfor i in range(2**(n-1)):\n blist.append(list(map(int,list(bin(i)[2::].zfill(n-1)))))\nprint(blist)\n\nssum = 0\nfor k,num in enumerate(blist):\n bi = 0\n bsum = 0\n print(num)\n for i,j in enumerate(num):\n if j == 1:\n bsum += int(sr[bi:i+1])... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s733069483', 's898079701', 's384100971'] | [3188.0, 3188.0, 3064.0] | [22.0, 22.0, 21.0] | [416, 403, 388] |
p04001 | u255382385 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["s = input()\nn = len(s) - 1\nsum = 0\n\nif n == 0:\n print(s)\n return\n\nfor bit in range(1 << n):\n eval_str = ''\n for i in range(n):\n eval_str += s[i]\n if bit & (1 << i):\n eval_str += '+'\n eval_str += s[i + 1]\n sum += eval(eval_str)\n\nprint(sum)", "s = input()\nn =... | ['Runtime Error', 'Accepted'] | ['s380064310', 's663423700'] | [3064.0, 3060.0] | [17.0, 26.0] | [281, 245] |
p04001 | u263753244 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['print(l)\nindexes=[[] for _ in range(2**(n-1))]\nfor k in range(2**(n-1)):\n indexes[k]=[i for i, x in enumerate(l[k]) if x == 1]\n#print(indexes)\nSUM=0\nfor j in range(2**(n-1)):\n L=len(indexes[j])\n if L==0:\n SUM+=int(s)\n #print(SUM)\n else:\n SUM+=int(s[:indexes[j][0]+1])\n ... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s379777195', 's758721736', 's307853353'] | [3064.0, 3188.0, 3188.0] | [17.0, 22.0, 21.0] | [531, 742, 743] |
p04001 | u276144769 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['dp=["","+"]\ns=input()\nsu=0\nfor i in range(2**(len(s)-1)):\n val=""\n for j in range(len(s)-1):\n val+=s[j]\n val+=dp[int(bin(i)[j+2])]\n val+=s[len(s)-1]\n su+=eval(val)\nprint(su)\n', 'dp=["","+"]\ns=input()\nsu=0\nfor i in range(2**(len(s)-1)):\n val=""\n for j in range(len(s)-1):... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s057033465', 's208269809', 's392828628', 's027146916'] | [3064.0, 3064.0, 3064.0, 3064.0] | [23.0, 22.0, 22.0, 33.0] | [200, 181, 194, 212] |
p04001 | u319612498 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s=list(map(int,list(input())))\nn=len(s)\nans=0\nfor i in range(1<<(n-1)):\n\n S=s[0]\n for j in range(n-1):\n if i & (1<<j): \n S+="+"+s[j+1]\n else: \n S+=s[j+1]\n ans+=eval(S)\nprint(ans)', 's=list(input())\nn=len(s)\nans=0\nfor i in range(1<<(n-1)):\n\n \n\n S=s[... | ['Runtime Error', 'Accepted'] | ['s222574298', 's920691982'] | [2940.0, 3060.0] | [17.0, 27.0] | [502, 509] |
p04001 | u322229918 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s = input()\n\nitem = np.arange(len(s) - 1) + 1\nn = len(item)\ncount = 0\nfor i in range(2 ** n):\n sidx = 0\n for j in range(n): \n if ((i >> j) & 1): \n eidx = item[j]\n count += int(s[sidx:eidx])\n sidx = eidx\n count += int(s[sidx:])\nprint(count)', 'import nump... | ['Runtime Error', 'Accepted'] | ['s601130087', 's319370331'] | [3060.0, 12664.0] | [17.0, 151.0] | [396, 295] |
p04001 | u322568242 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s=input()\n\nans=0\nfor i in range(1<<(len(s)-1)):\n sum=0\n temp=int(s[0])\n for j in range(len(s)-1):\n if i>>j&1:\n temp=temp*10+int(s[j+1])\n else :\n sum+=temp\n temp=int(s[j+1])\n sum+=temp\n print(sum)\n ans+=sum\nprint(ans)', 's=input()\n\nans=0... | ['Wrong Answer', 'Accepted'] | ['s749417129', 's338218535'] | [3064.0, 3060.0] | [21.0, 21.0] | [281, 266] |
p04001 | u329399746 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s = input()\nans = 0\nmemo = []\nfor i in range(1 << len(s) -1):\n print(bin(i))\n tmp = s[0]\n for j in range(len(s)-1):\n if ((i >> j) & 1):\n tmp+="+"\n tmp += s[j+1]\n if tmp not in memo:\n ans+=eval(tmp)\n memo.append(tmp)\nprint(ans)', 's = input()\nans = 0\nme... | ['Wrong Answer', 'Accepted'] | ['s552450873', 's687164081'] | [3064.0, 3060.0] | [30.0, 30.0] | [277, 259] |
p04001 | u342042786 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['S = str(input())\np = ["+",""]\ntotal = 0\n\nfor i in range(2**(len(S)-1)):\n t = S[0]\n for j in range(len(S)-1):\n t = t + p[i>>j&1] + S[j+1]\n print(t)\n total += eval(t)\nprint(total)', 'S = str(input())\np = ["+",""]\ntotal = 0\n\nfor i in range(2**(len(S)-1)):\n t = S[0]\n for j in rang... | ['Wrong Answer', 'Accepted'] | ['s531520847', 's433565291'] | [3060.0, 3060.0] | [28.0, 26.0] | [196, 183] |
p04001 | u345621867 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['S = input()\nn = len(S)\nres = 0\nfor i in range(1 << n-1):\n subres = 0\n subst = S[0]\n for j in range(n-1):\n if i >> j & 1:\n subres += int(subst)\n subst = S[j+1]\n else:\n subst += S[j+1]\n if j == n - 2:\n subres += int(subst)\n p... | ['Wrong Answer', 'Accepted'] | ['s548667676', 's379123654'] | [9180.0, 9052.0] | [39.0, 27.0] | [363, 365] |
p04001 | u366133198 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["#!/usr/bin/python3 \n\nimport itertools\n\ndef all_comb(n):\n comb = []\n for i in range(0, n+1):\n comb.extend(list(ite... | ['Runtime Error', 'Accepted'] | ['s018643908', 's439796595'] | [2940.0, 3064.0] | [21.0, 19.0] | [723, 730] |
p04001 | u370429695 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['def dfs(i, sum):\n if i == len(s) - 1:\n return sum(list(map(int,sum.split("+"))))\n\n return dfs(i+1, sum + s[i+1]) + dfs(i+1, sum + "+" + s[i+1])\n\ns = input()\nprint(dfs(0,s[0]))', 'def dfs(i, f):\n if i == len(s) - 1:\n return sum(list(map(int,f.split("+"))))\n\n return dfs(i+1, f + s[i... | ['Runtime Error', 'Accepted'] | ['s333587549', 's802333698'] | [3060.0, 3060.0] | [18.0, 18.0] | [188, 180] |
p04001 | u374051158 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["S = input()\nans = 0\nfor p in itertools.product(['', '+'], repeat = len(S) - 1):\n cmd = ''.join([s + t for s, t in zip(S, p)]) + S[-1]\n ans += eval(cmd)\nprint(ans)", "import itertools\nS = input()\nans = 0\nfor p in itertools.product(['', '+'], repeat = len(S) - 1):\n cmd = ''.join([s + t for s, t in zip... | ['Runtime Error', 'Accepted'] | ['s972042868', 's755452348'] | [2940.0, 3060.0] | [17.0, 26.0] | [168, 185] |
p04001 | u375616706 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['H, W, N = map(int, input().split())\nmat = [[0]*W for _ in range(H)]\n\nfor _ in range(N):\n a, b = map(int, input().split())\n mat[a-1][b-1] = 1\n\n\ndp = [[0]*W for _ in range(H)]\nfor h in range(H):\n cnt = 0\n if mat[h][0] == 1:\n dp[h][0] = 1\n for w in range(1, W):\n if mat[h][w] ==... | ['Runtime Error', 'Accepted'] | ['s405848051', 's284018253'] | [3188.0, 3060.0] | [19.0, 27.0] | [653, 253] |
p04001 | u381246791 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['#coding:utf-8\nS=input()\nn=len(S)-1\nanswer=0\nfor i in range(2**n):\n formula=list(S)\n for j in range(n):\n if ((i<<j)&1):\n formula=S.insart("+",j+1)\n for i,elem in enumerate(formula):\n num=""\n if elem=="+" or i==len(formula)-1:\n answer+=int(num)\n num=0\n else:\n num+=elem\... | ['Runtime Error', 'Accepted'] | ['s572044718', 's316324728'] | [3060.0, 3060.0] | [17.0, 20.0] | [322, 223] |
p04001 | u386170566 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['\ns = list(str(input()))\nl = len(s)\ndef dfs(i,f):\n if i == l-1:\n return sum(list(map(int,f.split("+"))))\n return dfs(i + 1, f + s[i+1]) + \\ \n dfs(i + 1, f + "+" +s[i + 1])\nprint(dfs(0,s[0]))', '\ns = list(str(input()))\nl = len(s)\ndef dfs(i,f):\n if i == l-1:\n return sum(lis... | ['Runtime Error', 'Accepted'] | ['s627344345', 's310415687'] | [2940.0, 3060.0] | [17.0, 19.0] | [304, 308] |
p04001 | u392029857 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["s = input()\nop = ['','+']\nif len(s) == 1:\n print(s)\nelse:\n s = s + 'X'*(10 -len(s))\n ans = []\n for a in op:\n for b in op:\n for c in op:\n for d in op:\n for e in op:\n for f in op:\n for g in op:... | ['Runtime Error', 'Accepted'] | ['s977021170', 's847136515'] | [3064.0, 3064.0] | [18.0, 27.0] | [870, 318] |
p04001 | u408620326 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["import sys\ninput = sys.stdin.readline\ns = input()\nn = len(s)\nans = 0\nfor i in range(1<<(n-1)):\n t = ''\n for j in range(n-1):\n t += s[j]\n if (i >> j) & 1:\n t += '+'\n else:\n t += s[n-1]\n ans += eval(t)\nprint(ans)\n", "import sys\ninput = sys.stdin.readline\ns = ... | ['Runtime Error', 'Accepted'] | ['s060328042', 's392820556'] | [3060.0, 3060.0] | [26.0, 26.0] | [255, 263] |
p04001 | u411858517 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["import itertools\n\ndef solve(S):\n \n count = 0\n bit_list = list(itertools.product([0, 1], repeat=len(S)-1))\n for pattern in bit_list:\n \n start = 0\n for end in range(len(pattern)):\n if pattern[end] == 1:\n count += int(S[start:end+1])\n ... | ['Runtime Error', 'Accepted'] | ['s840134770', 's677641381'] | [2940.0, 3064.0] | [17.0, 19.0] | [1108, 1200] |
p04001 | u412255932 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['S = int(input())\n\ndef dfs(res, depth, path, S):\n res.append(path)\n if depth == len(S) - 1:\n return\n for i in range(depth + 1, len(S)):\n dfs(res, i, int(S[depth:i+1]), S)\n\nres = []\n\ndfs(res, -1, [], S)\nprint(sum(res))\n', 'S = input()\n\ndef dfs(res, depth, path, S):\n res.append(... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s012193765', 's413470582', 's189136578'] | [3060.0, 2940.0, 3572.0] | [20.0, 18.0, 24.0] | [240, 229, 305] |
p04001 | u433195318 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['#include <stdio.h>\n#include <stdlib.h>\n\n#include <iomanip>\n\n#include <string.h>\n#include <string>\n#include <map>\n#include <stack>\n\n#include <deque>\n#include <set>\n#include <math.h>\n#include <algorithm>\n#include <numeric>\n\nusing namespace std;\n\n// マクロ&定数 ==============================================... | ['Runtime Error', 'Accepted'] | ['s853749744', 's829670247'] | [3064.0, 5088.0] | [17.0, 37.0] | [2110, 1744] |
p04001 | u435281580 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["import numpy as np\n\nN, M = map(int, input().split())\nroutes = np.array([list(map(int, input().split())) for _ in range(M)], 'i')\n#print(routes)\n\n\ndp = [{} for _ in range(N + 1)]\ndp[1][0] = 0\n\nfor i in range(2, N + 1):\n for (f, t, m) in routes:\n if t != i:\n continue\n\n if m in... | ['Runtime Error', 'Accepted'] | ['s931153026', 's295361819'] | [12516.0, 12448.0] | [155.0, 152.0] | [703, 507] |
p04001 | u441191580 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["# coding: utf-8\n# Your code here!\n\n# coding: utf-8\n# Your code here!\n\ns = input()\nsList = list(s)\nsList = [int(i) for i in s]\nsCount = len(sList)\n#print(sCount)\n\naaa = 0\n\nfor i in range(2**(sCount-1)):\n\n binaryNumber = format(i,'b')\n binaryNumber = binaryNumber.zfill(sCount-1)\n binaryNumber... | ['Wrong Answer', 'Accepted'] | ['s981036944', 's788927878'] | [3188.0, 3064.0] | [33.0, 33.0] | [863, 859] |
p04001 | u446371873 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["s = input()\nl = len(s)\nans = 0\nfor i in range(2**(l-1)):\n eval = ''\n for j in range(l):\n if ((i >> j) & 1):\n eval += s[j] + '+'\n else:\n eval += s[j]\n ans += eval(eval)", 's = input()\nans = 0\nfor i in range(s):\n ans += int(s[0:i]) + int(s[i:len(s)])\nans += in... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s735265750', 's846215152', 's704811675'] | [3060.0, 2940.0, 3060.0] | [18.0, 18.0, 27.0] | [212, 103, 211] |
p04001 | u454899755 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['S = input()\n\ndef dfs(res, depth, path, S):\n res[0] += int(path)\n for i in range(depth + 1, len(S) + 1):\n dfs(res, i, S[depth:i], S)\n\nres = [0]\n\ndfs(res, 0, 0, S)\nprint(res[0])\n', 'S = input()\n\ndef dfs(start, S, curSum, res):\n\tif start >= len(S):\n\t\tres[0] += curSum\n\t\treturn\n\n # p... | ['Wrong Answer', 'Accepted'] | ['s190385763', 's589330546'] | [2940.0, 3060.0] | [18.0, 18.0] | [189, 261] |
p04001 | u455957433 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['def insert_string_to_base(target_string, insert_point, insert_string):\n return target_string[:insert_point] + insert_string + target_string[insert_point:]\n\ndef main():\n N = str(input())\n l = len(N)-1\n\n result = 0\n for i in range(2 ** l):\n count = 1\n st = N\n for j in rang... | ['Wrong Answer', 'Accepted'] | ['s306423878', 's869306580'] | [3064.0, 3060.0] | [21.0, 20.0] | [598, 580] |
p04001 | u477320129 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['from itertools import product\nH, W, N = list(map(int, input().split()))\nA = [tuple(map(int, input().split())) for _ in range(N)]\ncount = {}\nfor x, y in A:\n for xx, yy in product(range(x-1, x+2), range(y-1, y+2)):\n if not(2 <= xx <= H-1 and 2 <= yy <= W-1):\n continue\n count[(xx, yy)... | ['Runtime Error', 'Accepted'] | ['s629776672', 's450682937'] | [3064.0, 3064.0] | [39.0, 52.0] | [459, 214] |
p04001 | u487594898 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['S = input()\nans=0\nfor i in range(1<<len(S)):\n f =S[0]\n for j in range(len(S)-1):\n if i &(1<<j):\n f +="+"\n f +=S[j+1]\n ans += sum(map(int, f.split("+")))\nprint(ans)\n', 'S = input()\nans=0\nfor i in range(1<<len(S)-1):\n f =S[0]\n for j in range(len(S)-1):\n if i... | ['Wrong Answer', 'Accepted'] | ['s749391151', 's380261305'] | [2940.0, 3060.0] | [24.0, 20.0] | [198, 200] |
p04001 | u489762173 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['import sys\nimport copy\n\ndef main():\n sum=0\n S = list(map(str, input()))\n hoge = tmp = []\n print(S)\n\n op_cnt = len(S) - 1\n\n for i in range(2 ** op_cnt):\n op = [""] * op_cnt\n for j in range(op_cnt):\n if ((i >> j) & 1):\n op[op_cnt -1 -j] = "+"\n\n ... | ['Wrong Answer', 'Accepted'] | ['s846282192', 's278633927'] | [3572.0, 3444.0] | [43.0, 38.0] | [532, 449] |
p04001 | u492447501 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['import sys\n\nS = input()\n\nN = len(S)-1\nsum = 0\n\nfor i in range(2**N):\n\n op = [""]*(N)\n for j in range(N):\n if (i>>j)&1:\n op[j] = "+"\n s = ""\n for j in range(N):\n s = s + S[j] + op[j]\n s = s + S[j]\n sum = sum + eval(s)\nprint(sum)', 'import sys\n\nS = input()\... | ['Runtime Error', 'Accepted'] | ['s383414696', 's942033555'] | [3064.0, 3064.0] | [27.0, 27.0] | [270, 277] |
p04001 | u494037809 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['S = input()\n\ndef saiki(n, s=S[0]):\n _sum = 0\n \n if n==len(S)-1:\n print(s)\n return eval(s)\n \n _sum += saiki(n+1, s + "+" + S[n+1])\n _sum += saiki(n+1, s + S[n+1])\n \n return _sum\n \nprint(saiki(0))', 'S = input()\n\ndef saiki(n, s=S[0]):\n _sum = 0\n \n if ... | ['Wrong Answer', 'Accepted'] | ['s980241846', 's531648809'] | [3060.0, 3060.0] | [26.0, 25.0] | [235, 237] |
p04001 | u494058663 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["S = list(input())\nN = len(S)\nList = []\nfor i in range(2**(N-1)):\n tmp = ''\n for j in range(N-1):\n if ((i>>j) & 1):\n tmp += '1'\n else:\n tmp += '0'\n List.append(list(tmp))\nans = 0\nfor i in range(len(List)):\n start = 0\n tmp = ''\n for j in range(len(Lis... | ['Wrong Answer', 'Accepted'] | ['s105206594', 's275404274'] | [3064.0, 3064.0] | [22.0, 22.0] | [541, 529] |
p04001 | u497596438 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['from collections import deque\nS=input()\nqueue=deque()\nlst=[]\nlst.append([0,0])\nfor i in range(0,len(S)):\n l=len(lst)\n for _ in range(l):\n x,y=lst.pop(0)\n lst.append([x,y*10+int(S[i])])\n lst.append([x+y*10+int(S[i]),0])\nl=len(lst)\nfor _ in range(l):\n x,y=lst.pop(0)\n lst.a... | ['Wrong Answer', 'Accepted'] | ['s697387732', 's568131627'] | [3444.0, 3444.0] | [24.0, 23.0] | [338, 343] |
p04001 | u501451051 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["S = input()\nans = 0\n\nfor i in range(2**(len(S)-1):\n\ttemp = S\n\tfor j in range(len(S)-1):\n\t\tif(i >> j) & 1:\n temp = temp[:j - len(S) + 1]+'+'+temp[j-len(S)+1:]\n ans += eval(temp)\n\nprint(ans)\n ", "S = input()\nans = 0\n \nfor i in range(2**(len(S)-1)):\n temp = S\n for j i... | ['Runtime Error', 'Accepted'] | ['s824812852', 's233727404'] | [2940.0, 3060.0] | [17.0, 27.0] | [221, 201] |
p04001 | u506689504 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["s = input()\nx = []\nl = len(s)\nfor i in range(l):\n x.append(int(s[i]))\n\nsum = 0\nfor n in range(2**(l-1)):\n bin_str = format(i,'0'+str(l-1)+'b')\n prev = 0\n flg = 0\n for i in range(l-1):\n if bin_str[i]==0:\n prev = prev*10 + x[i]\n else:\n sum += prev*10 + x... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s206547350', 's373143211', 's983561417', 's981781317'] | [3064.0, 3060.0, 3064.0, 3064.0] | [21.0, 18.0, 19.0, 19.0] | [368, 367, 372, 518] |
p04001 | u520276780 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s = input()\nl = len(s)\nfin_ans = 0\nprint(s)\nfor i in range(2**(l-1)):###*\n ans = 0\n left = 0\n right = 1\n for j in range(l):\n if (i>>j) & 1 == 0 and right<l:\n right += 1\n elif right<l:\n ans += int(s[left:right])\n left = right\n right +=... | ['Wrong Answer', 'Accepted'] | ['s129927201', 's434681219'] | [3064.0, 3064.0] | [20.0, 21.0] | [405, 406] |
p04001 | u521271655 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s = input()\n\nfor i in range(2**(len(s)-1)):\n plus = [""]*(len(s))\n fomula = ""\n for j in range(len(s)-1):\n if(i >> j & 1):\n plus[j] = "+"\n for k in range(len(s)):\n fomula += s[k] + plus[k]\n ans += eval(fomula)\nprint(ans)', 's = input()\nans = 0\nfor i in range(2**(le... | ['Runtime Error', 'Accepted'] | ['s584466912', 's963233331'] | [8924.0, 8856.0] | [21.0, 29.0] | [260, 267] |
p04001 | u521866787 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["S = input()\nN = len(S)\nans = 0\n\nfor i in range(1,2**(N-1)):\n A = S[0]\n for j in range(N-1):\n if 1 << j & i:\n A += '+'\n A += S[j]\n ans += eval(A)\n print(A)\n\nprint(ans)", "S = input()\nN = len(S)\nans = 0\n\nfor i in range(1,2**(N-1)):\n A = S[0]\n for j in range(... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s736423516', 's932570877', 's025789385'] | [3060.0, 3060.0, 3060.0] | [28.0, 26.0, 27.0] | [203, 190, 228] |
p04001 | u537782349 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['def f(a, b, le, tf):\n b[le] = tf\n if le == len(b)-1:\n t = ""\n s1 = 0\n for i in range(len(b)):\n t += a[i]\n if b[i] == 1:\n s1 += int(t)\n t = ""\n t += a[len(b)]\n s1 += int(t)\n return s1\n else:\n ret... | ['Runtime Error', 'Accepted'] | ['s978627464', 's947995854'] | [3064.0, 3064.0] | [17.0, 18.0] | [461, 498] |
p04001 | u540698208 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['import itertools\n\ns = input()\nn = [i for i in s]\nans = 0\n\nfor i in range(len(n)):\n for j in itertools.combinations(range(len(n)-1, i)):\n temp = [i for i in s]\n for k in j[::-1]:\n temp.insert(k+1, "+")\n temp = "".join(temp)\n temp = temp.split("+")\n temp = map(int, temp)\n ans += su... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s031232088', 's781784861', 's357541862'] | [3064.0, 3060.0, 3060.0] | [18.0, 21.0, 20.0] | [323, 325, 328] |
p04001 | u541017633 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["// https://atcoder.jp/contests/arc061/tasks/arc061_a\n#include <bits/stdc++.h>\nusing namespace std;\ntypedef long long ll;\n\n\n\nint main() {\n string S;\n cin >> S;\n\n ll ans = 0;\n int m = S.size() - 1;\n\n rep(bit, 1 << m) {\n ll cur = S[0] - '0';\n rep(i, m) {\n if (bit & (1 << i)) {\n a... | ['Runtime Error', 'Accepted'] | ['s053714000', 's736477398'] | [2940.0, 2940.0] | [17.0, 38.0] | [490, 231] |
p04001 | u548545174 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s = input()\nspace = len(s) - 1\ntotal = 0\nfor i in range(2 ** space):\n pluses = []\n for j in range(space):\n if (i >> j) & 1:\n pluses.append(j)\n re = 0\n for p in pluses:\n re += int(s[p]) + int(s[p+1])\n total += re\nprint(total)', 'S = input()\nN = len(S) - 1\n\nans = 0... | ['Wrong Answer', 'Accepted'] | ['s699595579', 's501344652'] | [3060.0, 9032.0] | [20.0, 25.0] | [264, 277] |
p04001 | u552209394 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['n=input()\nq=len(n)\nans=0\nfor i in range(1,q):\n ans+=int(n[:i])+int(n[i:])\nprint(ans)', 'n=input()\nq=len(n)\nans=int(n)\nfor i in range(1,q):\n ans+=int(n[:i])+int(n[i:])\nprint(ans)', 'n=input()\nq=len(n)-1\nans=0\nfor i in range(1,q):\n ans+=int(n[:i])+int(n[i:])\nprint(ans)\n ', 'S=[int(i) for i in ... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s383028954', 's406072398', 's684835156', 's497763690'] | [2940.0, 2940.0, 2940.0, 3060.0] | [17.0, 17.0, 18.0, 19.0] | [87, 92, 92, 224] |
p04001 | u557494880 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["S = intinput()\nn = len(S)\nans = 0\nfor i in range(2**(n-1)):\n s = S[0]\n for j in range(n-1):\n if (i >> j) & 1:\n s += '+'\n s += S[j+1]\n ans += eval(s)\nprint(ans)\n", "S = str(input())\n\ndef plus(a,b,c):\n x = a[0:b+1] + c + a[b+1:len(a)]\n return(x)\nA = [S]\nwhile len... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s250306601', 's589779097', 's771992693', 's970170521', 's377394214'] | [2940.0, 249992.0, 254488.0, 3060.0, 3060.0] | [17.0, 2120.0, 2120.0, 17.0, 27.0] | [194, 360, 611, 195, 191] |
p04001 | u557792847 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['S = input()\ntotal = 0\nfor p in (product((0, 1), repeat=len(S)-1)):\n ns = S[0]\n for i, pp in enumerate(p, 1):\n if pp == 0:\n ns += S[i]\n else:\n total += int(ns)\n ns = S[i]\n total += int(ns)\nprint(total)\n\n\n', 'import sys\nimport numpy as np\nimport ma... | ['Runtime Error', 'Accepted'] | ['s514796426', 's056447097'] | [9060.0, 27092.0] | [25.0, 114.0] | [259, 453] |
p04001 | u573970531 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['import sys\ninput=sys.stdin.readline\n\ns=input()\nans=0\n\nfor i in range(2 ** (len(s)-1)):\n bin_i = bin(i)[2:].rjust(len(s)-1,"0")\n li=[]\n n=s[0]\n \n for ix,sign in enumerate(bin_i):\n if sign=="0":\n n+=s[ix+1]\n else:\n li.append(int(n))\n n=s[ix+1]\n li.append(int(n))\n ans+=sum(l... | ['Runtime Error', 'Accepted'] | ['s039627399', 's679667293'] | [3064.0, 3064.0] | [17.0, 20.0] | [333, 309] |
p04001 | u581187895 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['S = input()\nlen_S = len(S)-1\nans = 0\nfor s in range(1<<len_S):\n now = "" \n now += S[0]\n print(s)\n for i in range(len_S): \n if s & (1<<i): \n now += "+"\n now += S[i+1] \n ans += eval(now)\nprint(ans) ', 'S = input()\nlen_S = len(S)-1\nans = 0\nfor s in range(1<<len_S):\n now = "" \n ... | ['Wrong Answer', 'Accepted'] | ['s990645439', 's230291858'] | [3060.0, 3060.0] | [28.0, 26.0] | [243, 234] |
p04001 | u582165344 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s = input().split("")\nsum = 0\nfor i in range(2 ** (len(s)-1)) :\n st = str(s[0])\n for j in range(len(s)-1) : \n if ((i >> j) & 1) :\n st = st + "+" + str(s[j+1])\n else :\n st = st + str(s[j+1])\n \n for item in st.split(\'+\') :\n sum += int(item)\nprint(sum)', 's = list(input())\nsum = 0\n... | ['Runtime Error', 'Accepted'] | ['s638437609', 's937861731'] | [3060.0, 3064.0] | [20.0, 21.0] | [272, 265] |
p04001 | u582614471 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['aqqn = list(input())\nans = 0\nfor i in range(2**(len(n)-1)):\n plus = [""]*(len(n))\n fomula = ""\n for j in range(len(n)-1):\n if(i>>j & 1):\n plus[j] = "+"\n for i in range(len(n)):\n fomula += n[i] + plus[i]\n ans += eval(fomula)\nprint(ans)\n', 'n = list(input())\nans = 0\... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s333317695', 's594947751', 's699089182'] | [3064.0, 3188.0, 3060.0] | [19.0, 30.0, 27.0] | [275, 1142, 273] |
p04001 | u589047182 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['def dfs(i, f):\n if i == n - 1:\n return sum(list(map(int, f.split("+"))))\n return dfs(i + 1, f + s[i + 1]) + dfs(i + 1, f + "+" + s[i + 1])s\ns = input()\nn = len(s)\n\nprint(dfs(0, s[0]))\n', 'def dfs(i, f):\n if i == n - 1:\n return sum(list(map(int, f.split("+"))))\n\n return dfs(i + 1,... | ['Runtime Error', 'Accepted'] | ['s895114031', 's339735929'] | [2940.0, 3060.0] | [17.0, 19.0] | [197, 200] |
p04001 | u593567568 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['from collections import deque\n\ndef dfs(xs):\n x = xs.popleft()\n\n if len(xs) == 0:\n return x\n\n # not +\n xs2 = xs.copy()\n y = xs2.popleft()\n xy = int(str(x)+str(y))\n xs2.appendleft(xy)\n b = dfs(xs2)\n\n # has +\n a = x * 2 + dfs(xs)\n\n\n return a+b\n\n\ns = str(i... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s059692996', 's134219537', 's200235593', 's322004436', 's421316065', 's555611618', 's340315812'] | [3316.0, 3316.0, 3316.0, 3316.0, 3316.0, 3316.0, 3444.0] | [21.0, 21.0, 21.0, 21.0, 21.0, 21.0, 27.0] | [356, 375, 353, 402, 402, 356, 515] |
p04001 | u606146341 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["import itertools\ns = str(input())\n\nlst = [i for i in itertools.product([0,1],repeat = len(s) - 1)]\ns2 = list(s)\n\nlst = [i for i in itertools.product([0,1],repeat = len(s) - 1)]\ns4 = []\nfor l in lst:\n s3 = list(s)\n h = 0\n for i in range(0, len(s)-1):\n if l[i] == 1:\n s3.insert(i... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s583551405', 's642393134', 's198644294'] | [3316.0, 3904.0, 3060.0] | [27.0, 2104.0, 24.0] | [387, 243, 179] |
p04001 | u611090896 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["s = input()\nn = len(s-1)\ntotal=0\nfor i in range(2**n):\n pl=['']*n\n ans=''\n for j in range(n):\n if ((i>>j)&1):\n pl[n-1-j] = '+'\n for k in range(n):\n ans += s[k]+pl[k]\n ans+=s[-1]\n total += eval(ans)\n\nprint(total)", "s = input()\nn = len(s)-1\ntotal=0\nfor i in range(2**n):\n pl=['']*n\n... | ['Runtime Error', 'Accepted'] | ['s728454734', 's941339888'] | [8936.0, 9064.0] | [24.0, 34.0] | [228, 229] |
p04001 | u620945921 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["#import itertools\nlist1=[k for k in input()]\nprint(list1)\nnum1=len(list1)\nprint(num1)\nlist00=[format(int(k), 'b') for k in range(2**(num1-1))]\nprint(list00)\n\nlist0=['','+']\n\nlist01=[]\nfor count1 in range(num1):\n x=list00[count1]\n list01.extend(x)\nprint(list01)\ntotal=0\n\nfor step1 in range(2):\n for... | ['Runtime Error', 'Accepted'] | ['s176757702', 's953986808'] | [3064.0, 3060.0] | [18.0, 24.0] | [639, 273] |
p04001 | u638320267 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s = input()\nsum = 0\nfor i in range(2**(len(s)-1)):\n term = 0\n for j in range(len(s)-1):\n term *= 10\n if (i//(2**j))%2 == 0:\n sum += term + int(s[j])\n term = 0\n if j == len(s)-2:\n sum += int(s[-1])\n else:\n term += int(s[j... | ['Runtime Error', 'Accepted'] | ['s772757338', 's137261379'] | [3064.0, 3060.0] | [17.0, 27.0] | [426, 308] |
p04001 | u667024514 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['from collections import Counter\nh, w, num = map(int, input().split())\nlis = []\nfor i in range(num):\n k, j = map(lambda x: int(x) - 1,input().split())\n for a in range(3):\n for b in range(3):\n cou1 = k - a\n cou2 = j - b \n if cou1 < 0 or cou1 > h - 3:\n ... | ['Runtime Error', 'Accepted'] | ['s196549244', 's969498714'] | [3316.0, 3064.0] | [20.0, 22.0] | [542, 385] |
p04001 | u667458133 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["s = input()\n\nn = 2 ** (len(s) - 1)\nprint(n)\nresult = 0\n\nfor i in range(n):\n bin_n = bin(i)[2:]\n bin_n = '0' * ((len(s) - 1) - len(bin_n)) + bin_n\n print('bin:' + bin_n)\n current_address = 0\n for j in range(len(bin_n)):\n if bin_n[j] == '1':\n print(s[current_address:j+1])\n result += int(... | ['Wrong Answer', 'Accepted'] | ['s406964066', 's928559150'] | [9224.0, 9156.0] | [34.0, 29.0] | [440, 339] |
p04001 | u673173160 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["s = input()\nn = len(s) - 1\nanswers = []\nsl = [s[i] for i in range(len(s))]\nfor i in range(2 ** n):\n tmp = []\n for j in range(n):\n if ((i >> j) & 1):\n tmp.append(j)\n ll = ['*']*len(s)\n for k in tmp:\n ll[k] = '+'\n ans = []\n for k, _ in zip(sl, ll):\n ans.ap... | ['Wrong Answer', 'Accepted'] | ['s898201797', 's456271327'] | [3064.0, 3060.0] | [23.0, 27.0] | [542, 233] |
p04001 | u674959776 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s=int(input())\nn=len(s)\nsum=0\nfor i in range(1<<n-1):\n t=0\n for j in range(n-1):\n if i & (1<<j):\n sum += int("".join(s[t:j+1]))\n t = j+1 \nprint(sum)', 's=input()\nn=len(s)\nsum=0\nfor i in range(1<<n-1):\n t=0\n for j in range(n-1):\n if i & (1<<j):\n sum += int("".join(s[t:j+1]))\n ... | ['Runtime Error', 'Accepted'] | ['s830196095', 's243303516'] | [3060.0, 3060.0] | [17.0, 21.0] | [163, 187] |
p04001 | u680619771 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['import sys\ngrid = []\npainted = []\n\nheight, width, n = sys.stdin.readline().strip().split()\nheight, width, n = int(height), int(width), int(n)\n\ndef checkGrid(x, y, grid):\n count = 0\n for col in range(x, x+3):\n for row in range(y, y+3):\n if grid[row][col] == 1:\n count ... | ['Runtime Error', 'Accepted'] | ['s713686428', 's136755982'] | [3064.0, 3064.0] | [38.0, 338.0] | [958, 666] |
p04001 | u688762199 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['# -*- coding: utf-8 -*-\n\nimport types\n#import copy\n\n# Input\nabcd = input()\nn = len(abcd) - 1 \nsum_ = 0\n\n# Print\nfor i in range( 2**n ):\n op = n * ["+"]\n\n \n # example: [\'\', \'+\', \'\']\n for j in range(n):\n if ( i >> j ) & 1:\n op[n-1 -j] = ""\n \n formula... | ['Wrong Answer', 'Accepted'] | ['s923138615', 's721721370'] | [3064.0, 3064.0] | [29.0, 28.0] | [511, 512] |
p04001 | u692311686 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['S=list(map(int,input().split()))\ndef sums(a):\n n=len(a)\n if n==1:\n return a[0]\n else:\n s=0\n for i in range(n):\n s+=10**(n-i-1)*a[i]\n \n for i in range(n-1):\n t=0\n b=[a[i+1:]]\n c=[a[:i+1]]\n for j in range(i+1):\n t+=10**(i-j)*c[j]\n s+=t*sums(b)\n ... | ['Wrong Answer', 'Accepted'] | ['s967916202', 's871434272'] | [3064.0, 3064.0] | [17.0, 19.0] | [319, 388] |
p04001 | u694433776 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s=input()\ndef solve(decided, left, idx):\n if idx==len(s):\n return decided+left\n \n ret1 = solve(decided+left,int(s[idx]),idx+1)\n \n ret2 = solve(decided, left*10int(s[idx]), idx+1)\n return ret1+ret2\nprint(solve(0,int(s[0]),1))', 's=input()\nret=0\n\nfor i in range(1<<(len(s)-1)):\n ... | ['Runtime Error', 'Accepted'] | ['s110922021', 's019555328'] | [2940.0, 3060.0] | [22.0, 28.0] | [287, 357] |
p04001 | u698756732 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s = input()\nres = 0\nfor i in range(2 ** (len(s) - 1)):\n _tmp = []\n for j in range(len(s) - 1):\n if ((i >> j) & 1):\n _tmp.append(j)\n \n print(_tmp)\n\n pre = 0\n \n for pos in _tmp:\n res += int(s[pre: pos + 1])\n pre = pos + 1\n\n res += int(s[pre... | ['Wrong Answer', 'Accepted'] | ['s242382908', 's512164162'] | [8976.0, 9120.0] | [32.0, 32.0] | [321, 643] |
p04001 | u699522269 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['a=input()\ndef strs(st):\n print(st)\n if len(st)>1:\n return int(st)+strs(st[1:])+strs(st[:-1])\n else:\n return int(st)\n\nprint(strs(a)+int(a[0])+int(a[-1])-int(a[len(a)//2]))', 'a=input()\ndef strs(st):\n if len(st)>1:\n return int(st)+strs(st[1:])+strs(st[:-1])+int(st[0])+int(st[-1])\n else:\n r... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s060420530', 's925186755', 's950179188'] | [3188.0, 3060.0, 9060.0] | [19.0, 18.0, 26.0] | [179, 189, 208] |
p04001 | u699994820 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["result = 0\ndef BT(k, current, s):\n global result\n if k >= len(a)-1 :\n if current == 0 :\n result += s\n print(k,current,s,result)\n else :\n BT(k+1, int(a[k+1]), s+current)\n BT(k+1, current* 10 + int(a[k+1]), s)\n\na = input()+'0'\nBT(0,int(a[0]),0)\nprint(result)\... | ['Wrong Answer', 'Accepted'] | ['s459011591', 's107400267'] | [3444.0, 3064.0] | [47.0, 44.0] | [305, 264] |
p04001 | u708378905 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['def dfs(splitted: "the list of integer", a: int, b: int, depth: int) -> int:\n if len(splitted) == depth:\n return a + b\n else:\n \n \n return dfs(splitted, a, b * 10, depth + 1) + dfs(s, a + b, splitted[i], depth + 1)\n\ns = [int(x) for x in input()]\nprint(dfs(s, 0, 0, 0))', 'def dfs(splitted: "the l... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s067808359', 's188802883', 's520278214', 's395820383'] | [3060.0, 3060.0, 3060.0, 3060.0] | [18.0, 18.0, 18.0, 18.0] | [394, 394, 401, 405] |
p04001 | u736524428 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s = input()\n\nmax_plus = len(s) - 1\n\nnumList = [int(c) for c in s]\n\nsMax = (1 << max_plus) - 1\n\nans = 0\n\nfor plus_pos in range(sMax + 1):\n sum = 0\n\n num = numList[0]\n\n for i in range(max_plus):\n if ((plus_pos >> i) & 1) == 1:\n sum += num\n num = numList[i + 1]\n ... | ['Runtime Error', 'Accepted'] | ['s128293605', 's815823123'] | [3060.0, 3064.0] | [17.0, 19.0] | [794, 398] |
p04001 | u750058957 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['S = input()\n# 125\ns = len(S)-1\nans=0\nfor bit in range(1 << s):\n a = S[0]\n for i in range(s):\n if bit & (1<<i):\n a += "+"\n a += S[i+1]\n print(a)\n ans += sum(map(int,a.split("+")))\nprint(ans)\n', 'S = input()\n# 125\ns = len(S)-1\nans=0\nfor bit in range(1 << s):\n a ... | ['Wrong Answer', 'Accepted'] | ['s817675969', 's762957884'] | [3060.0, 3060.0] | [22.0, 20.0] | [227, 214] |
p04001 | u752767312 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['S = input()\npower = len(S)-1\nloop = 2**power\n\nrevS = list(reversed(S))\nans = 0\n\nfor i in range(loop):\n ans += int(revS[0])\n multi_ten = 10\n for j in range(power):\n digit = bin(i>>j)[-1]\n if digit == "0":\n ans += int(revS[j+1])*multi_ten\n multi_ten *= 10\n ... | ['Wrong Answer', 'Accepted'] | ['s989323845', 's145016480'] | [3064.0, 3064.0] | [22.0, 22.0] | [373, 384] |
p04001 | u752907966 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s = input()\nn = len(s)\n\n\ndef dfs(i,f):\n if i == n-1:\n return sum(list(map(int,f.split("+"))))\n return dfs(i+1,f+s[i+1]) + dfs(i+2,f+"+"+s[i+1])\n \nprint(dfs(0,s[0]))', 's = input()\nn = len(s)\n\n\ndef dfs(i,f):\n if i == n-1:\n return sum(list(map(int,f.split("+"))))\n return dfs... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s606437836', 's773194913', 's953893518'] | [3060.0, 2940.0, 3060.0] | [18.0, 17.0, 18.0] | [444, 443, 175] |
p04001 | u765237551 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['from collections import defaultdict\nH, W, N = map(int, input().split())\nposs = [list(map(int, input().split())) for _ in range(N)]\nd = defaultdict(int)\nfor a, b in poss:\n for i, j in ((i, j) for i in range(a-1, a+2) for j in range(b-1, b+2)):\n if 1<i<H and 1<j<W:\n s = str(i)+":"+str(j)\n ... | ['Runtime Error', 'Accepted'] | ['s204489414', 's874538603'] | [3444.0, 3188.0] | [220.0, 44.0] | [454, 315] |
p04001 | u766407523 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["def search(s):\n if len(s) <= 1:\n return eval(s[0])\n return search([s[0]+s[1]]+s[2:]) + search([s[0]+'+'+s[1]]+s[2:])\nprint(search(input()))", "def pt(s: list):\n if len(s) = 1:\n return eval(s[0])\n return pt([s[0]+s[1]]+s[2:]) + pt([s[0]+'+'+s[1]]+s[2:])\nprint(pt(list((input()))))", "d... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s306038049', 's640815495', 's320884812'] | [3060.0, 2940.0, 3060.0] | [17.0, 17.0, 25.0] | [152, 149, 150] |
p04001 | u772614554 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['from sys import stdin\n\na = stdin.readline().rstrip()\nprint(a.upper())\nprint(output)', 'input = input()\noutput = 0\nprint(output)', 'x = str(input())\nans = 0\n\nfor i in range(1 << len(x)-1):\n print(bin(i))\n tmp = 0\n for j in range(0, len(x)-1):\n if (i>>j&1 == 0):\n continue;\n else:\n ans... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s088719497', 's282551552', 's546373952', 's786017070', 's892320582', 's897917022', 's954033486', 's472913759'] | [2940.0, 2940.0, 3060.0, 2940.0, 2940.0, 3060.0, 3060.0, 3060.0] | [17.0, 17.0, 21.0, 17.0, 17.0, 21.0, 23.0, 20.0] | [83, 40, 266, 36, 36, 274, 220, 238] |
p04001 | u773265208 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s = input()\n\nn = len(s)\n\nans = 0\nfor i in range(2**n):\n\tl = []\n\top = [""]*n\n\tfor j in range(n):\n\t\tif i & (1 << j):\n\t\t\top[j] = \'+\'\n\tprint(op)\n\tres = ""\n\tfor a,b in zip(op+[""],s):\n\t\tres += a+b\n\n\tans += eval(res)\n\nprint(ans//2)\n', 's = input()\n\nn = len(s)\n\nans = 0\nfor i in range(... | ['Wrong Answer', 'Accepted'] | ['s739941473', 's420155298'] | [3060.0, 3060.0] | [42.0, 39.0] | [226, 227] |
p04001 | u780475861 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['def powerset(iterable):\n s = list(iterable)\n return chain.from_iterable(combinations(s, r) for r in range(len(s) + 1))\n\n\ndef s_to_num(s):\n numlst = list(map(int, s))\n res = 0\n for i in numlst:\n res *= 10\n res += i\n return res\n\n\ns = input()\nlength = len(s)\nres = 0\nfor i... | ['Runtime Error', 'Accepted'] | ['s890846939', 's042670847'] | [3064.0, 3064.0] | [17.0, 22.0] | [520, 565] |
p04001 | u790487011 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['import sys\n\ns = tuple(sys.stdin.readline().rstrip())\n\nl = len(s)\n\nprint(l)\n\ndef op(n):\n if n == "0":\n return ""\n else:\n return "+"\n\n\nres = []\nfor i in range(2**(l-1)):\n \n ops = [op(x) for x in tuple(format(i*2, \'b\').zfill(l))]\n \n # print(s)\n # print(ops)\n\n eq = \'\'\n for num, ... | ['Wrong Answer', 'Accepted'] | ['s313460391', 's122115805'] | [3064.0, 3064.0] | [28.0, 28.0] | [372, 374] |
p04001 | u799428010 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['n=input()', 's=input()\nn=len(s)\ndef dfs(i,f):\n if i==n-1:\n return sum(list(map(int,f.split("+"))))\n return dfs(i+1,f+s[i+1])+dfs(i+1,f+ "+"+s[i+1]) \n\ndfs(0,s[0])', 'n=int(input())\nprint(1)', 'def total(n):\n if n < 1:\n return 0\n\n return n + total(n - 1)\n\nprint(total(100))', 's=i... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s015551352', 's365521215', 's567624722', 's646977322', 's135600207'] | [8984.0, 9108.0, 9012.0, 9016.0, 9032.0] | [27.0, 28.0, 29.0, 29.0, 27.0] | [9, 401, 23, 92, 408] |
p04001 | u825116851 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["\ndef solve(S):\n a = _iter(S, '')\n return a\n\n\ndef _iter(s, t):\n if s == '':\n if t.endswith('+'):\n return 0\n print(t)\n return eval(t)\n a = s[0]\n b = s[1:]\n return _iter(b, t+a) + _iter(b, t+a+'+')\n\n\nif __name__ == '__main__':\n S = input()\n print... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s225252105', 's263649038', 's078743966'] | [3060.0, 2940.0, 3064.0] | [17.0, 17.0, 25.0] | [357, 342, 344] |
p04001 | u825842302 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s = input()\nn = (len(s) - 1)\n\nans_lst = []\nfor i in range(2**n):\nop = ["+"] * n \n for j in range(n):\n if ((i >> j) & 1):\n op[n-j-1] = ""\n for num,opp in zip(s, op + [""]):\n formula += (num + opp)\n ans_lst = ans_lst + [eval(formula)]\n\nprint(sum(ans_lst))', 's = input()\nn... | ['Runtime Error', 'Accepted'] | ['s400893401', 's300867046'] | [2940.0, 3064.0] | [17.0, 29.0] | [287, 308] |
p04001 | u829269490 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['S = input()\n\nfrom itertools import combinations\n\ns = int(S)\nfor l in range(1, len(S)):\n print(l)\n for c in combinations(range(1, len(S)), l):\n c = sorted(c)\n n = [int(S[lower:upper]) for lower, upper in zip([0] + c, c + [len(S)])]\n s += sum(n)\n\nprint(s)\n', 'S = input()\n\nfrom ... | ['Wrong Answer', 'Accepted'] | ['s699107661', 's527462688'] | [3060.0, 3060.0] | [19.0, 19.0] | [281, 268] |
p04001 | u829895669 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['S = input()\nans = 0\nfor i in range(1 << (len(S)-1)):\n eq = S\n for j in range(len(S)-1):\n if i & (1 << j):\n eq = eq[:j+1] + "," + eq[j+1:]\n else:\n pass\n eq = eq.split(",")\n ans += sum(eq)\nprint(ans)', 'S = input()\nans = 0\nfor i in range(1 << (len(S)-1)):\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s013979946', 's215243534', 's949151603'] | [3060.0, 3060.0, 3064.0] | [17.0, 17.0, 21.0] | [245, 272, 304] |
p04001 | u835482198 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['def rec(s, start, d):\n if d == 0:\n return [s[start:]]\n\n cand = []\n for i in range(start + 1, len(s)):\n c = rec(s, i, d - 1)\n for cc in c:\n cand.append(s[start:i] + \'+\' + cc)\n return cand\n\n\ns = input()\n\n\n\nN = len(s)\ncnt = 0\nfor i in range(N):\n eqs = r... | ['Wrong Answer', 'Accepted'] | ['s638609072', 's031039966'] | [3060.0, 3064.0] | [19.0, 26.0] | [481, 481] |
p04001 | u836939578 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s=input()\n\nop_n=len(s) - 1\n\nans=0\n\nfor i in range(1 << len(s)):\n sign = [""] * op_n\n for j in range(op_n):\n if ((i>>j)==1):\n sign[j] = "+"\n formula = ""\n for k in range(op_n):\n formula += s[k] + sign[k]\n formula += s[op-n] \n ans += eval(formula)\nprint(ans) \n \n \n ', '... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s039193208', 's050608083', 's086095887', 's260196335', 's584974429', 's605514735', 's760799827'] | [3060.0, 3064.0, 3060.0, 3060.0, 3060.0, 3060.0, 3060.0] | [18.0, 18.0, 17.0, 17.0, 17.0, 17.0, 27.0] | [295, 301, 298, 295, 297, 294, 298] |
p04001 | u840974625 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s = input()\nn = len(s)\n\nres = 0\n\ndef part_sum(cur, i):\n if i != n:\n res += part_sum(cur+s[i], i+1)\n res += part_sum(cur+s[i]+"+", i+1)\n else:\n cur += s[i]\n return sum(list(map(int, cur.split("+")))) \n \npart_sum("", 0)\nprint(res)', 's = input()\nn = len(s)\n\n\ndef part_sum(cur, i, s, res)... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s229654685', 's271259775', 's275949815', 's338178140', 's965140916', 's062689736'] | [3060.0, 3956.0, 3060.0, 3060.0, 3064.0, 3064.0] | [17.0, 31.0, 17.0, 18.0, 17.0, 18.0] | [243, 342, 229, 229, 229, 291] |
p04001 | u841621946 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s = input()\ndef calc(s,op):\n ans = 0\n tmp = 0\n for i in range(len(s)):\n tmp += int(s[i])\n if i == len(s) - 1:\n ans += tmp\n break\n if op[i] == 0:\n tmp = tmp * 10\n else:\n ans += tmp\n tmp = 0\n return ans \ni_max ... | ['Wrong Answer', 'Accepted'] | ['s800684369', 's561952534'] | [3064.0, 3064.0] | [21.0, 22.0] | [467, 478] |
p04001 | u853952087 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["s=int(input())\nS=str(s)\nw=len(str(s))-1\nl=[]\nL=[]\nfor i in range(2**w):\n l.append(format(i, '0{}b'.format(w)))\nfor e in l:\n q=[]\n x=int(S[0])\n for i in range(len(e)):\n if e[i]=='0':\n x=x*10+int(S[i+1])\n else:\n q.append(x)\n x=int(S[i+1])\n q.... | ['Runtime Error', 'Accepted'] | ['s055830081', 's547957035'] | [3064.0, 3064.0] | [18.0, 21.0] | [345, 592] |
p04001 | u866769581 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['\ns = input() \nS = [_ for _ in s]\nN = len(S)-1\nans_lis = []\npra_lis = []\ncalis = []\nfor x in range(2**N):\n lis = [\'\'] * (N)\n for y in range(N):\n if((x >> y) & 1):\n lis[N-1-y] = "+"\n pra_lis.append(lis)\nfor z in pra_lis:\n z.append(\'\')\n for x in range(len(S)):\n ... | ['Wrong Answer', 'Accepted'] | ['s238819842', 's625827300'] | [3880.0, 3188.0] | [32.0, 23.0] | [742, 739] |
p04001 | u868982936 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['from itertools import *\nA = list(map(int, list(input()))\n\nans = 0\nN = len(A)-1\nfor p in product([0,1], repeat = N):\n\tnow = A[0]\n for i in range(N):\n if p[i] == 0:\n now = now*10 + A[i+1]\n else:\n ans += now\n now = A[i+1]\n\tans += now\nprint(ans) \n', 'from itertools im... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s167356373', 's235664174', 's289765373', 's693084327', 's870942044'] | [2940.0, 2940.0, 2940.0, 2940.0, 3060.0] | [17.0, 17.0, 17.0, 17.0, 19.0] | [280, 279, 273, 277, 294] |
p04001 | u872887731 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['from itertools import product\nS = input()\nans = 0\n\nfor string in product(["","+"],repeat=len(S) - 1):\n string = list(string)\n string.append("")\n sum_ = [a + b for a,b in zip(S,string)]\n ans += sum_\n\nprint(ans)', 'from itertools import product\nS = input()\nans = 0\n\nfor string in product(["","+... | ['Runtime Error', 'Accepted'] | ['s507392584', 's640415772'] | [3060.0, 3060.0] | [18.0, 26.0] | [221, 236] |
p04001 | u875449556 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ["S = input()\n\nx = len(S)-1\n\ns = 0\nfor i in range(1 << x):\n t = 0\n for j in range(x):\n if ((i >> j) & 1 == 1):\n s += int(''.join(s[t:j+1]))\n t = j+1\n s = int(''.join(s[t:]))\nprint(s)", "S = input()\n\nx = len(S)-1\n\ns = 0\nfor i in range(1 << x):\n t = 0\n for j ... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s229170412', 's276633425', 's358215653', 's384895029', 's827297323', 's888010542', 's191172788'] | [3060.0, 3060.0, 3060.0, 2940.0, 3060.0, 3060.0, 2940.0] | [17.0, 19.0, 35.0, 17.0, 19.0, 17.0, 21.0] | [218, 219, 216, 198, 217, 219, 213] |
p04001 | u884323674 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['S = input()\n\ndef div_plus(i, s):\n if i == len(S):\n s_list = [int(i) for i in s.split("+")]\n return sum(s_list)\n \n pos = i - len(S)\n \n d1 = div_plus(i+1, s)\n \n \n d2 = div_plus(i+1, s[:pos]+"+"+s[pos:])\n return d1 + d2\n\ndiv_plus(1, S)', 'S = input()\n\ndef rec(n, ... | ['Wrong Answer', 'Accepted'] | ['s680946602', 's704874177'] | [3060.0, 3060.0] | [19.0, 17.0] | [340, 284] |
p04001 | u884601206 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['s=input()\nt=len(s)-1\nsl=[s[i] for i in range(len(s))]\nanswers=[]\n\nfor i in range(2**t):\n tmp=[]\n for j in range(t):\n if (i>>j)&1:\n tmp.append(j)\n ll=[\'*\'] * len(s)\n for k in tmp:\n ll[k]="+"\n ans=[]\n \n for k,_in zip(sl,ll):\n ans.append(k)\n ans.append(_)\n ans=[_ for _ in ans... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s776511816', 's988880783', 's381414814'] | [2940.0, 2940.0, 3064.0] | [17.0, 17.0, 23.0] | [465, 470, 466] |
p04001 | u886730634 | 2,000 | 262,144 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | ['n=input()\nl=len(n)\n\nans=0\nfor i in range(2**(l-1)):\n x=n[0]\n for j in range(l-1):\n if((i<<j)&1):\n x+="+"\n x+=n[j+1]\n ans+=eval(x)\n \nprint(ans)', 'n=input()\nl=len(n)\n\nans=0\nfor i in range(2**(l-1)):\n x=n[0]\n for j in range(l-1):\n if((i>>j)&1):\n x+="+"\n x+=n[j+1]\n ans+... | ['Wrong Answer', 'Accepted'] | ['s470305022', 's981329058'] | [3060.0, 3060.0] | [23.0, 27.0] | [157, 157] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.