Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03162 (python)

Fixed submission:
N = int(input())

happiness = list(map(int,input().split()))
dp = happiness # dp: i日目にa~cそれぞれの活動をしたときの幸福度の最大値

for i in range(1,N):
    happiness = list(map(int,input().split()))
    dp_pre = dp.copy()

    dp[0] = max(dp_pre[1],dp_pre[2])+happiness[0] # i日目にaをする場合
    dp[1] = max(dp_pre[0],dp_pre[2])+happiness[1] # i日目にbをする場合
    dp[2] = max(dp_pre[1],dp_pre[0])+happiness[2] # i日目にcをする場合
     
print(max(dp))

Buggy submission (verdict: Runtime Error):
N = int(input())

happiness = list(map(int,input().split()))
dp = happiness # dp: i日目にa~cそれぞれの活動をしたときの幸福度の最大値

for i in range(1,N):
    happiness = list(map(int,input().split()))
    dp_pre = dp.copy()

    dp[0] = max(dp_pre[1],dp_pre[2])+happiness[0] # i日目にaをする場合
    dp[1] = max(dp_pre[0],dp_pre[2])+happiness[1] # i日目にbをする場合
    dp[2] = max(dp_pre[1],dp_pre[0])+happiness[2] # i日目にcをする場合
     
print(max(dp))

Buggy submission (verdict: Runtime Error):
N = int(input())

happiness = list(map(int,input().split()))
dp = happiness # dp: i日目にa~cそれぞれの活動をしたときの幸福度の最大値

for i in range(1,N):
    happiness = list(map(int,input().split()))
    dp_pre = dp.copy()

    dp[0] = max(dp_pre[1],dp_pre[2])+happiness[0] # i日目にaをする場合
    dp[1] = max(dp_pre[0],dp_pre[2])+happiness[1] # i日目にbをする場合
    dp[2] = max(dp_pre[1],dp_pre[0])+happiness[2] # i日目にcをする場合
     
print(max(dp))
Problem p02602 (python)

Fixed submission:
n,k = map(int,input().split())
a = list(map(int,input().split()))
memo = {}

for i in range(k,n):
    if a[i] > a[i-k]:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
a = list(map(int,input().split()))
memo = {}

tmp = 0
before = 1
for i in range(k):
    tmp = before
    before *= a[i]
memo[k-1][0] = before
memo[k-1][1] = tmp

for i in range(k,n):
    before = memo[i-1][0]
    
    tmp = 0
    after = 1
    for j in range(k):
        tmp = 
        after *= a[i-j]
    
    if before < after:
        print("Yes")
    else:
        print("No")
    
    memo[i] = after
Problem p02658 (python)

Fixed submission:
input()
nums = list(map(int,input().split()))

if nums.count(0):
    print(0)
    exit(0)

result=1
for i in nums:
    result *= i
    if result > (10**18):
        print(-1)
        exit(0)
print(result)

Buggy submission (verdict: Runtime Error):
input()
nums = map(int,input().split())

if 0 in nums:
    print(0)
    exit 0

result=1
for i in nums:
    result *= i

if result > (10**18):
    print(-1)
else:
    print(result)
Problem p03106 (python)

Fixed submission:
A, B, K = [int(x) for x in input().split(" ")]

warikiru = []
for i in range(1, min([A,B])+1):
    if A % i == 0 and B % i == 0:
        warikiru.append(i)

warikiru.reverse()
print(warikiru[K-1])

Buggy submission (verdict: Runtime Error):
A, B, K = [int(x) for x in input().split(" ")]

warikiru = []
for i in range(1, min([A,B])):
    if A % i == 0 and B % i == 0:
        warikiru.append(i)

if warikiru == []:
    print(1)
else:
    print(warikiru[-1::-1][K-1])

Buggy submission (verdict: Runtime Error):
A, B, K = [int(x) for x in input().split(" ")]

warikiru = []
for i in range(1, max([A,B])):
    if A % i == 0 and B % i == 0:
        warikiru.append(i)

if warikiru == []:
    print(1)
else:
    print(warikiru[-1::-1][K-1])
Problem p03125 (python)

Fixed submission:
a,b = [int(x) for x in input().split()]
if b % a == 0:
    print(a+b)
