ZhenlongDai/ACPR huggingface dataset:
Problem: p02818
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, k = map(int, input().split())
if a >= k:
    a -= k
else:
    b = max(0,k - a)
    a = 0
print(a, b)

Failing test case input:
2 3 3

Expected output:
0 2

Actual output:
0 1


Fixed submission (verdict: Accepted):
a, b, k = map(int, input().split())
if a >= k:
    a -= k
else:
    b = max(0,b -(k - a))
    a = 0
print(a, b)

Problem: p02818
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
A,B,K = map(int,input().split())

def eat_cookie(A,B,K):
    if A == 0 and B == 0:
        return 0,0
    if A >= K:
        return A-K,B
    else:
        if B-A+K > 0:
            return 0,B-K+A
        else:
            return 0,0


resultA,resultB = eat_cookie(A,B,K)
print(resultA,resultB)


Failing test case input:
250272688906 9468746842 1010010100011

Expected output:
0 0


Actual output:
0 -750268664263


Fixed submission (verdict: Accepted):
A,B,K = map(int,input().split())

def eat_cookie(A,B,K):
    if A >= K:
        return A-K,B
    else:
        if B-K+A > 0:
            return 0,B-K+A
        else:
            return 0,0


resultA,resultB = eat_cookie(A,B,K)
print(resultA,resultB)

Problem: p02818
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,k=map(int,input().split())
if k<a:
    print(k-a,b)
elif a<=k<a+b:
    print(0,b-(k-a))
else:
    print(0,0)


Failing test case input:
498881727339 50858735181 0000001100000

Expected output:
498880627339 50858735181


Actual output:
-498880627339 50858735181


Fixed submission (verdict: Accepted):
a,b,k=map(int,input().split())
if k<a:
    print(a-k,b)
elif a<=k<a+b:
    print(0,b-(k-a))
else:
    print(0,0)

Problem: p02818
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
A,B,K=map(int,input().split())

if A >= K:
    A -= K
else:
    K -= A
    A = 0
    B -= K

print(str(A) + ' ' + str(B))

Failing test case input:
223869749260 13514692621 1010010100011

Expected output:
0 0


Actual output:
0 -772625658130


Fixed submission (verdict: Accepted):
A,B,K=map(int,input().split())

if A >= K:
    A -= K
elif A+B >=K:
    K -= A
    A = 0
    B -= K
else:
    A = 0
    B = 0

print(str(A) + ' ' + str(B))

Problem: p02818
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, K = map(int, input().split(' '))


def main(a, b, k):
    if a == 0 and b == 0:
        print(0, 0)
        return

    if k < a:
        print(a - k, b)
        return

    if k >= a + b:
        print(0, 0)
        return

    if k > a:
        print(0, b - (a - k))
        return


main(A, B, K)

Failing test case input:
0 6 0

Expected output:
0 6


Actual output:

Fixed submission (verdict: Accepted):
A, B, K = map(int, input().split(' '))




def main(a, b, k):
    if a == 0 and b == 0:
        print(0, 0)

    elif k <= a:
        print(a - k, b)

    elif k >= a + b:
        print(0, 0)

    elif a < k < a + b:
        print(0, b - (k-a))


main(A, B, K)
Problem: p02818
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, K = map(int, input().split())

print(max(0, A - K), max(0, B - K + A))

Failing test case input:
810189303696 304656088 0010010101100

Expected output:
800179202596 304656088


Actual output:
800179202596 800483858684


Fixed submission (verdict: Accepted):
A, B, K = map(int, input().split())
T = max(0, A - K)
print(T, max(0, B - K + A - T))

Problem: p02818
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, K = map(int, input().split())


if K>A:
    ans_a=0
    ans_b=B-(K-A)
else:
    ans_a=A-K
    ans_b=B

print(ans_a, ans_b)


Failing test case input:
0 0 1

Expected output:
0 0


Actual output:
0 -1


Fixed submission (verdict: Accepted):
A, B, K = map(int, input().split())
 
if K<=A:
    ansa=A-K
    ansb=B
elif K>A and K<=A+B:
    ansa=0
    ansb=B-(K-A)
else:
    ansa=0
    ansb=0

print(ansa, ansb)

Problem: p02818
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,k=map(int,input().split())
print(0,b+a-k) if a<=k else print(a-k,b)

Failing test case input:
223869749260 13514692621 1011010101011

Expected output:
0 0


Actual output:
0 -773625659130


Fixed submission (verdict: Accepted):
a, b, k = map(int, input().split())
print(0,max(0,b+a-k)) if a<=k else print(a-k,b)

Problem: p02818
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A,B,K = map(int,input().split())

if A>=K:
  print(A-K,B)
  
else:
  print(0,B+A-K)

Failing test case input:
13071060683 933260677 1110110100001

Expected output:
0 0


Actual output:
0 -1096105778641


Fixed submission (verdict: Accepted):
A,B,K = map(int,input().split())

if A>=K:
  print(A-K,B)
  
elif A+B>=K:
  print(0,B+A-K)
  
else:
  print(0,0)

Problem: p02818
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,k =  input().split()
a = int(a)
b = int(b)
k = int(k)
if a < k:
    i = 0
    m = b - (k-a)
else:
    i = a-k
    m=b
print(i,m)
    

Failing test case input:
223869749260 9468746842 1010010100011

Expected output:
0 0


Actual output:
0 -776671603909


Fixed submission (verdict: Accepted):
a,b,k =  input().split()
a = int(a)
b = int(b)
k = int(k)

if a + b < k:
    i = 0
    m = 0
elif a <= k:
    i = 0
    m = b - (k-a)
else:
    i = a-k
    m=b
print(i,m)

Problem: p02818
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B,K = map(int,input().split())
if A > K:
    print(A-K,B)
elif A <= K:
    print(0,A+B-K)
elif A+B < K:
    print(0,0)        


Failing test case input:
250272688906 9468746842 1010010100011

Expected output:
0 0


Actual output:
0 -750268664263


Fixed submission (verdict: Accepted):
A,B,K = map(int,input().split())
if A > K:
    print(A-K,B)
elif A <= K and A+B > K:
    print(0,A+B-K)
elif A+B <= K:
    print(0,0)

