s_id string | p_id string | u_id string | date string | language string | original_language string | filename_ext string | status string | cpu_time string | memory string | code_size string | code string | error string | stdout string |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s686970673 | p04001 | u112315075 | 1588215026 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 365 | import sys
S = list(map(int, sys.stdin.readline()))
len_S = len(S)
ans = 0
for i in range(2 ** (len_S - 1)):
sum_ = S[len_S - 1]
cursor = len_S - 1
power = 0
pattern = i
while cursor > 0:
cursor -= 1
if pattern % 2 == 1:
power += 1
else:
power = 0
sum_ += S[cursor] * (10 ** power)
pattern //= 2
ans += sum_
print(ans)
| Traceback (most recent call last):
File "/tmp/tmpbdn_nhh1/tmprmsyj8ck.py", line 6, in <module>
for i in range(2 ** (len_S - 1)):
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'float' object cannot be interpreted as an integer
| |
s029587544 | p04001 | u112315075 | 1588214372 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 365 | import sys
S = list(map(int, sys.stdin.readline()))
len_S = len(S)
ans = 0
for i in range(2 ** (len_S - 1)):
sum_ = S[len_S - 1]
cursor = len_S - 1
power = 0
pattern = i
while cursor > 0:
cursor -= 1
if pattern % 2 == 1:
power += 1
else:
power = 0
sum_ += S[cursor] * (10 ** power)
pattern >>= 1
ans += sum_
print(ans)
| Traceback (most recent call last):
File "/tmp/tmpjtchafn2/tmpb9hcnf4w.py", line 6, in <module>
for i in range(2 ** (len_S - 1)):
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'float' object cannot be interpreted as an integer
| |
s043977446 | p04001 | u112315075 | 1588213771 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 356 | import sys
S = list(map(int, list(sys.stdin.readline())))
len_S = len(S)
ans = 0
for i in range(2 ** (len_S - 1)):
sum_ = S[len_S - 1]
cursor = len_S - 1
power = 0
while cursor > 0:
cursor -= 1
if i % 2 == 1:
power += 1
else:
power = 0
sum_ += S[cursor] * (10 ** power)
i >>= 1
ans += sum_
print(ans)
| Traceback (most recent call last):
File "/tmp/tmp8zhavd6o/tmp42t3v0qn.py", line 6, in <module>
for i in range(2 ** (len_S - 1)):
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'float' object cannot be interpreted as an integer
| |
s544840277 | p04001 | u112315075 | 1588213609 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 350 | import sys
S = list(map(int, sys.stdin.readline()))
len_S = len(S)
ans = 0
for i in range(2 ** (len_S - 1)):
sum_ = S[len_S - 1]
cursor = len_S - 1
power = 0
while cursor > 0:
cursor -= 1
if i % 2 == 1:
power += 1
else:
power = 0
sum_ += S[cursor] * (10 ** power)
i >>= 1
ans += sum_
print(ans)
| Traceback (most recent call last):
File "/tmp/tmp63rdetqw/tmpuzzdq4ib.py", line 6, in <module>
for i in range(2 ** (len_S - 1)):
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'float' object cannot be interpreted as an integer
| |
s227621000 | p04001 | u344065503 | 1588193881 | Python | PyPy3 (2.4.0) | py | Runtime Error | 166 | 38256 | 165 | def dfs(i,f):
if i == n-1:
return sum(list(map(int,f.split("+"))))
return dfs(i+1,f+s[i+1])+\dfs(i+1,f+"+"+s[i+1])
s= input()
n=len(s)
print(dfs(0,s[0]))
| File "/tmp/tmpwwjyak6w/tmp5y7wpa8v.py", line 4
return dfs(i+1,f+s[i+1])+\dfs(i+1,f+"+"+s[i+1])
^
SyntaxError: unexpected character after line continuation character
| |
s845162495 | p04001 | u892487306 | 1588081275 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 680 | S = input()
N = len(S)
plus_flag = [0] * (N - 1)
def calc(flags):
val = 0
num_begin_index = 0
num_end_index = None
for flag_index in range(len(flags)):
if flags[flag_index] == 0:
continue
num_end_index = flag_index + 1
val += int(S[num_begin_index:num_end_index])
num_begin_index = num_end_index
num_end_index = len(flags) + 1
val += int(S[num_begin_index:num_end_index])
return val
def calc_sum(index, flag):
plus_flag[index] = flag
if index == len(plus_flag) - 1:
return calc(plus_flag)
return calc_sum(index + 1, 0) + calc_sum(index + 1, 1)
print(calc_sum(0, 0) + calc_sum(0, 1)) | Traceback (most recent call last):
File "/tmp/tmp_4_efwtq/tmpj2h6k1r6.py", line 1, in <module>
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s208453955 | p04001 | u114099505 | 1587950876 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 162 | def dfs(i,Str):
if i==n:
return sum(map(int,Str.split()))
return dfs(i+1,Str+S[i+1])+dfs(i+1,Str+"+"+S[i+1])
S=input()
n=len(S)
print(dfs(0,S[0])) | Traceback (most recent call last):
File "/tmp/tmpstoam6a5/tmpqhtft2xg.py", line 5, in <module>
S=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s011526464 | p04001 | u749071216 | 1587649074 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 833 | import itertools
import math
n=str(input())
s=list(n)
#print(s)
data=[i for i in range(len(n)-1)]
print(data)
combi=list(itertools.product(data, repeat=2))
#print(combi)
#print(type(combi))
data_r = ["+" if i == 1 else i for i in data]
data_r2 = ["" if i == 0 else i for i in data_r]
#print(data_r2)
combi_r2=list(itertools.product(data_r2, repeat=2))
#print(combi_r2)
#print(type(combi_r2))
gokei=0
for i in range(len(combi_r2)):
sushiki=""
for j in range(len(list(n))-1):
sushiki=sushiki+s[j]+combi_r2[i][j]
#print(s[j])
sushiki=sushiki+s[-1]
#print(sushiki)
#print("_",combi_r2[i][0],"_",combi_r2[i][1],"_")
bun=sushiki.split("+")
bun_int = [int(n) for n in bun]
ans=sum(bun_int)
#print(bun_int)
#print(ans)
gokei=gokei+ans
#print("============")
print(gokei) | Traceback (most recent call last):
File "/tmp/tmp1bps4nxw/tmp2158can8.py", line 3, in <module>
n=str(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s493060595 | p04001 | u130203301 | 1587540707 | Python | PyPy3 (2.4.0) | py | Runtime Error | 182 | 38256 | 303 |
def fun(s):
n = len(s)
ans = 0
for bit in range(1 << (n-1)):
f = s[0]
for i in range(n-1):
if bit & (1 << i):
print(1 << i)
f += "+"
f += s[i+1]
ans += sum(map(int, f.split('+')))
return ans
print(fun(s)) | Traceback (most recent call last):
File "/tmp/tmp7xhja2ki/tmp_0m8se1m.py", line 16, in <module>
print(fun(s))
^
NameError: name 's' is not defined
| |
s840134770 | p04001 | u411858517 | 1587493958 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 1108 | import itertools
def solve(S):
'''
数字の間に+を入れるパターンと入れないパターンを全てチェックする
125であれば、 125, 1+25, 12+5, 1+2+5
+が入る可能性のある場所は右の通り、 1 |ここ!| 2 |ここ!| 5
よって、組み合わせは 2 ** (文字列数 - 1)
'''
count = 0
bit_list = list(itertools.product([0, 1], repeat=len(S)-1))
for pattern in bit_list:
'''
ビットの値が1の時に+が入ると考えて、0の時は入らない
文字列を先頭から調べていき、次の文字との間に+が入る場合、そこまでの文字列をint型に変換して変数「count」に加算する
'''
start = 0
for end in range(len(pattern)):
if pattern[end] == 1:
count += int(S[start:end+1])
start = end + 1
if end == len(bit) - 1:
count += int(S[start:])
print(count)
if __name__ == '__main__':
S = input()
solve(S) | File "/tmp/tmpq06og_kd/tmpwag_hm0w.py", line 18
start = 0
^
IndentationError: unindent does not match any outer indentation level
| |
s379777195 | p04001 | u263753244 | 1587413673 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 531 | print(l)
indexes=[[] for _ in range(2**(n-1))]
for k in range(2**(n-1)):
indexes[k]=[i for i, x in enumerate(l[k]) if x == 1]
#print(indexes)
SUM=0
for j in range(2**(n-1)):
L=len(indexes[j])
if L==0:
SUM+=int(s)
#print(SUM)
else:
SUM+=int(s[:indexes[j][0]+1])
#print(SUM)
SUM+=int(s[indexes[j][L-1]+1:])
#print(SUM)
if L>1:
for h in range(L-1):
SUM+=int(s[indexes[j][h]+1:indexes[j][h+1]+1])
#print(SUM)
print(SUM) | Traceback (most recent call last):
File "/tmp/tmp8zqa9yf6/tmpf6xc5azs.py", line 1, in <module>
print(l)
^
NameError: name 'l' is not defined
| |
s776511816 | p04001 | u884601206 | 1586917986 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 465 | s=input()
t=len(s)-1
sl=[s[i] for i in range(len(s))]
answers=[]
for i in range(2**t):
tmp=[]
for j in range(t):
if (i>>j)&1:
tmp.append(j)
ll=['*'] * len(s)
for k in tmp:
ll[k]="+"
ans=[]
for k,_in zip(sl,ll):
ans.append(k)
ans.append(_)
ans=[_ for _ in ans if _ != "*"]
ans=''.join(ans)
ans=ans.split('+')
ans=[int(k) for k in ans if k != '+']
ans=sum(ans)
answers.append(ans)
print(sum(answers))
| File "/tmp/tmpz0v9by0n/tmpsy4lsc1f.py", line 16
for k,_in zip(sl,ll):
^^^
SyntaxError: invalid syntax
| |
s988880783 | p04001 | u884601206 | 1586917925 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 470 | s=str(input())
t=len(s)-1
sl=[s[i] for i in range(len(S))]
answers=[]
for i in range(2**t):
tmp=[]
for j in range(t):
if (i>>j)&1:
tmp.append(j)
ll=['*'] * len(s)
for k in tmp:
ll[k]="+"
ans=[]
for k,_in zip(sl,ll):
ans.append(k)
ans.append(_)
ans=[_ for _ in ans if _ != "*"]
ans=''.join(ans)
ans=ans.split('+')
ans=[int(k) for k in ans if k != '+']
ans=sum(ans)
answers.append(ans)
print(sum(answers))
| File "/tmp/tmpuq4zfwqb/tmpudznnd_v.py", line 16
for k,_in zip(sl,ll):
^^^
SyntaxError: invalid syntax
| |
s888010542 | p04001 | u875449556 | 1586708522 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 219 | S = input()
x = len(S)-1
s = 0
for i in range(1 << x):
t = 0
for j in range(x):
if ((i >> j) & 1 == 1):
s += int(''.join(s[t:j+1]))
t = j+1
s += int(''.join(s[t:]))
print(s) | Traceback (most recent call last):
File "/tmp/tmp65d7w8eb/tmphhrvp1ef.py", line 1, in <module>
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s229170412 | p04001 | u875449556 | 1586708485 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 218 | S = input()
x = len(S)-1
s = 0
for i in range(1 << x):
t = 0
for j in range(x):
if ((i >> j) & 1 == 1):
s += int(''.join(s[t:j+1]))
t = j+1
s = int(''.join(s[t:]))
print(s) | Traceback (most recent call last):
File "/tmp/tmpx38ejrhk/tmprp98x29h.py", line 1, in <module>
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s384895029 | p04001 | u875449556 | 1586665690 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 198 | S = input()
x = len(S)-1
a = 0
b = 0
s = 0
for i in range(1 << x):
for j in range(x):
if ((i >> j) & 1 == 1):
b = j
s += int(S[a:b])
a = j
print(s) | Traceback (most recent call last):
File "/tmp/tmpc2im_p3d/tmpvx5ia7mu.py", line 1, in <module>
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s830196095 | p04001 | u674959776 | 1586581470 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 163 | s=int(input())
n=len(s)
sum=0
for i in range(1<<n-1):
t=0
for j in range(n-1):
if i & (1<<j):
sum += int("".join(s[t:j+1]))
t = j+1
print(sum) | Traceback (most recent call last):
File "/tmp/tmpfqsb6cu8/tmphbtnaa5m.py", line 1, in <module>
s=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s369928477 | p04001 | u673361376 | 1586154825 | Python | PyPy3 (2.4.0) | py | Runtime Error | 192 | 38896 | 274 | S = input()
N = len(S)
ans = 0
for i in range(2 ** (N - 1)):
signs = bin(i)[2:].zfill(N - 1).replace('0', '+').replace('1', ' ')
tmp_s = S[0]
for j, sign in enumerate(signs):
tmp_s += sign + S[j + 1]
ans += eval(tmp_s.replace(' ', ''))
print(ans)
| Traceback (most recent call last):
File "/tmp/tmp3nzehlc_/tmpu061f7jr.py", line 1, in <module>
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s321282906 | p04001 | u538808095 | 1585881314 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 667 | S = input()
n = len(S)
S_list = [int(S[0]), int(S[1]), int(S[2]), int(S[3])]
#1... - 0...+
def bit_to_notation(bit):
bitlist = [0 for i in range(n-1)]
for i in range(n-1):
if ((bit >> i) == 1):
bitlist[n-2-i] = "-"
else:
bitlist[n-2-i] = "+"
return bitlist
notation = 2 ** (n-1)
for bit in range(notation):
sum4 = 0
for j in range(n):
if((bit >> j) & 1):
sum4 -= S_list[n-1-j]
else:
sum4 += S_list[n-1-j]
if(sum4 == 7):
bitlist = bit_to_notation(bit)
print(str(S_list[0]) + bitlist[0] + str(S_list[1]) + bitlist[1]
+ str(S_list[2]) + bitlist[2] + str(S_list[3]) + "=7)
break | File "/tmp/tmpyue3lq_0/tmpc55xrp_j.py", line 29
+ str(S_list[2]) + bitlist[2] + str(S_list[3]) + "=7)
^
SyntaxError: unterminated string literal (detected at line 29)
| |
s884921246 | p04001 | u016881126 | 1585806810 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3064 | 642 | import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
S_int = int(readline())
S_str = str(S_int)
pattern = []
fmt = '0' + str(len(S_str)-1) + 'b'
for i in range(2**(len(S_str)-1)):
pattern.append(format(i, fmt))
answer = 0
for plus_flags in pattern:
tmp = []
tmp_str = S_str[0]
for i, is_plus in enumerate(plus_flags, start=1):
if is_plus == "1":
tmp.append(int(tmp_str))
tmp_str = ""
tmp_str += S_str[i]
if tmp_str:
tmp.append(int(tmp_str))
answer += sum(tmp)
print(answer) | Traceback (most recent call last):
File "/tmp/tmplweofbdp/tmpr9mis0mx.py", line 7, in <module>
S_int = int(readline())
^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: b''
| |
s165271847 | p04001 | u916069341 | 1584593960 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 13 | total = 0 | File "/tmp/tmp48rds9d9/tmp4uiuymwy.py", line 1
total = 0
IndentationError: unexpected indent
| |
s544892399 | p04001 | u078932560 | 1584394329 | Python | Python (3.4.3) | py | Runtime Error | 122 | 61416 | 372 | import sys
sys.setrecursionlimit(10000)
s = list(input())
n = len(s)-1
ans = 0
def rec(plus):
if len(plus) == n:
global ans
si = s[0]
for i in range(n):
if plus[i] == '-':
si += s[i+1]
else:
ans = ans + int(si)
si = s[i+1]
ans = ans + int(si)
else:
rec(plus+'-')
rec(plus+'+')
rec('-')
rec('+')
print(ans) | Traceback (most recent call last):
File "/tmp/tmp8r4wg76u/tmp1hn74yq3.py", line 4, in <module>
s = list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s344816004 | p04001 | u078932560 | 1584394276 | Python | Python (3.4.3) | py | Runtime Error | 78 | 6904 | 371 | import sys
sys.setrecursionlimit(2000)
s = list(input())
n = len(s)-1
ans = 0
def rec(plus):
if len(plus) == n:
global ans
si = s[0]
for i in range(n):
if plus[i] == '-':
si += s[i+1]
else:
ans = ans + int(si)
si = s[i+1]
ans = ans + int(si)
else:
rec(plus+'-')
rec(plus+'+')
rec('-')
rec('+')
print(ans) | Traceback (most recent call last):
File "/tmp/tmphttm9bh9/tmp30fwx0xm.py", line 4, in <module>
s = list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s695710848 | p04001 | u451013395 | 1584357305 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 465 | target=input()
n = len(target)-1
bit_list = [list(f"{i:0{n}b}") for i in range(2**n)]
answer = 0
for bits in bit_list:
one_number_indexes=[i for i, x in enumerate(bits) if x == '1']
# ここで1がある場所を取得
start=0
# 街灯の箇所で文字を区切る関数を実装
for index in one_number_indexes:
answer=answer+int(target[start:index+1])
start=index+1
answer=answer+int(target[start:n+1])
print(answer) | Traceback (most recent call last):
File "/tmp/tmprcjhxiss/tmpvtw8bsai.py", line 1, in <module>
target=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s735265750 | p04001 | u446371873 | 1584153319 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 212 | s = input()
l = len(s)
ans = 0
for i in range(2**(l-1)):
eval = ''
for j in range(l):
if ((i >> j) & 1):
eval += s[j] + '+'
else:
eval += s[j]
ans += eval(eval) | Traceback (most recent call last):
File "/tmp/tmpcaqgx676/tmpnbg5kx68.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s846215152 | p04001 | u446371873 | 1584138957 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 103 | s = input()
ans = 0
for i in range(s):
ans += int(s[0:i]) + int(s[i:len(s)])
ans += int(s)
print(ans) | Traceback (most recent call last):
File "/tmp/tmpfz0mmyus/tmpprz0drp9.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s523792607 | p04001 | u451013395 | 1584099972 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 499 | # coding: utf-8
# Your code here!
target=input()
n = len(target)-1
bit_list = [list(f"{i:0{n}b}") for i in range(2**n)]
answer = 0
for bits in bit_list:
one_number_indexes=[i for i, x in enumerate(bits) if x == '1']
# ここで1がある場所を取得
start=0
# 街灯の箇所で文字を区切る関数を実装
for index in one_number_indexes:
answer=answer+int(target[start:index+1])
start=index+1
answer=answer+int(target[start:n+1])
print(answer) | Traceback (most recent call last):
File "/tmp/tmp18g80vhl/tmpz027zg_p.py", line 3, in <module>
target=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s076843565 | p04001 | u699458609 | 1583898666 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 550 | #include <bits/stdc++.h>
using namespace std;
int *dec2bin(int decimal, int *binary, size_t size){
for(i=0; decimal>0; i++){
binary[i] = decimal % 2 * pow(10, i);
decimal = decimal / 2;
}
return binary;
}
int main() {
string S;
cin >> S;
int sum = 0;
int num_cases = pow(2, S.size()-1);
vector<int> binary(num_cases);
dec2bin(18, binary, 6);
/*
for(int i=0; i<num_cases; i++){
string str_bin = to_string(dec2bin(i));
for(int j=0; j<S.size(); j++){
}
}*/
cout << "Hello, world!" << endl;
} | File "/tmp/tmpj4blz3jt/tmpulivrmeo.py", line 2
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s447367419 | p04001 | u113991073 | 1583876707 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3056 | 186 | _ = "_"
def solve(s):
if _ in s:#in関数
return solve(s.replace(_,"+",1))+solve(s,replace(_,"",1))
else:
return eval(s)
s=_.join(list(input()))
print(solve(s)) | Traceback (most recent call last):
File "/tmp/tmpwvyrzng4/tmp_0ev5c30.py", line 9, in <module>
s=_.join(list(input()))
^^^^^^^
EOFError: EOF when reading a line
| |
s853749744 | p04001 | u433195318 | 1583771387 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 2110 | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string.h>
#include <string>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <math.h>
#include <algorithm>
#include <numeric>
using namespace std;
// マクロ&定数 ============================================================
typedef unsigned int uint;
typedef long long ll;
//typedef pair<int, int> P;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<bool> vbool;
typedef vector<string> vstring;
typedef vector<pair<int, int>> vpint;
typedef vector<pair<ll, ll>> vpll;
typedef vector<pair<double, double>> vpdouble;
typedef vector<vector<int>> vvint;
typedef vector<vector<ll>> vvll;
typedef vector<vector<double>> vvdouble;
typedef vector<vector<bool>> vvbool;
const int c_YET = -1;
const int INF = 1e9 + 1;
const ll LLINF = 1e17 + 1;
const int DX[9] = { 0,0,1,-1, 1, 1, -1, -1, 0 }; // 4;4近傍
const int DY[9] = { 1,-1,0,0, 1, -1, 1, -1, 0 }; // 8:8近傍 9:(0,0)を含む
const ll MOD = 1e9 + 7; //10^9 + 7
const ll MAX = 1e9;
const double PI = 3.14159265358979323846264338327950288;
//========================================================================
int main() {
//==================================
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
cout << fixed << setprecision(30);
//==================================
string S;
cin >> S;
ll ans = 0;
ll size = S.length();
vll N(size);
for (ll i = 0; i < size; i++) {
N[i] = ll(S[i]) - 48;
}
ll time = 0;
for (ll bit = 0; bit < (1<<size-1) ; bit++) {
ll local = 0;
for (ll i = 0; i < size-1; i++) {
local *= 10;
local += N[i];
if ((bit >> (size - 2 - i)) & 1) {
ans += local;
local = 0;
if (i == size - 2) {
ans += local + N[i + 1];
local = 0;
}
}
else {
if (i == size - 2) {
local *= 10;
ans += local + N[i + 1];
local = 0;
}
}
}
time++;
}
if (size == 1) {
cout << S;
return 0;
}
cout << ans << endl;
}
| File "/tmp/tmpfhryxf_1/tmpsqxe2uwk.py", line 42
const int DX[9] = { 0,0,1,-1, 1, 1, -1, -1, 0 }; // 4;4近傍
^
SyntaxError: invalid character '4' (U+FF14)
| |
s383414696 | p04001 | u492447501 | 1583627845 | Python | Python (3.4.3) | py | Runtime Error | 27 | 3064 | 270 | import sys
S = input()
N = len(S)-1
sum = 0
for i in range(2**N):
op = [""]*(N)
for j in range(N):
if (i>>j)&1:
op[j] = "+"
s = ""
for j in range(N):
s = s + S[j] + op[j]
s = s + S[j]
sum = sum + eval(s)
print(sum) | Traceback (most recent call last):
File "/tmp/tmpqugm764n/tmpwpqzb8r9.py", line 3, in <module>
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s390372689 | p04001 | u891504219 | 1583469539 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3064 | 699 | def main():
#import sys
#input = sys.stdin.readline
S = input()
S_list = list(S)
dig = len(S) - 1
insert_plus = format(0,"0"+str(dig)+"b")
insert_plus_max = "1"*len(insert_plus)
s = 0
for i in range(int(insert_plus_max,2)+1):
before = 0
num_list = []
now = format(i,"0"+str(dig)+"b")
for j in range(len(now)):
if now[j] == "1":
num_list.append("".join(S_list[before:int(j)+1]))
before = j+1
if j == len(now)-1:
num_list.append("".join(S_list[before:]))
for num in num_list:
s += int(num)
print(s)
if __name__ == "__main__":
main() | Traceback (most recent call last):
File "/tmp/tmpk3ph40b9/tmphxzr5w8u.py", line 25, in <module>
main()
File "/tmp/tmpk3ph40b9/tmphxzr5w8u.py", line 4, in main
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s616971222 | p04001 | u235783479 | 1583464268 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 500 | s = input()
# print(s)
score = 0
for blocksize in range(1,len(s)+1):
for startpoint in range(len(s)):
# print("hi", startpoint+blocksize)
if startpoint+blocksize >= (len(s)+1): continue
block = s[startpoint:startpoint+blocksize]
ss = int(block) * math.factorial(startpoint) * math.factorial(len(s) - (startpoint+blocksize))
# print("{} ({}, {}): {}".format(block, startpoint, len(s) - (startpoint + blocksize), ss))
score += ss
print(score)
exit() | Traceback (most recent call last):
File "/tmp/tmpkmuspo07/tmpmzxt6i1r.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s031232088 | p04001 | u540698208 | 1583271141 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 323 | import itertools
s = input()
n = [i for i in s]
ans = 0
for i in range(len(n)):
for j in itertools.combinations(range(len(n)-1, i)):
temp = [i for i in s]
for k in j[::-1]:
temp.insert(k+1, "+")
temp = "".join(temp)
temp = temp.split("+")
temp = map(int, temp)
ans += sum(temp)
print(ans) | Traceback (most recent call last):
File "/tmp/tmpk1sl5r_v/tmp_p09e2mw.py", line 3, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s333587549 | p04001 | u370429695 | 1583252490 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 188 | def dfs(i, sum):
if i == len(s) - 1:
return sum(list(map(int,sum.split("+"))))
return dfs(i+1, sum + s[i+1]) + dfs(i+1, sum + "+" + s[i+1])
s = input()
print(dfs(0,s[0])) | Traceback (most recent call last):
File "/tmp/tmpgtwgubtj/tmpiqavl29s.py", line 7, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s905126821 | p04001 | u928784113 | 1582044058 | Python | Python (3.4.3) | py | Runtime Error | 171 | 13704 | 2277 | import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
from fractions import gcd
from copy import deepcopy
import math
import queue
import numpy as np
#import sympy as syp(素因数分解とか)
Mod = 1000000007
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
def sieve_of_eratosthenes(n):
if not isinstance(n,int):
raise TypeError("n is not int")
if n<2:
raise ValueError("n is not effective")
prime = [1]*(n+1)
for i in range(2,int(math.sqrt(n))+1):
if prime[i] == 1:
for j in range(2*i,n+1):
if j%i == 0:
prime[j] = 0
res = []
for i in range(2,n+1):
if prime[i] == 1:
res.append(i)
return res
def factorial(i):
if i == 1:
return 1
else:
return i*factorial(i-1)
class UnionFind:
def __init__(self,n):
self.parent = [i for i in range(n+1)]
self.rank = [0 for i in range(n+1)]
def findroot(self,x):
if x == self.parent[x]:
return x
else:
y = self.parent[x]
y = self.findroot(self.parent[x])
return y
def union(self,x,y):
px = self.findroot(x)
py = self.findroot(y)
if px < py:
self.parent[py] = px
else:
self.parent[px] = py
def same_group_or_no(self,x,y):
return self.findroot(x) == self.findroot(y)
def main(): #startline--------------------------------------------
s = input()
sl = [i for i in s]
n = len(s)-1
ans = []
anslist = []
sublist = [-1]*n
for i in range(1 << n):
for j in range(n):
if (i>>j)&1:
sublist[j] = "+"
anslist.append(sl[0])
for j in range(n):
if sublist[j] == "+":
anslist.append("+")
anslist.append(sl[j+1])
else:
anslist.append(sl[j+1])
ans.append(eval("".join(anslist)))
anslist = []
sublist = [-1]*n
print(sum(ans))
if __name__ == "__main__":
main()
#endline===============================================
| Traceback (most recent call last):
File "/tmp/tmpnhcq19ze/tmp1ag7ltpq.py", line 6, in <module>
from fractions import gcd
ImportError: cannot import name 'gcd' from 'fractions' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/fractions.py)
| |
s364272345 | p04001 | u928784113 | 1581527553 | Python | Python (3.4.3) | py | Runtime Error | 38 | 5172 | 2238 | import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
import math
import queue
#import numpy as np
#import sympy as syp(素因数分解とか)
Mod = 1000000007
import sys
sys.setrecursionlimit(100000)
def sieve_of_eratosthenes(n):
if not isinstance(n,int):
raise TypeError("n is not int")
if n<2:
raise ValueError("n is not effective")
prime = [1]*(n+1)
for i in range(2,int(math.sqrt(n))+1):
if prime[i] == 1:
for j in range(2*i,n+1):
if j%i == 0:
prime[j] = 0
res = []
for i in range(2,n+1):
if prime[i] == 1:
res.append(i)
return res
def factorial(i):
if i == 1:
return 1
else:
return i*factorial(i-1)
class UnionFind:
def __init__(self,n):
self.parent = [i for i in range(n+1)]
self.rank = [0 for i in range(n+1)]
def findroot(self,x):
if x == self.parent[x]:
return x
else:
y = self.parent[x]
y = self.findroot(self.parent[x])
return y
def union(self,x,y):
px = self.findroot(x)
py = self.findroot(y)
if px < py:
self.parent[py] = px
else:
self.parent[px] = py
def same_group_or_no(self,x,y):
return self.findroot(x) == self.findroot(y)
def main(): #startline--------------------------------------------
s = input()
sl = [i for i in s]
n = len(s)-1
sublist = [-1]*n
anslist = []
ans = []
for i in range(1<<n):
for j in range(n):
if (i>>j)&1:
sublist[j] = "+"
anslist.append(sl[0])
for j in range(n):
if sublist[j] == "+":
anslist.append(sublist[j])
anslist.append(sl[j+1])
else:
anslist.append(sl[j+1])
ans.append(eval("".join(anslist)))
anslist = []
sublist = []
print(sum(ans))
if __name__ == "__main__":
main() #endline===============================================
| Traceback (most recent call last):
File "/tmp/tmpw_wb2vrf/tmp1d5esoy_.py", line 6, in <module>
from fractions import gcd
ImportError: cannot import name 'gcd' from 'fractions' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/fractions.py)
| |
s377477182 | p04001 | u150985282 | 1581408583 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 72 | S = input()
[s1, s2] = S.split("+")
[s1, s2] = list(map(int, [s1, s2])) | Traceback (most recent call last):
File "/tmp/tmp6om9b1jh/tmpaa79y49w.py", line 1, in <module>
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s572044718 | p04001 | u381246791 | 1581381392 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 322 | #coding:utf-8
S=input()
n=len(S)-1
answer=0
for i in range(2**n):
formula=list(S)
for j in range(n):
if ((i<<j)&1):
formula=S.insart("+",j+1)
for i,elem in enumerate(formula):
num=""
if elem=="+" or i==len(formula)-1:
answer+=int(num)
num=0
else:
num+=elem
print(answer)
| Traceback (most recent call last):
File "/tmp/tmphq13wbtw/tmp89t07mw7.py", line 2, in <module>
S=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s154200070 | p04001 | u232011870 | 1581367643 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3064 | 709 | s=list(input())
n=len(s)
n2 = 2**(n-1)
n3 = (n-1)*-1
# if n2 = 1
ans=0
for i in range(n2):
li = list(format(i,'010b'))
li = li[n3:]
# print(li)
tmpstr=s[0]
tmpnum=0
index = 0
for j in li:
# print("ans",ans,"tmpstr",tmpstr,"tmpnum",tmpnum,"index",index)
if j == '0':
# string
tmpstr=tmpstr+s[index+1]
else:
# plus
if tmpstr =="":
tmpnum=0
else:
tmpnum=int(tmpstr)
tmpstr=s[index+1]
ans=ans+tmpnum
index += 1
if tmpstr != "":
# print("ans",ans,"tmpstr",tmpstr)
tmpnum=int(tmpstr)
ans=ans+tmpnum
print(ans)
| Traceback (most recent call last):
File "/tmp/tmpzwe6_muw/tmp6yl7cvoy.py", line 1, in <module>
s=list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s824812852 | p04001 | u501451051 | 1581259288 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 221 | S = input()
ans = 0
for i in range(2**(len(S)-1):
temp = S
for j in range(len(S)-1):
if(i >> j) & 1:
temp = temp[:j - len(S) + 1]+'+'+temp[j-len(S)+1:]
ans += eval(temp)
print(ans)
| File "/tmp/tmpox68xn8l/tmpvxd5otq5.py", line 4
for i in range(2**(len(S)-1):
^
SyntaxError: invalid syntax
| |
s364557668 | p04001 | u103902792 | 1580950480 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 281 | s = input()
n = len(s)
cand = []
def func(ac,yet,sum):
next = int(yet[0])
if len(yet) ==1:
cand.append(sum+ ac+ next)
cand.append(sum+ ac*10+ next)
else:
func(next, yet[1:],ac+sum)
func(ac*10+next, yet[1:],sum)
func(int(s[0]),s[1:],0)
print(sum(cand)) | Traceback (most recent call last):
File "/tmp/tmp6stdt29l/tmp28cbwkq5.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s311713800 | p04001 | u103902792 | 1580947277 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 255 | s = input()
n = len(s)
ans = 0
for i in range(2**(n-1)):
form = s
bit = []
for _ in range(n-1):
bit.append(i%2)
i = i//2
for j in range(n):
if bit[j]:
form = form[:n-j] + '+' + form[n-j:]
ans += form.eval()
print(ans) | Traceback (most recent call last):
File "/tmp/tmpndd8jeyx/tmpg6aa2_yu.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s229654685 | p04001 | u840974625 | 1580926617 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 243 | s = input()
n = len(s)
res = 0
def part_sum(cur, i):
if i != n:
res += part_sum(cur+s[i], i+1)
res += part_sum(cur+s[i]+"+", i+1)
else:
cur += s[i]
return sum(list(map(int, cur.split("+"))))
part_sum("", 0)
print(res) | Traceback (most recent call last):
File "/tmp/tmphamvj96w/tmp50ntyhnv.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s338178140 | p04001 | u840974625 | 1580926462 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 229 | s = input()
n = len(s)
res = 0
def part_sum(cur, i):
if i != n:
part_sum(cur+s[i], i+1)
part_sum(cur+s[i]+"+", i+1)
else:
cur += s[i]
res += sum(list(map(int, cur.split("+"))))
part_sum("", 0)
print(res) | Traceback (most recent call last):
File "/tmp/tmp631zhh7s/tmpvov_9vuz.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s965140916 | p04001 | u840974625 | 1580926393 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 229 | s = input()
n = len(s)
res = 0
def part_sum(cur, i):
if i != n:
part_sum(cur+s[i], i+1)
part_sum(cur+s[i]+"+", i+1)
else:
cur += s[i]
res += sum(list(map(int, cur.split("+"))))
part_sum([], 0)
print(res) | Traceback (most recent call last):
File "/tmp/tmpidxw64qq/tmpbdr9oh43.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s275949815 | p04001 | u840974625 | 1580926218 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 229 | s = input()
n = len(s)
res = 0
def part_sum(cur, i):
if i != n:
part_sum(cur+s[i], i+1)
part_sum(cur+"+"+s[i], i+1)
else:
cur += s[i]
res += sum(list(map(int, res.split("+"))))
part_sum([], 0)
print(res) | Traceback (most recent call last):
File "/tmp/tmpfnpa9dgx/tmpq22auj7b.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s358215653 | p04001 | u875449556 | 1580765853 | Python | Python (3.4.3) | py | Runtime Error | 35 | 3060 | 216 | S = input()
n = len(S)
e = ""
s = 0
for i in range(2**(n-1)):
for j in range(n-1):
e += S[j]
if (i << j & 1):
e += "+"
s += sum(map(int, e.split("+")))
print(s)
| Traceback (most recent call last):
File "/tmp/tmp33by74pr/tmph40_uf9d.py", line 1, in <module>
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s188260296 | p04001 | u375542418 | 1580680782 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 652 | s = str(input())
s_list = []
for i in range(len(s)):
s_list.append(s[i])
#print(s_list)
L = len(s_list)
sum_a = 0
for k in range(2**(L-1)):
plus_list = [0]*(L-1)
p = list(bin(k)[2:])
for l in range(len(p)):
plus_list[L-len(p)+l-1] = int(p[l])
#print("p_list:",plus_list)
#print("p:",p)
num_list = []
start = 0
for i in range(len(plus_list)):
if plus_list[i]:
num_list.append(s_list[start:i+1])
start = i+1
num_list.append(s_list[start:])
ans = 0
for i in num_list:
s = ''
for j in i:
s = s+j
ans += int(s)
sum_a += ans
#print("num_list:",num_list)
#print("ans:",ans)
print(sum_a) | Traceback (most recent call last):
File "/tmp/tmp1dx8lun9/tmpou4xsj0a.py", line 1, in <module>
s = str(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s060328042 | p04001 | u408620326 | 1580359036 | Python | Python (3.4.3) | py | Runtime Error | 26 | 3060 | 255 | import sys
input = sys.stdin.readline
s = input()
n = len(s)
ans = 0
for i in range(1<<(n-1)):
t = ''
for j in range(n-1):
t += s[j]
if (i >> j) & 1:
t += '+'
else:
t += s[n-1]
ans += eval(t)
print(ans)
| Traceback (most recent call last):
File "/tmp/tmpn6v8etgk/tmpvwl2i1kp.py", line 6, in <module>
for i in range(1<<(n-1)):
~^^~~~~~
ValueError: negative shift count
| |
s380064310 | p04001 | u255382385 | 1580358073 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 281 | s = input()
n = len(s) - 1
sum = 0
if n == 0:
print(s)
return
for bit in range(1 << n):
eval_str = ''
for i in range(n):
eval_str += s[i]
if bit & (1 << i):
eval_str += '+'
eval_str += s[i + 1]
sum += eval(eval_str)
print(sum) | File "/tmp/tmpbb2od0q4/tmparcdo5ef.py", line 7
return
^^^^^^
SyntaxError: 'return' outside function
| |
s580222736 | p04001 | u255382385 | 1580357743 | Python | Python (3.4.3) | py | Runtime Error | 26 | 3060 | 245 | s = input()
n = len(s) - 1
sum = 0
for bit in range(1 << n):
eval_str = ''
for i in range(n):
eval_str += s[i]
if bit & (1 << i):
eval_str += '+'
eval_str += s[i + 1]
sum += eval(eval_str)
print(sum) | Traceback (most recent call last):
File "/tmp/tmp3d2zbnw3/tmpokeat_6l.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s534885835 | p04001 | u183657342 | 1579994367 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 215 | s = str(input())
ans = 0
for i in 2**(len(s)-1):
x = s[0]
for j in range(len(s)-1):
if (i>>j) & 1:
x += '+'
x += s[j+1]
ans += sum(map(int,x.split('+')))
print(ans) | Traceback (most recent call last):
File "/tmp/tmpbqrugtz5/tmpeycf_53v.py", line 1, in <module>
s = str(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s633352290 | p04001 | u193019328 | 1579915329 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 212 | S = input()
n = len(S)
ans = 0
for bit in range(1 << (n-1)):
f = S[0]
for i in range(n-1):
if bit & (1 << (n-1)):
f += "+"
f += S[i+1]
ans += sum(map(int,f.split("+")
print(ans) | File "/tmp/tmpvk8aezin/tmpk125q1cx.py", line 10
ans += sum(map(int,f.split("+")
^
SyntaxError: '(' was never closed
| |
s300563851 | p04001 | u193019328 | 1579718964 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 140 | a = input()
sum = int(a)
for i in range(len(a)-1):
sum += int(a[i])
sum += int(a[:i+1]) + int(a[i+1:])
sum += int(a[i+1])
print(sum) | Traceback (most recent call last):
File "/tmp/tmpf4xl7rh8/tmpvb44ghq9.py", line 1, in <module>
a = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s674017588 | p04001 | u193019328 | 1579714117 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 101 | a = input()
sum = int(a)
for i in range(len(a)-1):
sum += int(a[:i]) + int(a[i+1:])
print(int(sum)) | Traceback (most recent call last):
File "/tmp/tmp1oajkwkl/tmpuloed472.py", line 1, in <module>
a = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s867460227 | p04001 | u134302690 | 1579697371 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 460 | s=input()
n=len(s)-1
l=[]
for i in range(n):
l.append("+")
sum = 0
for i in range(2 ** n):
plus = []
tmp = ""
ans = 0
for j in range(n):
if ((i>>j) & 1):
plus.append(l[j])
else:
plus.append("")
for i in range(n):
tmp += s[i]+plus[i]
if i == n-1:
tmp+=s[i+1]
tmp2 = tmp.split("+")
for i in range(len(tmp2)):
ans += int(tmp2[i])
sum+=ans
print(sum)
| Traceback (most recent call last):
File "/tmp/tmpmbp3cprv/tmpfm0tyrhu.py", line 1, in <module>
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s657008413 | p04001 | u932864155 | 1579569931 | Python | Python (3.4.3) | py | Runtime Error | 28 | 3064 | 320 | S = input()
n = len(S)
total = 0
for i in range(2**(n-1)) :
ls = [""] * (n-1)
for j in range(n) :
if ((i >> j) & 1) :
ls[j] = "+"
for k in range(n) :
if k==0 :
fo = S[k] + ls[k]
elif k==n-1 :
fo = fo + S[k]
else :
fo = fo + S[k] + ls[k]
total += eval(fo)
print(total) | Traceback (most recent call last):
File "/tmp/tmptnp5njqb/tmpkoo60upz.py", line 1, in <module>
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s520278214 | p04001 | u708378905 | 1579314063 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 401 | def dfs(splitted: "the list of integer", a: int, b: int, depth: int) -> int:
if len(splitted) == depth:
return a + b
else:
# 左のdfs() 呼び出し -> +を挿入しなかったとき
# 右のdfs() 呼び出し -> +を挿入したとき
return dfs(splitted, a, b * 10, depth + 1) + dfs(splitted, a + b, splitted[i], depth + 1)
s = [int(x) for x in input()]
print(dfs(s, 0, 0, 0)) | Traceback (most recent call last):
File "/tmp/tmp5d0rx_f1/tmp3owa5obl.py", line 9, in <module>
s = [int(x) for x in input()]
^^^^^^^
EOFError: EOF when reading a line
| |
s188802883 | p04001 | u708378905 | 1579313990 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 394 | def dfs(splitted: "the list of integer", a: int, b: int, depth: int) -> int:
if len(splitted) == depth:
return a + b
else:
# 左のdfs() 呼び出し -> +を挿入しなかったとき
# 右のdfs() 呼び出し -> +を挿入したとき
return dfs(splitted, a, b * 10, depth + 1) + dfs(s, a + b, splitted[i], depth + 1)
s = [int(x) for x in input()]
print(dfs(s, 0, 0, 0)) | Traceback (most recent call last):
File "/tmp/tmptw4z_ga2/tmp8vgeu4jm.py", line 9, in <module>
s = [int(x) for x in input()]
^^^^^^^
EOFError: EOF when reading a line
| |
s067808359 | p04001 | u708378905 | 1579313916 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 394 | def dfs(splitted: "the list of integer", a: int, b: int, depth: int) -> int:
if len(splitted) == depth:
return a + b
else:
# 左のdfs() 呼び出し -> +を挿入しなかったとき
# 右のdfs() 呼び出し -> +を挿入したとき
return dfs(splitted, a, b * 10, depth + 1) + dfs(s, a + b, splitted[i], depth + 1)
s = [int(x) for x in input()]
print(dfs(s, 0, 0, 0)) | Traceback (most recent call last):
File "/tmp/tmpmw7sqz4c/tmpen1yivtv.py", line 9, in <module>
s = [int(x) for x in input()]
^^^^^^^
EOFError: EOF when reading a line
| |
s000330087 | p04001 | u747220349 | 1578790108 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38640 | 156 | s=input()
n=len(s)-1
ans=0
for b in list(product(['+',''],repeat=n)):
a=s[0]
for i in range(n):
a=a+b[i]+s[i+1]
ans+=eval(a)
print(ans)
| Traceback (most recent call last):
File "/tmp/tmppz613s4j/tmp7rbsoz80.py", line 1, in <module>
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s153119984 | p04001 | u747220349 | 1578790086 | Python | PyPy3 (2.4.0) | py | Runtime Error | 165 | 38512 | 155 | s=input()
n=len(s)-1
ans=0
for b in list(product(['+',''],repeat=n))
a=s[0]
for i in range(n):
a=a+b[i]+s[i+1]
ans+=eval(a)
print(ans)
| File "/tmp/tmp18spqn4y/tmpy57875en.py", line 4
for b in list(product(['+',''],repeat=n))
^
SyntaxError: expected ':'
| |
s169286450 | p04001 | u973744316 | 1578627436 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 213 | S = int(input())
N = len(S) - 1
ans = 0
for i in range(2 ** N):
k = 0
for j in range(N):
if (i >> j) & 1:
ans += int(S[k:j + 1])
k = j + 1
ans += int(S[k:])
print(ans)
| Traceback (most recent call last):
File "/tmp/tmp3dp4mdqm/tmp4ap7q_yh.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s737892492 | p04001 | u973744316 | 1578627412 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 230 | S = int(input())
N = len(S) - 1
ans = 0
for i in range(2 ** N):
k = 0
for j in range(N):
# 復元
if (i >> j) & 1:
ans += int(S[k:j + 1])
k = j + 1
ans += int(S[k:])
print(ans)
| Traceback (most recent call last):
File "/tmp/tmp05je1ow1/tmpec61dona.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s137324572 | p04001 | u973744316 | 1578627286 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 230 | S = int(input())
N = len(S) - 1
ans = 0
for i in range(2 ** N):
k = 0
for j in range(N):
# 復元
if (i >> j) & 1:
ans += int(S[k:j + 1])
k = j + 1
ans += int(S[k:])
print(ans)
| Traceback (most recent call last):
File "/tmp/tmpgy42_hp0/tmpokw5l5bw.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s662881465 | p04001 | u427314356 | 1578074760 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 194 | n = input()
l = len(n)
ans = 0
for bit in range(1 << l-1):
f = n[0]
for i in range(1<<l):
if bit & i:
f += '+"
f += n[i]
ans += sum([int(x) for x in f.split('+')])
print(ans) | File "/tmp/tmp1lar03k4/tmpe_jf87aq.py", line 8
f += '+"
^
SyntaxError: unterminated string literal (detected at line 8)
| |
s294410013 | p04001 | u427314356 | 1578074740 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 194 | n = input()
l = len(n)
ans = 0
for bit in range(1 << l-1):
f = n[0]
for i in range(1<<l):
if bit & i:
f += '+"
f += n[i]
ans += sum([int(x) for x in f.split('+')])
print(ans) | File "/tmp/tmprx7bf43v/tmpl1kafvm3.py", line 8
f += '+"
^
SyntaxError: unterminated string literal (detected at line 8)
| |
s101457001 | p04001 | u593567568 | 1576632988 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 487 | import sys
from collections import deque
sys.setrecursionlimit(1000000000)
def dfs(xs,q):
if len(xs) == 0:
return sum(int(i) for i in q)
x = xs.popleft()
if len(q) == 0:
q.append(x)
return dfs(xs,q)
a1 = xs.copy()
a2 = xs.copy()
q1 = q.copy()
q2 = q.copy()
q1.append(x)
y = q2.pop()
yx = y + x
q2.append(yx)
return dfs(a1,q1) + dfs(a2,q2)
s = str(input())
xs = deque(list(s))
print(dfs(xs,deque([]))) | Traceback (most recent call last):
File "/tmp/tmp4ho87ww0/tmpiywrg4z9.py", line 32, in <module>
s = str(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s421316065 | p04001 | u593567568 | 1576630660 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 402 | import sys
from collections import deque
sys.setrecursionlimit(1000000000)
def dfs(xs):
x = xs.popleft()
if len(xs) == 0:
return x
# not +
xs2 = xs.copy()
y = xs2.popleft()
xy = int(str(x)+str(y))
xs2.appendleft(xy)
b = dfs(xs2)
# has +
a = x + x + dfs(xs)
return a+b
s = str(input())
xs = list(map(int,s))
xs = deque(xs)
print(dfs(xs)) | Traceback (most recent call last):
File "/tmp/tmp72uyekvi/tmpudp8rqby.py", line 26, in <module>
s = str(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s059692996 | p04001 | u593567568 | 1576626722 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 356 | from collections import deque
def dfs(xs):
x = xs.popleft()
if len(xs) == 0:
return x
# not +
xs2 = xs.copy()
y = xs2.popleft()
xy = int(str(x)+str(y))
xs2.appendleft(xy)
b = dfs(xs2)
# has +
a = x * 2 + dfs(xs)
return a+b
s = str(input())
xs = list(map(int,s))
xs = deque(xs)
print(dfs(xs)) | Traceback (most recent call last):
File "/tmp/tmp3wb4hz5p/tmpxd62bz7g.py", line 23, in <module>
s = str(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s134219537 | p04001 | u593567568 | 1576626463 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 375 | from collections import deque
def dfs(xs):
print("xs",xs)
x = xs.popleft()
if len(xs) == 0:
return x
# not +
xs2 = xs.copy()
y = xs2.popleft()
xy = int(str(x)+str(y))
xs2.appendleft(xy)
b = dfs(xs2)
# has +
a = x * 2 + dfs(xs)
return a+b
s = str(input())
xs = list(map(int,s))
xs = deque(xs)
print(dfs(xs)) | Traceback (most recent call last):
File "/tmp/tmpkvhdm62k/tmpcededt1j.py", line 24, in <module>
s = str(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s200235593 | p04001 | u593567568 | 1576625822 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 353 | from collections import deque
def dfs(xs):
x = xs.popleft()
if len(xs) == 0:
return x
# not +
xs2 = xs.copy()
y = xs2.popleft()
xy = int(str(x)+str(y))
xs2.appendleft(xy)
b = dfs(xs2)
# has +
a = x + dfs(xs)
return a+b
s = str(input())
xs = list(map(int,s))
xs = deque(xs)
print(dfs(xs)) | Traceback (most recent call last):
File "/tmp/tmpbsmfw9k7/tmp2v6ugu9v.py", line 24, in <module>
s = str(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s365410534 | p04001 | u521020719 | 1576406744 | Python | PyPy3 (2.4.0) | py | Runtime Error | 357 | 55260 | 242 | def dfs(formula, index):
if index + 1 == max_index:
return sum(list(map(int, formula.split("+"))))
return dfs(formula + "+" + S[index], index + 1) + dfs(formula + S[index], index)
S = input()
max_index = len(S)
dfs(S[0], 0) | Traceback (most recent call last):
File "/tmp/tmpwrgugpsl/tmp58dxrqoy.py", line 8, in <module>
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s203029944 | p04001 | u521020719 | 1576406123 | Python | PyPy3 (2.4.0) | py | Runtime Error | 180 | 38256 | 245 | def dfs(i, formula):
if i + 1 == num_digits:
return sum(list(map(int, formula.split("+"))))
return sum(dfs(i + 1, formula + "+" + s[i + 1]), dfs(i + 1, formula + s[i + 1]))
s = input()
num_digits = len(s)
print(dfs(0, s[0]))
| Traceback (most recent call last):
File "/tmp/tmphrcgovdv/tmpgkolby7k.py", line 8, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s606437836 | p04001 | u752907966 | 1576374873 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 444 | s = input()
n = len(s)
#左から順番に文字を結合していき+を入れるパターンと入れないパターンについて同様に文字を結合させていく
def dfs(i,f):
if i == n-1:#すべての文字を使いきったらそのときの計算をする
return sum(list(map(int,f.split("+"))))
return dfs(i+1,f+s[i+1]) + dfs(i+2,f+"+"+s[i+1])#+を入れない場合、+をいれる場合
print(dfs(0,s[0])) | Traceback (most recent call last):
File "/tmp/tmp40hcebtz/tmpbo7zebyk.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s773194913 | p04001 | u752907966 | 1576374815 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 443 | s = input()
n = len(s)
#左から順番に文字を結合していき+を入れるパターンと入れないパターンについて同様に文字を結合させていく
def dfs(i,f):
if i == n-1:#すべての文字を使いきったらそのときの計算をする
return sum(list(map(int,f.split("+"))))
return dfs(i+1,f+s[i+1]) + dfs(i+2,f+"+"+s[i+1])#+を入れない場合、+をいれる場合
print(dfs(0,s[0]) | File "/tmp/tmpynjh7585/tmpsoqyx6_e.py", line 10
print(dfs(0,s[0])
^
SyntaxError: '(' was never closed
| |
s161721703 | p04001 | u054871430 | 1575829433 | Python | PyPy3 (2.4.0) | py | Runtime Error | 171 | 38384 | 594 | def add_or_do_nothing(s, i, pos):
if i == len(s):
pre_i = 0
ans = 0
for pos_i in pos:
print(s[pre_i:pos_i], pre_i, pos_i)
ans += int(s[pre_i:pos_i])
pre_i = pos_i
if pre_i == 0:
ans = int(s)
else:
ans += int(s[pre_i:len(s)] if pre_i != len(s) else '0')
return ans
f_ans = add_or_do_nothing(s, i+1, pos)
pos.append(i)
s_ans = add_or_do_nothing(s, i+1, pos)
return f_ans + s_ans
s = input()
pos = []
ans = add_or_do_nothing(s, 1, pos)
print(ans) | Traceback (most recent call last):
File "/tmp/tmpdouhoq6o/tmpfkj0px80.py", line 23, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s826163908 | p04001 | u638282348 | 1575428772 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 191 | nums = list(input().strip())
N = len(nums)
head = nums.pop(0)
print(sum(eval(head + "".join([f"{'' if (j >> i) % 2 else '+'}{n}" for i, n in enumerate(nums)])) for j in range(2 ** (N - 1))))
| Traceback (most recent call last):
File "/tmp/tmp7pz7yr5b/tmpgzagivx7.py", line 1, in <module>
nums = list(input().strip())
^^^^^^^
EOFError: EOF when reading a line
| |
s538367877 | p04001 | u600935366 | 1574484644 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 206 | s = input()
n = len(s)
def dfs(tmp, s):
if len(s) == 1:
return int(tmp)+int(s)+int(tmp+s)
return int(tmp)*2**(len(s)-1)+dfs(s[0], s[1:]) + dfs(tmp+s[0], s[1:])
print(dfs(s[0], s[1:])) | Traceback (most recent call last):
File "/tmp/tmplc_gi6hp/tmpsbxqzcd7.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s601130087 | p04001 | u322229918 | 1574465327 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 396 | s = input()
item = np.arange(len(s) - 1) + 1
n = len(item)
count = 0
for i in range(2 ** n):
sidx = 0
for j in range(n): # このループが一番のポイント
if ((i >> j) & 1): # 順に右にシフトさせ最下位bitのチェックを行う
eidx = item[j]
count += int(s[sidx:eidx])
sidx = eidx
count += int(s[sidx:])
print(count) | Traceback (most recent call last):
File "/tmp/tmp2mem8tas/tmpl1yfcjie.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s137182269 | p04001 | u077291787 | 1574090985 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 572 | import sys
input = sys.stdin.readline()
s = input()
n = len(s)
total_sum = 0
# +を挿入する事象は
# sが2文字なら2通り,3文字なら4通り,n文字なら2^(n-1)通りある
for i in range(2 ** (n - 1)):
# iは各桁に+を挿入するかどうかを決定する
# 例えば s=12345, i=0b0111, ss=1+2+3+45
now_sum = 0
reg = int(s[0])
for j in range(n - 1):
if i & 1 << j:
now_sum += reg
reg = 0
reg *= 10
reg += int(s[j + 1])
now_sum += reg
total_sum += now_sum
print(total_sum)
| Traceback (most recent call last):
File "/tmp/tmprm70ni0o/tmp7snu8i45.py", line 5, in <module>
s = input()
^^^^^^^
TypeError: 'str' object is not callable
| |
s281925188 | p04001 | u076506345 | 1574089479 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 574 | import sys
input = sys.stdin.readline
s = input()
n = len(s)
total_sum = 0
# +を挿入する事象は
# sが2文字なら2通り,3文字なら4通り,n文字なら2^(n-1)通りある
for i in range(2 ** (n - 1)):
# iは各桁に+を挿入するかどうかを決定する
# 例えば s=12345, i=0b0111, ss=1+2+3+45
now_sum = 0
reg = int(s[0])
for j in range(n - 1):
if i & 1 << j:
now_sum += reg
reg = 0
reg *= 10
reg += int(s[j + 1])
now_sum += reg
total_sum += now_sum
print(total_sum)
| Traceback (most recent call last):
File "/tmp/tmpj2fu359a/tmp5u9pj3ay.py", line 11, in <module>
for i in range(2 ** (n - 1)):
^^^^^^^^^^^^^^^^^^^
TypeError: 'float' object cannot be interpreted as an integer
| |
s328433310 | p04001 | u076506345 | 1574089284 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 574 | import sys
input = sys.stdin.readline
s = input()
n = len(s)
total_sum = 0
# +を挿入する事象は
# sが2文字なら2通り,3文字なら4通り,n文字なら2^(n-1)通りある
for i in range(2 ** (n - 1)):
# iは各桁に+を挿入するかどうかを決定する
# 例えば s=12345, i=0b0111, ss=1+2+3+45
now_sum = 0
reg = int(s[0])
for j in range(n - 1):
if i & 1 << j:
now_sum += reg
reg = 0
reg *= 10
reg += int(s[j + 1])
now_sum += reg
total_sum += now_sum
print(total_sum)
| Traceback (most recent call last):
File "/tmp/tmpd0nv8hjq/tmprzm1i0q4.py", line 11, in <module>
for i in range(2 ** (n - 1)):
^^^^^^^^^^^^^^^^^^^
TypeError: 'float' object cannot be interpreted as an integer
| |
s447052795 | p04001 | u521020719 | 1574069655 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38384 | 219 | number = int(input())
num_digits = len(str(number))
def dfs(i, sum_number):
if i == num_digits:
return sum_number
dfs(i + 1, sum_number)
dfs(i + 1, sum_number + str(number)[i])
print(dfs(0, 0))
| Traceback (most recent call last):
File "/tmp/tmpis15jt4k/tmp1ax8_76y.py", line 1, in <module>
number = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s859477309 | p04001 | u609061751 | 1573031264 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 242 | S = input()
s = S[0]
ans = 0
def dfs(n,S,s):
global ans
s_0 = s + "+" + S[n]
s_1 = s + S[n]
if n == len(S) - 1:
ans += eval(s_0) + eval(s_1)
else:
dfs(n+1,S,s_0)
dfs(n+1,S,s_1)
dfs(1,S,s)
print(ans) | Traceback (most recent call last):
File "/tmp/tmpq5uekhzw/tmph1c2ch3e.py", line 1, in <module>
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s250306601 | p04001 | u557494880 | 1572825148 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 194 | S = intinput()
n = len(S)
ans = 0
for i in range(2**(n-1)):
s = S[0]
for j in range(n-1):
if (i >> j) & 1:
s += '+'
s += S[j+1]
ans += eval(s)
print(ans)
| Traceback (most recent call last):
File "/tmp/tmp0xv36cw7/tmpfornl9s5.py", line 1, in <module>
S = intinput()
^^^^^^^^
NameError: name 'intinput' is not defined
| |
s970170521 | p04001 | u557494880 | 1572825074 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 195 | S = int(input())
n = len(S)
ans = 0
for i in range(2**(n-1)):
s = S[0]
for j in range(n-1):
if (i >> j) & 1:
s += '+'
s += S[j+1]
ans += eval(s)
print(ans) | Traceback (most recent call last):
File "/tmp/tmphpx8n2v3/tmp_h_idqll.py", line 1, in <module>
S = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s771992693 | p04001 | u557494880 | 1572649085 | Python | Python (3.4.3) | py | Runtime Error | 2120 | 254488 | 611 | S = str(input())
def plus(a,b,c):
x = a[0:b+1] + c + a[b+1:len(a)]
return(x)
A = [S]
while len(A) != 2**(len(S)):
for i in range(len(S)-1):
for j in range(len(A)):
x = A[j]
y = plus(x,i,'+')
A.append(y)
s = 0
for i in range(len(A)):
x = A[i]
p = 0
q = 0
for j in range(len(x)):
if x[j] == '+':
q = j - 1
m = x[p:q]
s += int(m)
p = j + 1
elif j == len(x):
q = len(x)
m = x[p:q]
s += int(m)
print(s)
| Traceback (most recent call last):
File "/tmp/tmpanj07da9/tmp12446w9e.py", line 1, in <module>
S = str(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s465837869 | p04001 | u168333670 | 1571014458 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 459 | S = input()
def func(num, code):
total = 0
start = 0
length = len(num)
for i in range(1, length):
if code & 1 == 1: #一番下にビットが立ってるなら
total = total + int(num[start:i])
start = i
code = code >> 1
total = total + int(num[start:i + 1])
return total
total_of_all = 0
for i in range(2 ** (len(S) - 1)):
total_of_all = total_of_all + func(S, i)
print(total_of_all) | Traceback (most recent call last):
File "/tmp/tmpdl6cw402/tmpka2as967.py", line 1, in <module>
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s737262001 | p04001 | u168333670 | 1571014400 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3064 | 481 | S = input()
def func(num, code):
total = 0
start = 0
length = len(num)
for i in range(1, length):
if code & 1 == 1: #一番下にビットが立ってるなら
total = total + int(num[start:i])
start = i
code = code >> 1
total = total + int(num[start:i + 1])
return total
total_of_all = 0
for i in range(2 ** (len(S) - 1)):
print(func(S, i))
total_of_all = total_of_all + func(S, i)
print(total_of_all) | Traceback (most recent call last):
File "/tmp/tmp032yblzp/tmplskt1u7e.py", line 1, in <module>
S = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s521656512 | p04001 | u208497224 | 1570282118 | Python | PyPy3 (2.4.0) | py | Runtime Error | 327 | 46060 | 1406 | import copy
s = input()
def value(s, adding_list):
insert_index = []
for index in range(len(adding_list)):
if adding_list[index]:
insert_index.append(index)
if len(insert_index) == 0:
return int(s)
value_list = []
for index in range(len(insert_index)):
if index == 0:
value_list.append(s[0:insert_index[index]+1])
if index < len(insert_index)-1:
value_list.append(s[(insert_index[index]+1) : insert_index[index+1]+1])
if index == len(insert_index)-1:
value_list.append(s[insert_index[index]+1:])
ret_val = 0
for value in value_list:
ret_val += int(value)
return ret_val
def dfs(adding_list, changing_index):
print(changing_index)
sum = 0
if changing_index == len(s)-2:
return value(s, adding_list)
else:
changing_index += 1
new_adding_list = copy.copy(adding_list)
sum += dfs(new_adding_list, changing_index)
new_adding_list = copy.copy(adding_list)
new_adding_list[changing_index] = True
sum += dfs(new_adding_list, changing_index)
return sum
def main():
ret_val = 0
plus_list = [False for _ in range(len(s)-1)]
ret_val += dfs(plus_list, 0)
plus_list = [False for _ in range(len(s)-1)]
plus_list[0] = True
ret_val += dfs(plus_list, 0)
print(ret_val)
main() | Traceback (most recent call last):
File "/tmp/tmpm_nvk7t2/tmpohgcd823.py", line 3, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s924339423 | p04001 | u641851773 | 1569980663 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 1004 | #!/usr/bin/python3
import sys
def dprint(*args):
pass
#print(*args)
def solve(s_str):
ans = 0
s_len = len(s_str)
for bits in range(0, 1 << (s_len - 1)):
dprint("bits: {0:b}".format(bits))
rev_str = list(reversed(s_str))
dprint(f"rev_str: {rev_str}")
cur_num_rev_str = ""
# 12345
for rev_i in range(0, s_len):
dprint("rev_i: %d" % rev_i)
plus_index = rev_i
cur_num_rev_str += rev_str[0]
rev_str = rev_str[1:]
dprint("cur_num_rev_str: %s" % cur_num_rev_str)
if rev_i == s_len - 1 or bits & (1 << plus_index):
ans += int(''.join(list(reversed(cur_num_rev_str))))
cur_num_rev_str = ""
if cur_num_rev_str != "":
dprint(f"ans: {ans}")
ans += int(''.join(list(reversed(cur_num_rev_str))))
return ans
def main():
s_str = sys.stdin.read().rstrip()
dprint(s_str)
print(solve(s_str))
main() | Traceback (most recent call last):
File "/tmp/tmpxp9yavmd/tmpynrcwxx6.py", line 37, in <module>
main()
File "/tmp/tmpxp9yavmd/tmpynrcwxx6.py", line 35, in main
print(solve(s_str))
^^^^^^^^^^^^
File "/tmp/tmpxp9yavmd/tmpynrcwxx6.py", line 12, in solve
for bits in range(0, 1 << (s_len - 1)):
~~^^~~~~~~~~~~~~
ValueError: negative shift count
| |
s895114031 | p04001 | u589047182 | 1569567457 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 197 | def dfs(i, f):
if i == n - 1:
return sum(list(map(int, f.split("+"))))
return dfs(i + 1, f + s[i + 1]) + dfs(i + 1, f + "+" + s[i + 1])s
s = input()
n = len(s)
print(dfs(0, s[0]))
| File "/tmp/tmp61d0yk9_/tmps8950dw3.py", line 4
return dfs(i + 1, f + s[i + 1]) + dfs(i + 1, f + "+" + s[i + 1])s
^
SyntaxError: invalid syntax
| |
s581222233 | p04001 | u420522278 | 1569166194 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 398 | import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()
S = ns()
s = []
for i in S:
s.append(i)
s.append('')
del s[-1]
out = 0
for i in range(2**(len(S)-1)):
for j in range(1, len(S)):
if (i//(2**(j-1)))%2 == 1:
s[-2*j] = '+'
else:
s[-2*j] = ''
out += eval(''.join(s))
print(out)
| Traceback (most recent call last):
File "/tmp/tmpn26wcu_n/tmp0y2bdrz0.py", line 14, in <module>
del s[-1]
~^^^^
IndexError: list assignment index out of range
| |
s290860160 | p04001 | u420522278 | 1569166106 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 411 | import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()
S = ns()
s = []
for i in S:
s.append(i)
s.append('')
del s[-1]
out = 0
for i in range(2**(len(S)-1)):
for j in range(1, len(S)):
if (i//(2**(j-1)))%2 == 1:
s[-2*j] = '+'
else:
s[-2*j] = ''
# print(s)
out += eval(''.join(s))
print(out)
| Traceback (most recent call last):
File "/tmp/tmpcp2zp1uq/tmpewskh9tc.py", line 14, in <module>
del s[-1]
~^^^^
IndexError: list assignment index out of range
| |
s539225372 | p04001 | u420522278 | 1569166005 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 397 | import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()
S = ns()
s = []
for i in S:
s.append(i)
s.append('')
del s[-1]
out = 0
for i in range(2**(len(S)-1)):
for j in range(1, len(S)):
if (i//(2**(j-1)))%2 == 1:
s[-2*j] = '+'
else:
s[-2*j] = ''
out += eval(''.join(s))
print(out) | Traceback (most recent call last):
File "/tmp/tmpc3_yqb50/tmp35kmgp17.py", line 14, in <module>
del s[-1]
~^^^^
IndexError: list assignment index out of range
| |
s020651403 | p04001 | u420522278 | 1569165944 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 410 | import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()
S = ns()
s = []
for i in S:
s.append(i)
s.append('')
del s[-1]
out = 0
for i in range(2**(len(S)-1)):
for j in range(1, len(S)):
if (i//(2**(j-1)))%2 == 1:
s[-2*j] = '+'
else:
s[-2*j] = ''
# print(s)
out += eval(''.join(s))
print(out) | Traceback (most recent call last):
File "/tmp/tmp71adl5jd/tmpaec_fcmd.py", line 14, in <module>
del s[-1]
~^^^^
IndexError: list assignment index out of range
| |
s627344345 | p04001 | u386170566 | 1568939384 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 304 | #arc061_C - たくさんの数式 / Many Formulas
s = list(str(input()))
l = len(s)
def dfs(i,f):
if i == l-1:
return sum(list(map(int,f.split("+"))))
return dfs(i + 1, f + s[i+1]) + \ #この記号の正体を教えて下さい
dfs(i + 1, f + "+" +s[i + 1])
print(dfs(0,s[0])) | File "/tmp/tmpygp9byk1/tmpjakuiiwo.py", line 7
return dfs(i + 1, f + s[i+1]) + \ #この記号の正体を教えて下さい
^
SyntaxError: unexpected character after line continuation character
| |
s822601946 | p04001 | u274080981 | 1567508882 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 356 | d,g=map(int, input().split())
table = []
alscr=0
cnt=0
for i in range(d):
table.append( [(i+1) * 100] + list(map(int,input().split())) )
for i in range(0,d)[::-1]:
scr=table[i][0]
num=table[i][1]
bns=table[i][2]
for i in range(num):
alscr+=scr
cnt +=1
if i == num-1:
alscr += bns
if alscr >= g:
print(cnt)
break | Traceback (most recent call last):
File "/tmp/tmp73vft1t7/tmpif9fzqe7.py", line 1, in <module>
d,g=map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.