else:
    print(b-a)

Buggy submission (verdict: Runtime Error):
n = int(input())
tmp = input()
an = []
for t in tmp.split():
    an.append(int(t))

while True:
    # 最小値を抽出する
    # 最小値以外の要素に対し、int(tmp/min)*minを引く
    min_tmp = 0
    for i in range(len(an)):
        if(an[i] < an[min_tmp] and an[i] > 0):
            min_tmp = i

    # i_min = an.index(min(an))
    i_min = min_tmp
    for i in range(len(an)):
        if i == i_min:
            continue
        an[i] = an[i] - int(an[i]/an[i_min]) * an[i_min]

    flag = True
    for i in range(len(an)):
        if(an[i] > 0 and not i == i_min):
            flag = False
    if flag:
        break

print(an[i_min])
Problem p03325 (python)

Fixed submission:
n = int(input())
a = [int(x) for x in input().split()]
count = 0
judge = False

#奇数
odd = []
#偶数
even = []

# 奇数と偶数に分ける
for i_a in range(len(a)):
    if(a[i_a] % 2 == 0):
        even.append(a[i_a])
    else:
        odd.append(a[i_a])
# もし偶数がいない場合は操作不可能
if(even == []):
    print(0)
    exit()

# 偶数を一つ取り出し、2で割る。次で割れなくなるなら削除
while True:
    count += 1
    even[0] /= 2
    if(even[0] % 2 != 0):
        even.pop(0)
    if(even == []):
        break
        

print(count)


# while True:
#     for i_a in range(len(a)):
#         judge = False
#         if(a[i_a] % 2 == 0):
#             a[i_a] /= 2
#             count += 1
#             judge = True
#             break
#         else:
#             a[i_a] *= 3
        
#     if(not judge):
#         print(count)
#         print(a)
#         exit()


# while True:
#     for i_a in range(len(a)):
#         judge = False
#         if(a[i_a] % 2 == 0):
#             a[i_a] /= 2
#             judge = True
#             break
#         else:
#             a[i_a] *= 3
        
#     if(not judge):
#         print(count)
#         exit()
#     else:
#         count += 1

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(x) for x in input().split()]
count = 0
judge = False

#奇数
odd = []
#偶数
even = []

# 奇数と偶数に分ける
for i_a in range(len(a)):
    if(a[i_a] % 2 == 0):
        even.append(a[i_a])
    else:
        odd.append(a[i_a])
# もし偶数がいない場合は操作不可能
if(even == []):
    print(0)
    exit()

# 偶数を一つ取り出し、2で割る。次で割れなくなるなら削除
max_odd = max(odd)
while True:
    count += 1
    even[0] /= 2
    if(even[0] % 2 != 0):
        even.pop(0)
    if(even == []):
        break
        

print(count)


# while True:
#     for i_a in range(len(a)):
#         judge = False
#         if(a[i_a] % 2 == 0):
#             a[i_a] /= 2
#             count += 1
#             judge = True
#             break
#         else:
#             a[i_a] *= 3
        
#     if(not judge):
#         print(count)
#         print(a)
#         exit()


# while True:
#     for i_a in range(len(a)):
#         judge = False
#         if(a[i_a] % 2 == 0):
#             a[i_a] /= 2
#             judge = True
#             break
#         else:
#             a[i_a] *= 3
        
#     if(not judge):
#         print(count)
#         exit()
#     else:
#         count += 1
Problem p03447 (python)

Fixed submission:
x = int(input())
a = int(input())
b = int(input())