Problem: p02818
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, k = map(int, input().split())
print(max(0, a-k), max(0, (a+b-k)*(a <= k)))


Failing test case input:
498881727339 86551688904 0000000100000

Expected output:
498881627339 86551688904


Actual output:
498881627339 0


Fixed submission (verdict: Accepted):
a, b, k = map(int, input().split())
print(max(0, a-k), max(0, b-(0 if a >= k else k-a)))
Problem: p02818
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
A, B, K = map(int, input().split())

if A >= K:
	print(A - K, B)
else:
	print(0, B - (K - A))
	
	

Failing test case input:
9875757521 933260677 1010110110000

Expected output:
0 0


Actual output:
0 -999301091802


Fixed submission (verdict: Accepted):
A, B, K = map(int, input().split())

if A >= K:
	print(A - K, B)
else:
	print(0, max(0, B - (K - A)))

Problem: p02818
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

A, B, K = map(int, input().split())


if A > K:
    A = A - K
else:
    B = B - (K - A)
    A = 0


print(str(A) + " " + str(B))

Failing test case input:
24844196728 933260677 1010010100001

Expected output:
0 0


Actual output:
0 -984232642596


Fixed submission (verdict: Accepted):

A, B, K = map(int, input().split())


if A >= K:
    A = A - K
else:
    if A + B >= K:
        B = B - (K - A)
        A = 0
    else:
        B = 0
        A = 0


print(str(A) + " " + str(B))

Problem: p02818
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
takahashi, aoki, K = map(int, input().split())

if aoki + takahashi <= K:
  print(0, 0)
elif aoki > K - takahashi:
  print(0, aoki+takahashi-K)
else:
  print(takahashi-K, aoki)



Failing test case input:
810189303696 2744039490 0010010100100

Expected output:
800179203596 2744039490


Actual output:
0 802923243086


Fixed submission (verdict: Accepted):
takahashi, aoki, K = map(int, input().split())

if aoki + takahashi <= K:
  print(0, 0)
elif takahashi < K and K <= takahashi+aoki:
  print(0, aoki+takahashi-K)
else:
  print(takahashi-K, aoki)

Problem: p02818
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B,C=map(int,input().split())
if A<C:
  B=B-(C-A)
  A=0
else:
  A=A-C
print(A,B)

Failing test case input:
250272688906 5812721198 1010010100011

Expected output:
0 0


Actual output:
0 -753924689907


Fixed submission (verdict: Accepted):
A,B,C=map(int,input().split())
if A<C:
  B=B-(C-A)
  A=0
else:
  A=A-C
print(A,max(B,0))

Problem: p02818
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,k = map(int, input().split())

if a >= k:
    print(a-k,b)
elif k > a and a + b > k:
    print(0, b - k)
else:
    print(0, 0)

Failing test case input:
2 3 3

Expected output:
0 2

Actual output:
0 0


Fixed submission (verdict: Accepted):
a,b,k = map(int, input().split())

if a >= k:
    print(a-k,b)
elif k > a and a + b >= k:
    print(0, b - k + a)
else:
    print(0, 0)

Problem: p02818
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a,b,k = map(int,input().split())
if a >= k:
  print(a-k,b)
else:
  print(0,b-(k-a))

Failing test case input:
223869749260 13514692621 1011010101111

Expected output:
0 0


Actual output:
0 -773625659230


Fixed submission (verdict: Accepted):
a,b,k = map(int,input().split())
if a >= k:
  print(a-k,b)
elif b-(k-a) >= 0:
  print(0,b-(k-a))
else:print(0,0)
Problem: p02818
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,k = list(map(int, input().split()))
if a-k < 0:
  if b+a-k>=0:
    print("0",str(b+a-k))
else:
  print(str(a-k), str(b))


Failing test case input:
8901212864 933260677 1110110100001

Expected output:
0 0


Actual output:

Fixed submission (verdict: Accepted):
a,b,k = list(map(int, input().split()))
if a-k < 0:
  if b+a-k>=0:
    print("0",str(b+a-k))
  else:
    print("0 0")
else:
  print(str(a-k), str(b))

Problem: p02818
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    a, b, k = map(int, input().split())
    if k >= a:
        print(0, b-(k-a))
    else:
        print(k, b)
        
if __name__ == '__main__':
    main()



Failing test case input:
9957043226 933260677 1110010100001

Expected output:
0 0


Actual output:
0 -1099119796098


Fixed submission (verdict: Accepted):
def main():
    a, b, k = map(int, input().split())
    if k >= a and b >= k-a:
        print(0, b-(k-a))
    elif k >= a and b < k-a:
        print(0, 0)
    else:
        print(a-k, b)
        
if __name__ == '__main__':
    main()

Problem: p02818
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
A, B, K = map(int,input().split())
print(max(0, A - K), min(B, A + B - K))

Failing test case input:
0 -1 2

Expected output:
0 0


Actual output:
0 -3


Fixed submission (verdict: Accepted):
A, B, K = map(int,input().split())
print(max(0, A - K), max(0,min(B, A + B - K)))

Problem: p02818
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
A,B,K = map(int,input().split())
if K > A:
    K = K - A
    A = 0
    B -= K
else:
    A -= K

print("{} {}".format(A,B))

Failing test case input:
143395449423 9468746842 1010010100011

Expected output:
0 0


Actual output:
0 -857145903746


Fixed submission (verdict: Accepted):
A,B,K = map(int,input().split())
if K > A:
    K = K - A
    A = 0
    B -= K
else:
    A -= K

print("{} {}".format(A,max(B,0)))

Problem: p02818
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,k = map(int, input().split())

if k > a+b:
  if k > a:
    print('0 ' + str(b-(k-a)))
  else:
    print(str(k-a)+' '+str(b))
else:
  print('0 0')

Failing test case input:
498881727339 50858735181 0000001100000

Expected output:
498880627339 50858735181


Actual output:
0 0


Fixed submission (verdict: Accepted):
a,b,k = map(int, input().split())

if a>k:
  print(str(a-k)+' '+str(b))
else:
  if k < a+b:
    if k >= a:
      print('0 ' + str(b-(k-a)))
    else:
      print(str(k-a)+' '+str(b))
  else:
    print('0 0')