print((x-a) - (x-a)//b*b)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
if a != 0 and a != 50:
    a = a+1
if b != 0 and b != 50:
    b = b+1
if c != 0 and c != 50:
    c = c+1
for i_a in range(a):
    for j_b in range(b):
        for k_c in range(c):
            if(i_a * 500 + j_b * 100 + k_c * 50 == x):
                count = count + 1
if a == b == c == 0:
    count = count + 1
print(count)
Problem p03587 (python)

Fixed submission:
ans = 0
for i in input():
    if i == '1':
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
    ans = 0
    for i in input():
        if i == '1':
            ans += 1
    print(ans)
Problem p03588 (python)

Fixed submission:
al = []
bl = []
for _ in range(int(input())):
    a, b = map(int, input().split(' '))
    al.append(a)
    bl.append(b)
print(max(al) + min(bl))

Buggy submission (verdict: Runtime Error):
    maxx = 2**29
    ans = 0
    for _ in range(int(input())):
        a, b = map(int, input().split(' '))
        if b < maxx:
            maxx = b
            ans = a
    print(ans + maxx)
Problem p03433 (python)

Fixed submission:
import math
 
a = []
for i in range(2):
    a.append(int(input()))
tmp = math.floor(a[0]/500)
tmp1 = a[0] - tmp*500
if a[1] >= tmp1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import math
 
a = []
for i in range(2):
    a.append(input())
tmp = math.floor(a[0]/500)
tmp1 = a[0] - tmp*500
if a[1] >= tmp1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import math

a = []
for i in range(2):
    a.append(input)
tmp = math.floor(a[0]/500)
tmp1 = a[0] - tmp*500
if a[1] >= tmp1:
    print('Yes')
else:
    print('No')
Problem p02621 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# スペース区切りの整数の入力
1<=a<=10
print(a*a*a+a*a+a)

Buggy submission (verdict: Runtime Error):
print(str(a+a*a+a*a*a))

Buggy submission (verdict: Runtime Error):
for a in range (1,11)
print(str(a+a*a+a*a*a))
Problem p02613 (python)

Fixed submission:
n = int(input())
st = [input() for i in range(n)]
print('AC x ' + str(st.count("AC")))
print('WA x ' + str(st.count("WA")))
print('TLE x ' + str(st.count("TLE")))
print('RE x ' + str(st.count("RE")))

Buggy submission (verdict: Runtime Error):
n = int(input())
st = [input() for i in range(N)]
print('AC x ' + str(st.count("AC")))
print('WA x ' + str(st.count("WA")))
print('TLE x ' + str(st.count("TLE")))
print('RE x ' + str(st.count("RE")))
Problem p02639 (python)

Fixed submission:
a,b,c,d,e=map(int,input().split())
if a==0:
  print("1")
elif b==0:
  print("2")
elif c==0:
    print("3")
elif d==0:
  print("4")
else:
  print("5")

Buggy submission (verdict: Runtime Error):
a,b,c,d,e=map(int,input()split())
if a==0:
  print("1")
elif b==0:
  print("2")
elif c==0:
    print("3")
elif d==0:
  print("4")
else:
  print("5")
Problem p02640 (python)

Fixed submission:
x,y=map(int,input().split())
count=0
if y == 2*x or y == 4*x:
    count=1
else:
  for i in range(x):
    for j in range(x):
      if (i+j)==x:
        if (2*i) + (4 * j) == y:
          count+=1     
if count<1:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split())
a=0
b=0
if y == 2*x or y == 4*x:
  print("Yes")
else:
  count=0
  for i in range(0,x):
    for j in range(0,x):
      if (i+j)==x:
        if 2*i + 4 * j == y:
          count=1     
if count==0:
  print("No")
else:
  print("Yes")
Problem p02741 (python)

Fixed submission:
n=int(input())
li = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(li[n-1])

Buggy submission (verdict: Runtime Error):
test_list=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
index=int(input())
print(test_list[index]+1)

Buggy submission (verdict: Runtime Error):
test_list=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
index=int(input())
print(test_list[index])
Problem p02640 (python)

Fixed submission:
XY = input().split()
X = int(XY[0])
Y = int(XY[1])
c = (4*X-Y)/2
t = (Y-2*X)/2
if c >= 0 and int(c) == c:
    if t >= 0 and int(t) == t:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
X = int((input().split())[0])
Y = int((input().split())[1])
c = (4*X-Y)/2
t = (Y-2*X)/2
if c >= 0 and int(c) == c:
    if t >= 0 and int(t) == t:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
X = int(input().split()[0])
Y = int(input().split()[1])
c = (4*X-Y)/2
t = (Y-2*X)/2
if c >= 0 and int(c) == c:
    if t >= 0 and int(t) == t:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
X = int(input().split()[0])
Y = int(input().split()[1])
c = (4*X-Y)/2
t = (Y-2*X)/2
if c >= 0 and int(c) == c:
  if t >= 0 and int(t) == t:
  	print("Yes")
  else:
    print("No")