Problem: p02818
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, K = map(int, input().split())
if A >=  K:
    la = A - K
    lb = B
else:
    la = 0
    lb = A + B - K
print(la, lb)

Failing test case input:
82916368507 3894888655 1010010100011

Expected output:
0 0


Actual output:
0 -923198842849


Fixed submission (verdict: Accepted):
A, B, K = map(int, input().split())
if A >=  K:
    la = A - K
    lb = B
else:
    la = 0
    lb = A + B - K
    if lb < 0:
        lb = 0
print(la, lb)
Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

s = input()
len_s = len(s)

ret = 0
def calc_cumsum(idx,right_str):
    if idx == len(right_str):
        return int(right_str)
    _ifplus = int(right_str[0:idx])* (2**(len(right_str[idx:len_s]) -1 )) + calc_cumsum(1,right_str[idx:len_s])
    _ifnotplus = calc_cumsum(idx+1,right_str)
    print(_ifplus+_ifnotplus)
    return (_ifplus+_ifnotplus)
print(calc_cumsum(1,s))


Failing test case input:
393

Expected output:
546


Actual output:
105
435
546
546


Fixed submission (verdict: Accepted):

s = input()
len_s = len(s)

ret = 0
def calc_cumsum(idx,right_str):
    if idx == len(right_str):
        return int(right_str)
    _ifplus = int(right_str[0:idx])* (2**(len(right_str[idx:len_s]) -1 )) + calc_cumsum(1,right_str[idx:len_s])
    _ifnotplus = calc_cumsum(idx+1,right_str)
    return (_ifplus+_ifnotplus)
print(calc_cumsum(1,s))

Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    s = input()

    A = []
    for i in range(len(s)):
        for j in range(i, len(s)):
            tmp = ""
            for k in range(i, j + 1):
                tmp += s[k]
            else:
                A.append(int(tmp))
                tmp = ""
            for k in range(j + 1, len(s)):
                tmp += s[k]
            else:
                pass
                
    print(sum(A) + int(s[0]) + int(s[-1]))

if __name__ == "__main__":
    main()

Failing test case input:
9999999999

Expected output:
12656242944

Actual output:
12345678963


Fixed submission (verdict: Accepted):
def main():
    s = input()
    ans = 0
    for i in range(2 ** (len(s) - 1)):
        tmp = ""
        for j in range(len(s)):
            tmp += s[j]
            if(j < len(s) - 1):
                if (i >> j) & 1:
                    tmp += "+"
        else:
            
            ans += eval(tmp)
    else:
        print(ans)

if __name__ == "__main__":
    main()

Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = str(input())
l = list(map(str,(map(bin,range(2**(len(S)-1))))))
print(l)

ans = 0
for i in range(len(l)):
    ev = l[i][2:].zfill(len(S)-1)
    res = 0
    num_str = S[0]
    for j in range(1,len(S)):
        if(ev[j-1] == '0'):
            num_str = num_str + S[j]
        else:
            res += int(num_str)
            num_str = S[j]
    res += int(num_str)
    ans += res

print(ans)

Failing test case input:
1573

Expected output:
2576


Actual output:
['0b0', '0b1', '0b10', '0b11', '0b100', '0b101', '0b110', '0b111']
2576


Fixed submission (verdict: Accepted):
S = str(input())
l = list(map(str,(map(bin,range(2**(len(S)-1))))))

ans = 0
for i in range(len(l)):
    ev = l[i][2:].zfill(len(S)-1)
    res = 0
    num_str = S[0]
    for j in range(1,len(S)):
        if(ev[j-1] == '0'):
            num_str = num_str + S[j]
        else:
            res += int(num_str)
            num_str = S[j]
    res += int(num_str)
    ans += res

print(ans)
Problem: p03999
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = input()
l = len(n)
ans = 0
for i in range(l):
  for j in range(l-i):
    ans+=int(n[i])*(10**j)*(2**(l-1-j))
print(ans)

Failing test case input:
413

Expected output:
482


Actual output:
532


Fixed submission (verdict: Accepted):
S = input()
n = len(S)
ans = 0
for i in range(n):
  a = int(S[i])
  for j in range(n-i):
    ans += a * 10**j * 2**i * 2**(max(0,n-i-j-2))
print(ans)

Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = [int(i) for i in input()]

N = len(S)

tens = [10**i for i in range(N)]

tens.reverse()

twos = [1]
twos.extend(2**i for i in range(N-1))

sums = 0
all_comb = sum(twos)
for i in range(N):
    tmp = [x*y for x, y in zip(tens[i:], twos)]
    exp = S[i] * sum(tmp) / sum(twos)
    print(exp)
    sums = sums + exp
    del twos[-1]
print(sums * all_comb)

Failing test case input:
9999999999

Expected output:
12656242944

Actual output:
19775389.5
3955077.0
791014.5
158202.0
31639.5
6327.0
1264.5
252.0
49.5
9.0
12656242944.0


Fixed submission (verdict: Accepted):
S = [int(i) for i in input()]

N = len(S)

tens = [10**i for i in range(N)]

tens.reverse()

twos = [1]
twos.extend(2**i for i in range(N-1))

sums = 0
all_comb = sum(twos)
for i in range(N):
    tmp = [x*y for x, y in zip(tens[i:], twos)]
    exp = S[i] * sum(tmp) / sum(twos)
    sums = sums + exp
    del twos[-1]
print(int(sums * all_comb))

Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
combination = 2 ** (len(S) - 1)

ans = 0
for i in range(combination):
    
    bin_str = bin(i)[2:]

    
    bin_str = '0' * (len(S) - len(bin_str) - 1) + bin_str

    formula = ''
    for i, s_char in enumerate(S):
        
        plus = ''
        if len(S) - 1 != i and bin_str[i] == '1':
            plus = '+'

        formula += s_char + plus

    
    ans += eval(formula)

Failing test case input:
353

Expected output:
458


Actual output:

Fixed submission (verdict: Accepted):
S = input()
combination = 2 ** (len(S) - 1)