else:
  print("No")
Problem p02641 (python)

Fixed submission:
XN = input().split()
X = int(XN[0])
N = int(XN[1])
if N == 0:
    print(X)
else:
    p = input().split()
    A = [None]*N
    for i in range(N):
        A[i] = abs(int(p[i])-X)
    if 0 not in A:
        print(X)
    else:
        j = 1
        while A.count(j) == 2:
            j += 1
        if A.count(j) == 0:
            print(X-j)
        else:
            if str(X-j) in p:
                print(X+j)
            else:
                print(X-j)

Buggy submission (verdict: Runtime Error):
XN = input().split()
X = int(XN[0])
N = int(XN[1])
if N == 0:
    print(X)
else:
    p = input.split()
    A = [None]*N
    for i in range(N):
        A[i] = abs(int(p[i])-X)
    j = 0
    while j in A:
        j += 1
    if j == 1:
        print(X-j)
    else:
        if A.count(j-1) == 2:
            print(X-j)
        else:
            if str(X-(j-1)) in p:
                print(X+(j-1))
            else:
                print(X-(j-1))
Problem p02675 (python)

Fixed submission:
N = str(input())
last_num = int(N[-1]) 
 
if last_num == 3:
    print("bon")
elif last_num in [0, 1, 6, 8]:
    print("pon")
else:
    print("hon")

Buggy submission (verdict: Runtime Error):
str(input())
n = int(n[-1]) 
 
if n == 3:
    print("bon")
elif n in [0, 1, 6, 8]:
    print("pon")
else:
    print("hon")

Buggy submission (verdict: Runtime Error):
str(input())
n = int(n[-1]) 
 
if n == 3:
    print("bon")
elif n in [0, 1, 6, 8]:
    print("pon")
else:
    print("hon")

Buggy submission (verdict: Runtime Error):
str(input())
n = int(n[-1]) 

if n == 3:
    print('bon')
elif n in [0, 1, 6, 8]:
    print('pon')
else:
    print('hon')

Buggy submission (verdict: Runtime Error):
str(input())
n = int(n[-1]) 

if n == 3:
    print('bon')
elif n in [0, 1, 6, 8]:
    print('pon')
else:
    print('hon')

Buggy submission (verdict: Runtime Error):
str(input())
n = int(n[-1]) 

if n == 3:
    print('bon')
elif n in [0, 1, 6, 8]:
    print('pon')
else:
    print('hon')
Problem p02705 (python)

Fixed submission:
import math

R = int(input())

circum = R * 2 * math.pi 

print(circum)

Buggy submission (verdict: Runtime Error):
import math

R = str(input())

circum = R * 2 * math.pi 

print(circum)

Buggy submission (verdict: Runtime Error):
import math

R = str(input())

circum = R * 2 * math.pi 

print(circum)
Problem p02600 (python)

Fixed submission:
X = int(input())
a = X // 200
print(10 - a)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
money = 1000
stock = 0
for i in range(N-1):
    if A[i+1] > A[i]:
        stock = money // A[i]
        money = money % A[i]
        money = stock * A[i+1]
print(money)
Problem p02630 (python)

Fixed submission:
import collections
n = int(input())
a = list(map(int, input().split()))
q = int(input())
dic = collections.Counter(a)
sum_list = [x * y for (x, y) in dic.items()]
sum = sum(sum_list)
for i in range(q):
    b, c = map(int, input().split())
    if b in dic and c not in dic:
        sum -= (b - c) * dic[b]
        print(sum)
        dic[c] = dic[b]
        del dic[b]
    elif b in dic and c in dic:
        sum -= (b - c) * dic[b]
        print(sum)
        dic[c] += dic[b]
        del dic[b]
    else:
        print(sum)

Buggy submission (verdict: Runtime Error):
import collections
n = int(input())
a = list(map(int, input().split()))
q = int(input())
dic = collections.Counter(a)
sum_list = [x * y for (x, y) in dic.items()]
sum = sum(sum_list)
for i in range(q):
    if b in dic:
        b, c = map(int, input().split())
        print(sum - (b - c) * dic[b])
Problem p02640 (python)

Fixed submission:
X, Y = map(int, input().split())
for i in range(X+1):
    if 2 * i + 4 * (X - i) == Y:
        print('Yes')
        exit()
print('No')

Buggy submission (verdict: Runtime Error):
2 100
Problem p02657 (python)

Fixed submission:
A, B = map(int, input().split())
C  = A * B
print(C)

Buggy submission (verdict: Runtime Error):
A, B = int(input().split())
C  = A * B
print(C)
Problem p02700 (python)

Fixed submission:
A, B, C, D = map(int, input().split())
while A > 0 and C > 0:
    C = C - B
    if C <= 0:
        break
    else:
        A = A - D
if A <= 0:
    ans = 'No'
else:
    ans = 'Yes'
print(ans)

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
while A > 0 and C > 0:
    C = C - B
    A = A - D
if: A == 0:
    ans = 'No'
else:
    ans = 'Yes'
print(ans)
Problem p02706 (python)

Fixed submission:
N, M = map(int, input().split())
A = list(map(int, input().split()))
B = sum(A)
if B > N:
    ans = -1
else:
    ans = N - B
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input(),split()))
sum = sum(A)
if sum > N:
    ans = -1
else:
    ans = N - sum
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input(),split()))
sum = sum(A)
if sum > N:
    ans = -1
else:
    ans = N - sum
print(ans)
Problem p02717 (python)

Fixed submission:
li= list(map(int, input().split()))
li.insert(1, li.pop(0))
li.insert(2, li.pop(0))
li.insert(0, li.pop(1))
print(li[0], li[1], li[2])

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
S = sum(A)
if A[M-1] >=  S / (4 * M):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
li= list(map(int, input().split()))
li.insert(1, li.pop(0))
li.insert(2, li.pop(0))
li.insert(0, li.pop(1))
print(li(0), li(1), li(2))

Buggy submission (verdict: Runtime Error):
li= list(map(int, input().split()))
li.insert(1) = li.pop(0)
li.insert(2) = li.pop(0)
print(li)
Problem p02718 (python)

Fixed submission:
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
S = sum(A)
if A[M-1] >=  S / (4 * M):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
M, N = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)　
S = sum(A)
if A[M-1] >=  S / 4M
print('Yes')
else:
    ('No')
Problem p02778 (python)

Fixed submission:
S = input()
print('x' * len(S))

Buggy submission (verdict: Runtime Error):
S = input()
print(x * len(S))
Problem p03290 (python)

Fixed submission:
# まだ解いてない配点を nokori として持つ
def dfs(i, sum, count, nokori):
    global ans
    if i == d:
        # G 点に満たなければ nokori のうち一番大きいものを解く
        if sum < g:
            use = max(nokori)
            # 解く問題が問題数を超えないように注意
            n = min(pc[use - 1][0], -(-(g - sum) // (use * 100)))
            count += n
            sum += n * use * 100

        if sum >= g:
            ans = min(ans, count)
    else:
        # 総合スコア、解いた問題数、まだ解いてない問題を更新
        dfs(i + 1, sum, count, nokori)
        dfs(i + 1, sum + pc[i][0] * (i + 1) * 100 + pc[i][1], count + pc[i][0], nokori - {i + 1})


d, g = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]

ans = float("inf")

dfs(0, 0, 0, set(range(1, d + 1)))
print(ans)

Buggy submission (verdict: Runtime Error):
def dfs(i, sum, count, nokori):
    global ans
    if i == d:
        # G 点に満たなければ nokori のうち一番大きいものを解く
        if sum < g:
            use = max(nokori)
            # 解く問題が問題数を超えないように注意
            n = min(-(-(g - sum) // (use * 100)))
            count += n
            sum += n * use * 100

        if sum >= g:
            ans = min(ans, count) 
    else:
        # 総合スコア、解いた問題数、まだ解いてない問題を更新
        dfs(i + 1, sum, count, nokori)
        dfs(i + 1, sum + pc[i][0] * (i + 1) * 100\
        + pc[i][1], count + pc[i][0], nokori - {i + 1})


d, g = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]

ans = float("inf")

dfs(0, 0, 0, set(range(1, d + 1)))
print(ans)
Problem p03471 (python)

Fixed submission:
from sys import stdin
N, Y = map(int, stdin.readline().rstrip().split())
for i in  range(N+1):
    for j in range(N+1-i):
        if 1000 * i + 5000 * j + 10000 * (N - i - j) == Y:
            print(N-i-j, j ,i)
            exit()
print(-1, -1, -1)

Buggy submission (verdict: Runtime Error):
from sys import stdin
N, Y = map(int, stdin.readline().rstrip().split())
for i in  range(N+1):
    for j in range(N+1-i):
        if 1000 * i + 5000 * j + 10000 * (N - i - j) == Y:
            answer = (i, j, N-i-j)
            break

a, b, c = answer
print(max(-1, c), max(-1, b), max(-1,a))
Problem p04001 (python)

Fixed submission:
from sys import stdin
S = stdin.readline().rstrip()
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]))