ans = 0
for i in range(combination):
    
    bin_str = bin(i)[2:]

    
    bin_str = '0' * (len(S) - len(bin_str) - 1) + bin_str

    formula = ''
    for i, s_char in enumerate(S):
        
        plus = ''
        if len(S) - 1 != i and bin_str[i] == '1':
            plus = '+'

        formula += s_char + plus

    
    ans += eval(formula)

print(ans)

Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def dfs(i, f):
    if i == n - 1:
        return sum(list(map(int, f.split("+"))))

    
    dfs(i + 1, f + s[i + 1])
    dfs(i + 1, f + "+" + s[i + 1])


s = input()
n = len(s)

print(dfs(0, s[0]))

Failing test case input:
1455

Expected output:
2280


Actual output:
None


Fixed submission (verdict: Accepted):
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+1,f+"+"+s[i+1])
print(dfs(0,s[0]))
Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
ans = 0
for num in range(2*((len(S)-1))):
  before = 0
  nums = []
  for i in range(len(S)-1):
    if num>>i&1:
      nums.append(int(S[before:i+1]))
      before = i+1
  nums.append(int(S[before:]))
  ans += sum(nums)
print(ans)

Failing test case input:
9999999999

Expected output:
12656242944

Actual output:
11248323957


Fixed submission (verdict: Accepted):
S = input()
ans = 0
for num in range(2**((len(S)-1))):
  before = 0
  nums = []
  for i in range(len(S)-1):
    if num>>i&1:
      nums.append(int(S[before:i+1]))
      before = i+1
  nums.append(int(S[before:]))
  ans += sum(nums)
print(ans)

Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
l=len(s)
ans=0
for i in range( 1<< (l-1)):
    temp=int(s[0])
    value=0
    for j in range(l-1):
        if i>>j &1:
            value+=temp
            temp=int(s[j+1])
        else :
            temp=10*temp+int(s[j+1])
    value+=temp
    ans+=value
    print(value)
    
print(ans)
    

Failing test case input:
541

Expected output:
652


Actual output:
541
46
55
10
652


Fixed submission (verdict: Accepted):
s=input()
l=len(s)
ans=0
for i in range( 1<< (l-1)):
    temp=int(s[0])
    value=0
    for j in range(l-1):
        if i>>j &1:
            value+=temp
            temp=int(s[j+1])
        else :
            temp=10*temp+int(s[j+1])
    value+=temp
    ans+=value
    
    
print(ans)

Problem: p03999
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = str(input())
n = len(s)

ans = 0
for bit in range(1 << (n-1)):
    f = s[0]
    for j in range(n-1):
        if bit & (1 << j):
            f += '+'
        f += s[j+1]
    ans += sum(map(int,f.split('+')))
    print(f)
print(ans)


Failing test case input:
1455

Expected output:
2280


Actual output:
1455
1+455
14+55
1+4+55
145+5
1+45+5
14+5+5
1+4+5+5
2280


Fixed submission (verdict: Accepted):
s = str(input())
n = len(s)

ans = 0
for bit in range(1 << (n-1)):
    f = s[0]
    for j in range(n-1):
        if bit & (1 << j):
            f += '+'
        f += s[j+1]
    ans += sum(map(int,f.split('+')))

print(ans)
Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N_0 = input()
N = list(N_0)
m = len(N)
ans = 0


numbers = list(range(1,m))

n = len(numbers)
box = []

for i  in range(2 ** n):
    box_0 = []
    for j in range(n):
        if ((i >> j)&1):
            box_0.append(numbers[j])
            

    box.append(box_0)

box[0]=0

for j in range(len(box)):
    M = list(N_0)
    if j == 0:
        ans+=int(N_0)
    else:
        for k in range(len(box[j])):
            if k ==0:
                M.insert(box[j][k],"+")
            else:
                M.insert(box[j][k]+1,"+")
                
        ans += eval("".join(M))
            
print("{}".format(ans))
        
        

Failing test case input:
1479

Expected output:
2400


Actual output:
2463


Fixed submission (verdict: Accepted):
N_0 = input()
N = list(N_0)
m = len(N)
ans = 0


numbers = list(range(1,m))

n = len(numbers)
box = []

for i  in range(2 ** n):
    box_0 = []
    for j in range(n):
        if ((i >> j)&1):
            box_0.append(numbers[j])
            

    box.append(box_0)

box[0]=0

for j in range(len(box)):
    M = list(N_0)
    if j == 0:
        ans+=int(N_0)
    else:
        for k in range(len(box[j])):
            if k ==0:
                M.insert(box[j][k],"+")
            else:
                M.insert(box[j][k]+k,"+")
                
            
                
        ans += eval("".join(M))
            
print("{}".format(ans))

Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
Sl = [s for s in S]

plusi = len(S) - 1

total = 0
for i in range(plusi**2):
    prej = 0
    for j in range(plusi):
        if (i >> j) & 1:
            total += int(S[prej:j+1])
            prej = j + 1
    total += int(S[prej:plusi+1])
print(total)

Failing test case input:
1455

Expected output:
2280


Actual output:
3735


Fixed submission (verdict: Accepted):
S = input()
plusi = len(S) - 1

total = 0
for i in range(2**plusi):
    prej = 0
    ret = []
    for j in range(plusi):
        if (i >> j) & 1:
            total += int(S[prej:j+1])
            prej = j + 1
    total += int(S[prej:plusi+1])
print(total)

Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
n=len(s)-1
ans=0
for bit in range(1<<n):
    f=s[0]
    for i in range(n):
        if ((bit>>i)&1):
            f+="+"
        f+=s[i+1]
    for i in f.split("+"):
        ans+=int(i)
        print(i)
print(ans)

Failing test case input:
541

Expected output:
652


Actual output:
541
5
41
54
1
5
4
1
652


Fixed submission (verdict: Accepted):
s=input()
n=len(s)-1
ans=0
for bit in range(1<<n):
    f=s[0]
    for i in range(n):
        if ((bit>>i)&1):
            f+="+"
        f+=s[i+1]
    for i in f.split("+"):
        ans+=int(i)
print(ans)
Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
cnt=len(s)-1
for i in range(2**cnt):
    sum=s[0]
    for j in range(cnt):
        if ((i>>j)&1):
            sum+="+"
        sum+=s[j+1]
    print(eval(sum))
            


Failing test case input:
711

Expected output:
810


Actual output:
711
18
72
9


Fixed submission (verdict: Accepted):
s=input()
cnt=len(s)-1
ans=0
for i in range(2**cnt):
    sum=s[0]
    for j in range(cnt):
        if ((i>>j)&1):
            sum+="+"
        else:
            pass
        sum+=s[j+1]
    ans+=eval(sum)
print(ans)
Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    S = input()
    memo = dict()

    def helper(S, i):
        
        if i == len(S): return [0, 1]
        if i == len(S)-1: return [int(S[i]), 1]

        if i not in memo:
            memo[i] = [0, 0]
            for j in range(i+1, len(S)+1):
                if j not in memo:
                    memo[j] = helper(S, j)
                memo[i][0] += int(S[i:j])*memo[j][1] + memo[j][0]
                memo[i][1] += memo[j][1]
            print(memo)
        return memo[i]

    return helper(S, 0)[0]

if __name__ == '__main__':

    print(main())


Failing test case input:
9999999999

Expected output:
12656242944

Actual output:
{0: [0, 0], 1: [0, 0], 2: [0, 0], 3: [0, 0], 4: [0, 0], 5: [0, 0], 6: [0, 0], 7: [0, 0], 8: [117, 2], 9: [9, 1], 10: [0, 1]}
{0: [0, 0], 1: [0, 0], 2: [0, 0], 3: [0, 0], 4: [0, 0], 5: [0, 0], 6: [0, 0], 7: [1242, 4], 8: [117, 2], 9: [9, 1], 10: [0, 1]}
{0: [0, 0], 1: [0, 0], 2: [0, 0], 3: [0, 0], 4: [0, 0], 5: [0, 0], 6: [12600, 8], 7: [1242, 4], 8: [117, 2], 9: [9, 1], 10: [0, 1]}
{0: [0, 0], 1: [0, 0], 2: [0, 0], 3: [0, 0], 4: [0, 0], 5: [126432, 16], 6: [12600, 8], 7: [1242, 4], 8: [117, 2], 9: [9, 1], 10: [0, 1]}
{0: [0, 0], 1: [0, 0], 2: [0, 0], 3: [0, 0], 4: [1265328, 32], 5: [126432, 16], 6: [12600, 8], 7: [1242, 4], 8: [117, 2], 9: [9, 1], 10: [0, 1]}
{0: [0, 0], 1: [0, 0], 2: [0, 0], 3: [12655584, 64], 4: [1265328, 32], 5: [126432, 16], 6: [12600, 8], 7: [1242, 4], 8: [117, 2], 9: [9, 1], 10: [0, 1]}
{0: [0, 0], 1: [0, 0], 2: [126561024, 128], 3: [12655584, 64], 4: [1265328, 32], 5: [126432, 16], 6: [12600, 8], 7: [1242, 4], 8: [117, 2], 9: [9, 1], 10: [0, 1]}
{0: [0, 0], 1: [1265621760, 256], 2: [126561024, 128], 3: [12655584, 64], 4: [1265328, 32], 5: [126432, 16], 6: [12600, 8], 7: [1242, 4], 8: [117, 2], 9: [9, 1], 10: [0, 1]}
{0: [12656242944, 512], 1: [1265621760, 256], 2: [126561024, 128], 3: [12655584, 64], 4: [1265328, 32], 5: [126432, 16], 6: [12600, 8], 7: [1242, 4], 8: [117, 2], 9: [9, 1], 10: [0, 1]}
12656242944


Fixed submission (verdict: Accepted):
def main():
    S = input()
    memo = dict()

    def helper(S, i):
        
        if i == len(S): return [0, 1]
        if i == len(S)-1: return [int(S[i]), 1]

        if i not in memo:
            memo[i] = [0, 0]
            for j in range(i+1, len(S)+1):
                if j not in memo:
                    memo[j] = helper(S, j)
                memo[i][0] += int(S[i:j])*memo[j][1] + memo[j][0]
                memo[i][1] += memo[j][1]
            
        return memo[i]

    return helper(S, 0)[0]

if __name__ == '__main__':

    print(main())
Problem: p03999
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S=input()
N=len(S)

ans=2**(N-1)*int(S[-1])
for i in range(1<<(N-1)):
    res=1
    for j in range(N-1):
        if (i>>j)%2==1:
            res*=10
        else:
            res=1
        ans+=res*int(S[N-1-j])
print(ans)


Failing test case input:
497

Expected output:
674


Actual output:
1190


Fixed submission (verdict: Accepted):
S=input()
N=len(S)

ans=2**(N-1)*int(S[-1])
for i in range(1<<(N-1)):
    res=1
    for j in range(N-1):
        if (i>>j)%2==1:
            res*=10
        else:
            res=1
        ans+=res*int(S[N-2-j])
print(ans)

Problem: p03999
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = input()
l = len(n)
ans = 0
for i in range(l):
  for j in range(l-1):
    ans+=int(n[i])*(10**j)*(2**(l-1-j-1))
print(ans)

Failing test case input:
1455

Expected output:
2280


Actual output:
1860


Fixed submission (verdict: Accepted):
S = input()
n = len(S)
ans = 0
for i in range(n):
  a = int(S[i])
  for j in range(n-i):
    ans += a * 10**j * 2**i * 2**(max(0,n-i-j-2))
print(ans)

Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = [int(i) for i in input()]

N = len(S)

tens = [10**i for i in range(N)]

tens.reverse()

twos = [1]
twos.extend(2**i for i in range(N-1))

sums = 0
all_comb = sum(twos)
for i in range(N):
    tmp = [x*y for x, y in zip(tens[i:], twos)]
    exp = S[i] * sum(tmp) / sum(twos)
    sums = sums + exp
    del twos[-1]
print(sums * all_comb)

Failing test case input:
1455

Expected output:
2280


Actual output:
2280.0


Fixed submission (verdict: Accepted):
S = [int(i) for i in input()]

N = len(S)

tens = [10**i for i in range(N)]

tens.reverse()

twos = [1]
twos.extend(2**i for i in range(N-1))

sums = 0
all_comb = sum(twos)
for i in range(N):
    tmp = [x*y for x, y in zip(tens[i:], twos)]
    exp = S[i] * sum(tmp) / sum(twos)
    sums = sums + exp
    del twos[-1]