Buggy submission (verdict: Runtime Error):
from sys import stdin
S = stdin.readline().rstrip()
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]))

Buggy submission (verdict: Runtime Error):
from sys import stdin
S = stdin.readline().rstrip()
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]))

Buggy submission (verdict: Runtime Error):
from sys import stdin
S = stdin.readline().rstrip()
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]))

Buggy submission (verdict: Runtime Error):
from sys import stdin
S = stdin.readline().rstrip()
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(def(0, S[0]))

Buggy submission (verdict: Runtime Error):
from sys import stdin
S = stdin.readline().rstrip()
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(def(0, s[0]))
Problem p02612 (python)

Fixed submission:
N = str(input())

if len(N) <4:
    print(1000-int(N))
elif len(N) == 5:
    print(10000-int(N))
else:
    n = (1+int(N[0]))*1000 
    if int(N) % 1000 == 0:
      print(0)
    else:
      print(n - int(N))

Buggy submission (verdict: Runtime Error):
N = str(input())

if len(N) <4:
    print(1000-N)
elif len(N) == 5:
    print(10000-N)
else:
    n = (1+int(N[0]))*1000 
    print(n - int(N))
Problem p02657 (python)

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

print(A*B)

Buggy submission (verdict: Runtime Error):
N=int(input())
A = [int(x) for x in input().split()]

ans=1
if 0 in A:
    ans = 0
else:
    for a in A:
        A.reverse()
        if a > 10**18:
            ans = -1
            break
        else:
            ans *= a
            if ans > 10**18:
                ans = -1
                break
print(ans)

Buggy submission (verdict: Runtime Error):
A, B=map(int, input().split)

print(A*B)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split)

print(A*B)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input())

print(A*B)
Problem p02658 (python)

Fixed submission:
N=int(input())
A = [int(x) for x in input().split()]

ans=1
if 0 in A:
    ans = 0
else:
    A.sort(reverse=True)
    for a in A:
        if a > 10**18:
            ans = -1
            break
        else:
            ans *= a
            if ans > 10**18:
                ans = -1
                break
print(ans)

Buggy submission (verdict: Runtime Error):
import  numpy as np

N=int(input())
A=list(map(int,input().split()))


ans=np.prod(A)


if ans > 10**18
	print("-1")
	
else:
	print(ans)

Buggy submission (verdict: Runtime Error):
import  numpy as mul
import math

N=int(input())
A=[]
for i in range(N):
	A.append(list(map(int,input().split())))


ans=mul.prod(pyA)


if int(math.log10(ans)) > 17:
	print("-1")
	
else:
	print(ans)

Buggy submission (verdict: Runtime Error):
import  numpy as mul
import math

N=int(input())
A=list(map(int,input().split()))
ans=mul.prod(A)

if int(math.log10(ans)) > 17:
	print("-1")
else:
	print(ans)
Problem p02675 (python)

Fixed submission:
x=str(input())
y = x[-1]


if y == "3":
	 	 z="bon"
elif y == "0":
	z="pon"
elif y == "1":
	z="pon"
elif y == "6":
	z="pon"
elif y =="8":
	z="pon"
else:
	z="hon"

print(z)
exit()

Buggy submission (verdict: Runtime Error):
x=list(int(input()))
print(x)

if x[-1] = "2","4","5","7","9":
	y="hon"
elif x[-1] ="0","1","6","8":
	y="pon"
else:
	y="bon"

print(y)