print(int(sums * all_comb))

Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools
num = str(input())

olist = [int(i+1) for i in range(len(num)-1)]
comblist = []
for i, _ in enumerate(olist, 1):     
    for j in itertools.combinations(olist, r=i):
        comblist.append(j)

L = []
for i in range(len(comblist)):
  t = num
  for j in range(len(comblist[i])):
    t = t[0:comblist[i][j]+j] + "," + t[comblist[i][j]+j:]
  L.append(t)
print(L)

out = 0
for i in range(len(L)):
  t = L[i].split(",")
  for j in range(len(t)):
    out += int(t[j])
print(out+int(num))

Failing test case input:
517

Expected output:
610


Actual output:
['5,17', '51,7', '5,1,7']
610


Fixed submission (verdict: Accepted):
import itertools
num = str(input())

olist = [int(i+1) for i in range(len(num)-1)]
comblist = []
for i, _ in enumerate(olist, 1):     
    for j in itertools.combinations(olist, r=i):
        comblist.append(j)

L = []
for i in range(len(comblist)):
  t = num
  for j in range(len(comblist[i])):
    t = t[0:comblist[i][j]+j] + "," + t[comblist[i][j]+j:]
  L.append(t)

out = 0
for i in range(len(L)):
  t = L[i].split(",")
  for j in range(len(t)):
    out += int(t[j])
print(out+int(num))
Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

def dfs( i,  f ):
    if i == len( s ) - 1:
        return sum( list( map( int, f.split( "+" ))))
    return dfs( i + 1, f + s[ i  + 1 ] ) + dfs( i + 1, f +  "+" + s[  i   + 1 ])
dfs( 0, s[ 0 ])

Failing test case input:
393

Expected output:
546


Actual output:

Fixed submission (verdict: Accepted):
s = input()
 
def dfs( i,  f ):
    if i == len( s ) - 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 ]) )

Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
import copy



S = input()
op_list = ["+"]*(len(S)-1)

sum = 0
for i in range(2**len(op_list)):

    for j in range(len(op_list)):

        if (i >> j) & 1:
            op_list[j] = ""
    s = ""
    for k in range(len(op_list)):
        s = s + S[k] + op_list[k]
    s = s + S[len(S)-1]
    sum = sum + eval(s)


print(sum)
    




Failing test case input:
1455

Expected output:
2280


Actual output:
6159


Fixed submission (verdict: Accepted):
import sys
import copy



S = input()
op_list = ["+"]*(len(S)-1)

sum = 0
for i in range(2**len(op_list)):
    op_list = ["+"]*(len(S)-1)
    for j in range(len(op_list)):

        if (i >> j) & 1:
            op_list[j] = ""
    s = ""
    for k in range(len(op_list)):
        s = s + S[k] + op_list[k]
    s = s + S[len(S)-1]
    sum = sum + eval(s)


print(sum)

Problem: p03999
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=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)
        

Failing test case input:
2515

Expected output:
3452


Actual output:
21692


Fixed submission (verdict: Accepted):
s=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)

Problem: p03999
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = input()
l = len(n)
ans = 0
for i in range(l):
  for j in range(l-i):
    ans+=int(n[i]) * 10**j * 2**i * 2**(l-i-j-2)
print(ans)

Failing test case input:
1455

Expected output:
2280


Actual output:
1260.0


Fixed submission (verdict: Accepted):
S = input()
n = len(S)
ans = 0
for i in range(n):
  a = int(S[i])
  for j in range(n-i):
    ans += a * 10**j * 2**i * 2**(max(0,n-i-j-2))
print(ans)
Problem: p03999
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def calc(n):
    if n <= 1:
        return 1
    else:
        return 2 ** (n - 1)


def normailze(s, n):
    return (n - len(s)) * '0' + s


def solution(s):
    a = calc(len(s))
    cnt = 0
    n = len(s)
    if n ==1:
        return int(s)
    for i in range(a):
        binary = normailze(bin(i)[2:], n - 1)
        b = s[0]
        f = 1
        for j in binary:
            if int(j) == 1:
                cnt += int(b)
                b = s[f]
                f += 1
            else:
                b += s[f]
                f += 1
        cnt += int(b)
    return cnt
print(input())

Failing test case input:
1573

Expected output:
2576


Actual output:
1573


Fixed submission (verdict: Accepted):
def calc(n):
    if n <= 1:
        return 1
    else:
        return 2 ** (n - 1)


def normailze(s, n):
    return (n - len(s)) * '0' + s


def solution(s):
    a = calc(len(s))
    cnt = 0
    n = len(s)
    if n ==1:
        return int(s)
    for i in range(a):
        binary = normailze(bin(i)[2:], n - 1)
        b = s[0]
        f = 1
        for j in binary:
            if int(j) == 1:
                cnt += int(b)
                b = s[f]
                f += 1
            else:
                b += s[f]
                f += 1
        cnt += int(b)
    return cnt

print(solution(input()))

Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
cnt=len(s)-1
for i in range(2**cnt):
    sum=s[0]
    for j in range(cnt):
        if ((i>>j)&1):
            sum+="+"
        else:
            pass
        sum+=s[j+1]
    print(eval(sum))
            


Failing test case input:
1573

Expected output:
2576


Actual output:
1573
574
88
79
160
61
25
16


Fixed submission (verdict: Accepted):
s=input()
cnt=len(s)-1
ans=0
for i in range(2**cnt):
    sum=s[0]
    for j in range(cnt):
        if ((i>>j)&1):
            sum+="+"
        else:
            pass
        sum+=s[j+1]
    ans+=eval(sum)
print(ans)

Problem: p03999
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def dfs(i, formula):
    if i + 1 == num_digits:
        return sum(list(map(int, formula.split("+"))))

    return dfs(i + 1, formula + "+" + s[i + 1]) + dfs(i + 1, formula + s[i + 1])


s = input()
num_digits = len(s)

dfs(0, s[0])


Failing test case input:
497

Expected output:
674


Actual output:

Fixed submission (verdict: Accepted):
def dfs(i, formula):
    if i + 1 == num_digits:
        return sum(list(map(int, formula.split("+"))))

    return 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]))

Problem: p03999
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S = input()
n = len(S)
ans = 0
for i in range(n):
  a = int(S[i])
  for j in range(n-i):
    ans+=a * 10**j * 2**i * 2**(n-i-j-2)
print(ans)

Failing test case input:
517

Expected output:
610


Actual output:
336.0


Fixed submission (verdict: Accepted):
S = input()
n = len(S)
ans = 0
for i in range(n):
  a = int(S[i])
  for j in range(n-i):
    ans += a * 10**j * 2**i * 2**(max(0,n-i-j-2))
print(ans)
Problem: p03999
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
s = "9999999999"
S=len(s)
ans = ''
for i in range(2**(S-1)):
    ans+=s[0]
    for j in range(0,S-1):
        if i>>j&1:
            ans+=""+s[j+1]
        else:
            ans+=" "+s[j+1]
    ans+=" "
 

print(sum(map(int,ans.split())))

Failing test case input:
541

Expected output:
652


Actual output:
12656242944


Fixed submission (verdict: Accepted):
s = input()
S=len(s)
ans = ''
for i in range(2**(S-1)):
    ans+=s[0]
    for j in range(0,S-1):
        if i>>j&1:
            ans+=""+s[j+1]
        else:
            ans+=" "+s[j+1]
    ans+=" "
 

print(sum(map(int,ans.split())))

Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



S = input()
Slist = list(S)

def cut(l, i): 
    n = len(l)
    if n == 1:
        return int(l[0])+i 
    else: 
        sum = int(''.join(l))+i 
        sum2 = 0
        for jj in range(n-1):
            j=jj+1 
            
            
            
            sum = sum + cut(l[j:n], int(''.join(l[0:j]))) + i

        return int(sum)
print(cut(Slist, 0))

Failing test case input:
1455

Expected output:
2280


Actual output:
2279


Fixed submission (verdict: Accepted):
S = input()
Slist = list(S)
def cut(l, i): 
    n = len(l)
    if n == 1:
        return int(l[0])+i 
    if n == 0:
        return 0
    else: 
        sum = int(''.join(l))+i 
        for jj in range(n-1):
            
            j=jj+1 
            
            sum += cut(l[j:n], int(''.join(l[0:j]))+i)
            
        return int(sum)
        
print(cut(Slist, 0))

Problem: p03999
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S = input()
n = len(S)
ans = 0
for i in range(n):
  for j in range(n-i):
    ans+=int(S[i]) * 10**j * 2**i * 2**(n-i-j-2)
print(ans)

Failing test case input:
541

Expected output:
652


Actual output:
360.0


Fixed submission (verdict: Accepted):
S = input()
n = len(S)
ans = 0
for i in range(n):
  a = int(S[i])
  for j in range(n-i):
    ans += a * 10**j * 2**i * 2**(max(0,n-i-j-2))
print(ans)

Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
n = len(s)
ans = 0
for i in range(2**(n-1)):
  plus = [0]
  for j in range(n-1):
    if (i >> j) & 1 == 1:
      plus += [j+1]
  for j in range(len(plus)-1):
    ans += int(s[plus[j]:plus[j+1]])
print(ans)    

Failing test case input:
9999999999

Expected output:
12656242944

Actual output:
1406244096


Fixed submission (verdict: Accepted):
s = input()
n = len(s)
ans = 0
for i in range(2**(n-1)):
  plus = [0]
  for j in range(n-1):
    if (i >> j) & 1 == 1:
      plus += [j+1]
  plus += [n]
  for j in range(len(plus)-1):
    ans += int(s[plus[j]:plus[j+1]])
print(ans)
Problem: p03999
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = input()
n = len(s)
ans = 0

for i in range(2**(n-1)):
    f = ""
    for j in range(n):
        f += s[j]
        
        if i>>j & 1 == 1:
            f += "+"
    print(f)
    ans += eval(f)
print(ans)

Failing test case input:
711

Expected output:
810


Actual output:
711
7+11
71+1
7+1+1
810


Fixed submission (verdict: Accepted):
s = input()
n = len(s)
ans = 0

for i in range(2**(n-1)):
    f = ""
    for j in range(n):
        f += s[j]
        
        if i>>j & 1 == 1:
            f += "+"
    
    ans += eval(f)
print(ans)

Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(map(int,list(input())))
n = len(s)
m = 0
for i in range(n):
  for j in range(n-i):
    m += s[i]*2**max(n-j-2,0)*10**j
print(m)
  

Failing test case input:
413

Expected output:
482


Actual output:
466


Fixed submission (verdict: Accepted):
s = list(map(int,list(input())))
n = len(s)
m = 0
for i in range(n):
  for j in range(n-i):
    m += s[i]*2**i*10**j*2**(max(n-i-j-2,0))
print(m)

Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools


def sum_strlong(strlong):
    ans = int(strlong)
    for i in range(1, len(strlong)):
        for comb in itertools.combinations(range(len(strlong)-1), i):
            integer = ''
            for j, digit in enumerate(strlong):
                integer += digit
                if j in comb:
                    integer += '+'
            ans += eval(integer)
    return ans


if __name__ == '__main__':
    print(sum_strlong('9'*10))

Failing test case input:
413

Expected output:
482


Actual output:
12656242944


Fixed submission (verdict: Accepted):
import itertools


def sum_strlong(strlong):
    ans = int(strlong)
    for i in range(1, len(strlong)):
        for comb in itertools.combinations(range(len(strlong)-1), i):
            integer = ''
            for j, digit in enumerate(strlong):
                integer += digit
                if j in comb:
                    integer += '+'
            ans += eval(integer)
    return ans


def main():
    print(sum_strlong(input()))


main()
Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

op_count = len(s) - 1
op_list = []
for i in range(2**op_count):
    op = [''] * op_count
    for j in range(op_count):
        if (i >> j) & 1:
            op[op_count - 1 - j] = '+'
    op_list.append(op)

ans = 0
for i in range(2 * op_count):
    cur = 1
    t = s
    for j in range(op_count):
        if op_list[i][j] == '+':
            t = t[:j + cur] + "+" + t[j + cur:]
            cur += 1
    ans += eval(t)
print(ans)

Failing test case input:
1455

Expected output:
2280


Actual output:
2205


Fixed submission (verdict: Accepted):
s = input()

op_count = len(s) - 1
op_list = []
for i in range(2**op_count):
    op = [''] * op_count
    for j in range(op_count):
        if (i >> j) & 1:
            op[op_count - 1 - j] = '+'
    op_list.append(op)

ans = 0
for i in range(2**op_count):
    cur = 1
    t = s
    for j in range(op_count):
        if op_list[i][j] == '+':
            t = t[:j + cur] + "+" + t[j + cur:]
            cur += 1
    ans += eval(t)
print(ans)

Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
l=len(s)
x=[0]*l
for i in range(l):
  for j in range(i,l):
    x[j]+=int(s[i])*(i+1)
a=0
for i in range(l):
  a+=x[i]*(10**(l-i-1))
print(a)

Failing test case input:
517

Expected output:
610


Actual output:
598


Fixed submission (verdict: Accepted):
s=input()
l=len(s)
x=[0]*l
for i in range(l):
  for j in range(i,l):
    if j-i>0:
      x[j]+=int(s[i])*(2**i)*(2**(j-i-1))
    else:
      x[j]+=int(s[i])*(2**i)
a=0
for i in range(l):
  a+=x[i]*(10**(l-i-1))
print(a)

Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
cnt=len(s)-1
for i in range(2**cnt):
    sum=s[0]
    for j in range(cnt):
        if ((i>>j)&1):
            sum+="+"
        else:
            sum+="-"
        sum+=s[j+1]
    print(eval(sum))
            

Failing test case input:
353

Expected output:
458


Actual output:
-5
5
1
11


Fixed submission (verdict: Accepted):
s=input()
cnt=len(s)-1
ans=0
for i in range(2**cnt):
    sum=s[0]
    for j in range(cnt):
        if ((i>>j)&1):
            sum+="+"
        else:
            pass
        sum+=s[j+1]
    ans+=eval(sum)
print(ans)

Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
(lambda nums: (lambda index, itertools=__import__("itertools"): print(sum([eval("".join((lambda t: [[t.insert(j, "+") for j in reversed(i)], t][1])(list(nums)))) for i in itertools.chain(*[itertools.combinations(index, x) for x in range(len(index) + 1)])])))(range(1, len(nums))))("1234")

Failing test case input:
541

Expected output:
652


Actual output:
1736


Fixed submission (verdict: Accepted):
(lambda nums: (lambda index, itertools=__import__("itertools"): print(sum([eval("".join((lambda t: [[t.insert(j, "+") for j in reversed(i)], t][1])(list(nums)))) for i in itertools.chain(*[itertools.combinations(index, x) for x in range(len(index) + 1)])])))(range(1, len(nums))))(input())
Problem: p03999
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=input()
ans=0
def dfs(i,flag):
  global ans
  if i!=len(n)-1:
    dfs(i+1,flag)
    dfs(i+1,flag|2**i)
  else:
    num=[]
    start=0
    for i in range(len(n)):
      if flag&2**i>0:
        num.append(int(n[start:i+1]))
        start=i+1
    ans+=sum(num)
dfs(0,0)
print(ans)

Failing test case input:
1455

Expected output:
2280


Actual output:
240


Fixed submission (verdict: Accepted):
n=input()
ans=0
def dfs(i,flag):
  global ans
  if i!=len(n)-1:
    dfs(i+1,flag)
    dfs(i+1,flag|2**i)
  else:
    num=[]
    start=0
    for i in range(len(n)):
      if flag&2**i>0:
        num.append(int(n[start:i+1]))
        start=i+1
    if start!=n:
      num.append(int(n[start:]))
    ans+=sum(num)
dfs(0,0)
print(ans)
Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

N = int(input())

min_l = len(str(N))

if type(math.sqrt(N)) is int:
    for i in range(1, int(math.sqrt(N))):
        if N % i == 0:
            j = int(N / i)
            min_l = min(min_l, max(len(str(i)), len(str(j))))
    print(min_l)
else:
    print(min_l)


Failing test case input:
4625312013

Expected output:
5


Actual output:
10


Fixed submission (verdict: Accepted):
import math

N = int(input())

min_l = len(str(N))

for i in range(1, int(math.sqrt(N)) + 1):
    if N % i == 0:
        j = int(N / i)
        min_l = min(min_l, max(len(str(i)), len(str(j))))
print(min_l)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
ans = 10**10+1
for i in range(1, int(n**0.5)+1):
    if n%i != 0:
        continue
    n /= i
    if n <= ans:
        ans = n
ans = len(str(int(ans)))
print(ans)

Failing test case input:
10605

Expected output:
3


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
ans = 10**10+1
for i in range(1, int(n**0.5)+1):
    if n%i != 0:
        continue
    tmp = n
    tmp /= i
    if tmp <= ans:
        ans = tmp
ans = len(str(int(tmp)))
print(ans)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from math import sqrt
n = int(input())
x = n
i = 2
while i <= sqrt(n):
    if n % i == 0:
        x = n / i
    i += 1
print(len(str(x)))


Failing test case input:
6645842010

Expected output:
7


Actual output:
9


Fixed submission (verdict: Accepted):
from math import sqrt
n = int(input())
x = n
i = 2
while i <= sqrt(n):
    if n % i == 0:
        x = n / i
    i += 1
print(len(str(int(x))))

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
f=[0]*int(n**0.5)
for a in range(int(n**0.5)):
    b=n/(a+1)
    f[a]=max(len(str(a)), len(str(b)))
print(min(f)-2)

Failing test case input:
7026

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
n=int(input())
f=[10]*int(n**0.5)
for a in range(int(n**0.5)):
    b=n/(a+1)
    if b-int(b)==0:
        f[a]=max(len(str(a)), len(str(int(b))))
print(min(f))

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
ans = n
for i in range(int(n**(1/2))):
  if i * (n-i) == n:
    ans = min(ans, i, n-i)
print(ans)

Failing test case input:
619233107

Expected output:
7


Actual output:
619233107


Fixed submission (verdict: Accepted):
n = int(input())
ans = len(str(n))
for i in range(1, int(n**(1/2))+1):
  if n%i == 0:
    ans = min(ans, max(len(str(i)), len(str(n
print(ans)