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

Fixed submission:
l = []
ans = []
a, b, k = list(map(int, input().split()))
l.append(a)
l.append(b)
i = 1

for i in range(1, min(l) + 1):
    if (a % i) == 0 and (b % i) == 0:
       ans.append(i) 

if len(ans) == 0:
    print(1)
else:
    print(ans[-k])

Buggy submission (verdict: Runtime Error):
l = []
ans = []
a, b, k = list(map(int, input().split()))
l.append(a)
l.append(b)
i = 1

for i in range(1, min(l) + 1):
    if (a % i) == 0 and (b % i) == 0:
       ans.append(i) 

    print(ans[-k])

Buggy submission (verdict: Runtime Error):
l = []
ans = []
a, b, k = list(map(int, input().split()))
l.append(a)
l.append(b)
i = 1

for i in range(1, max(l)):
    if (a % i) == 0 and (b % i) == 0:
       ans.append(i) 

if len(ans) == 0:
    print(1)
else:
    print(ans[-k])

Buggy submission (verdict: Runtime Error):
l = []
ans = []
a, b, k = list(map(int, input().split()))
l.append(a)
l.append(b)
i = 1

for i in range(1, max(l)):
    if (a % i) == 0 and (b % i) == 0:
       ans.append(i) 

if len(ans) == 0:
    print(1)
else:
    print(ans[k-1])

Buggy submission (verdict: Runtime Error):
l = []
ans = []
a, b, k = list(map(int, input().split()))
l.append(a)
l.append(b)
i = 1

print('l:',l)


for i in range(1, max(l)):
    if (a % i) == 0 and (b % i) == 0:
       ans.append(i) 
    
print('ans:',ans)
print('k:',k)

if len(ans) == 0:
    print(1)
else:
    print('ans[k-1]',ans[k-1])
Problem p03109 (python)

Fixed submission:
s =list(map(int,input().split('/')))

if s[0] <= 2018:
    print('Heisei')
elif s[0] == 2019 and s[1] <=4:
    print('Heisei')
elif s[0] == 2019 and s[1] >= 5:
    print('TBD')
elif s[0] >= 2020:
    print('TBD')

Buggy submission (verdict: Runtime Error):
s = input().split('/')
if s[0] <= 2018:
    print('Heisei')
elif s[0] == 2019 and s[1] <=4:
    print('Heisei')
elif s[0] == 2019 and s[1] >= 5:
    print('TBD')
elif s[0] >= 2020:
    print('TBD')
Problem p03067 (python)

Fixed submission:
# coding: utf-8
# Your code here!
kazu = input().split()
for i in range(len(kazu)):
    kazu[i] = int(kazu[i])
if kazu[0] < kazu[1]:
    if kazu[0] < kazu[2] and kazu[1] > kazu[2]:
        print("Yes")
    else:
        print("No")
elif kazu[0] > kazu[1]:
    if kazu[0] > kazu[2] and kazu[1] < kazu[2]:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
kazu = int(input())
isi = input()
isilst = []
count=0
for i in range(kazu-1):
    if isi[i] =="#" and isi[i + 1] == ".":
        count += 1
print(count)
Problem p03565 (python)

Fixed submission:
import numpy as np

S = input()
T = input()

npS =  np.array(list(S))
npT =  np.array(list(T))

must_sym_i = npS != '?'

accepted = []
for i in range(len(S)-len(T)+1):
    and_ = npS[i:i+len(T)] == npT
    if all(and_[must_sym_i[i:i+len(T)]]):
        temp = np.copy(npS)
        temp[i:i+len(T)] = npT
        temp[temp == '?'] = 'a'
        accepted.append(temp)

acc = [''.join(list(accepted[i])) for i in range(len(accepted))]

if len(acc) > 0:
    print(sorted(acc)[0])
else:
    print("UNRESTORABLE")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()

S = list(S)
T = list(T)

not_find = False
start_i = 0
for i in range(s_l - t_l + 1):
    start_i = s_l - i - t_l
    here = True
    for j in range(t_l):
        if S[start_i+j] == T[j] or S[start_i+j] == '?':
            here = True
        else:
            here = False
            break
    if here:
        break
    if start_i == 0:
        not_find = True

if not_find:
    print("UNRESTORABLE")
else:
    for s in range(len(S[:start_i])):
        if S[s] == '?':
            S[s] = 'a'

    S[start_i:start_i+t_l] = T

    for s in range(len(S[start_i+t_l:])):
        if S[s] == '?':
            S[s] = 'a'
    print(S)
Problem p03574 (python)

Fixed submission:
H, W = map(int,input().split())

S = [[]]

for h in range(H):
    S.append([])
    S[-1] = list(input())

del S[0]

for i in range(H):
    for j in range(W):
        if S[i][j] == '.': S[i][j] = 0
        if S[i][j] == '#': S[i][j] = -100
            
for i in range(H):
    for j in range(W):
        if S[i][j] < 0:
            
            if i != 0:
                try: S[i-1][j] += 1
                except: x=1


                try: S[i-1][j+1] += 1
                except: x=1
                    
            if j != 0:
                try: S[i][j-1] += 1
                except: x=1

                try: S[i+1][j-1] += 1
                except: x=1
                
                if i != 0:
                    try: S[i-1][j-1] += 1
                    except: x=1

                
            try: S[i+1][j] += 1
            except: x=1
            
            try: S[i][j+1] += 1
            except: x=1
            
            try: S[i+1][j+1] += 1
            except: x=1
            
            
for i in range(H):
    for j in range(W):
        if S[i][j] < 0: S[i][j] = '#'

for i in range(len(S)):
    for j in range(len(S[i])):
        print(S[i][j], end="")
    print()

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

S = [[]]

for h in range(H):
    S.append([])
    S[-1] = list(input())#.split()

del S[0]

for i in range(H):
    for j in range(W):
        if S[i][j] == '.': S[i][j] = 0
        if S[i][j] == '#': S[i][j] = -100

for i in range(H):
    for j in range(W):
        if S[i][j] < 0: 
            try:
                S[i-1][j] += 1
            except:
                ;
            try:
                S[i][j-1] += 1
            except:
                ;
            try:
                S[i+1][j] += 1
            except:
                ;
            try:
                S[i][j+1] += 1
            except:
                ;

for i in range(H):
    for j in range(W):
        if S[i][j] < 0: S[i][j] = '#'

for i in range(len(S)):
    for j in range(len(S[i])):
        print(S[i][j], end="")
    print()
Problem p03575 (python)

Fixed submission:
import numpy as np

def is_connected(npmat):
    mat = np.copy(npmat)
    dim = mat.shape[0]
    for i in range(dim):
        mat[i][i] = 0
    accessible = set([0])
    queue = [0]
    while len(queue) > 0:
        i = queue.pop()
        js = filter(lambda x:x[1], enumerate(mat[i] > 0))
        for j, bool in js:
            if not j in accessible:
                accessible.add(j)
                if len(accessible) == dim :
                    return True
                queue.append(j)
    return len(accessible) == dim


N, M = map(int,input().split())

V = np.zeros((M,2))
for i in range(M):
    V[i,0], V[i,1] = map(int,input().split())

V = V.astype(np.int)

count = M
for i in range(M):
    mat = np.identity(N, dtype=np.int)
    for j in range(M):
        if i != j:
            mat[V[j,0]-1, V[j,1]-1] = 1
            mat[V[j,1]-1, V[j,0]-1] = 1
    if is_connected(mat):
        count -= 1


print(count)

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

def is_connected(npmat):
    mat = np.copy(npmat)
    dim = mat.shape[0]
    for i in range(dim):
        mat[i][i] = 0
    accessible = set([0])
    queue = [0]
    while len(queue) > 0:
        i = queue.pop()
        js = filter(lambda x:x[1], enumerate(mat[i] > 0))
        for j, bool in js:
            if not j in accessible:
                accessible.add(j)
                if len(accessible) == dim :
                    return True
                queue.append(j)
    return len(accessible) == dim


N, M = map(int,input().split())


for i in range(M):
    V[i,0], V[i,1] = map(int,input().split())

V = V.astype(np.int)

count = M
for i in range(M):
    mat = np.identity(N, dtype=np.int)
    for j in range(M):
        if i != j:
            mat[V[j,0]-1, V[j,1]-1] = 1
            mat[V[j,1]-1, V[j,0]-1] = 1
    if is_connected(mat):
        count -= 1


print(count)
Problem p03614 (python)

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

count = 0

for i in range(N-1):
    if p[i] == i+1:
        p[i], p[i+1] = p[i+1], p[i]
        count += 1

i = N-1
if p[i] == i+1:
    p[i], p[i-1] = p[i-1], p[i]
    count += 1
        
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
p = list(map(int,input().split()))

count = 0

for i in range(N):
    if p[i] == i+1:
        p[i], p[i+1] = p[i+1], p[i]
        count += 1
print(count)
Problem p03962 (python)

Fixed submission:
# A
from collections import Counter

print(len(Counter([int(i) for i in input().split()])))

Buggy submission (verdict: Runtime Error):
from collections import Counter

print(len(Counter([int(input()) for i in range(3)])))
Problem p03964 (python)

Fixed submission:
# C
from math import ceil
N = int(input())
T = [[int(i) for i in input().split()] for n in range(N)]
m = T[0]

def hoge(a, b):
    if a%b==0:
        return a//b
    else:
        return a//b+1

for n in range(1, N):
    a = max(hoge(m[0],T[n][0]), hoge(m[1],T[n][1]))
    m = [T[n][0] * a, T[n][1] * a]
print(sum(m))

Buggy submission (verdict: Runtime Error):
# C
from math import ceil
#N = int(input())
#T = [[int(i) for i in input().split()] for n in range(N)]
m = T[0]
for n in range(1, N):
    a = ceil(max(m[0]/T[n][0], m[1]/T[n][1]))
    m = [T[n][0] * a, T[n][1] * a]
print(sum(m))
Problem p04011 (python)

Fixed submission:
N, K, X, Y = [int(input()) for i in range(4)]
if N <= K:
    print(N*X)
else:
    print((N-K)*Y + K*X)

Buggy submission (verdict: Runtime Error):
N, K, X, Y = [input() for i in range(4)]
if N <= K:
    print(N*X)
else:
    print((N-K)*Y + K*X)
Problem p03068 (python)

Fixed submission:
n = int(input())
s = list(input())
k = int(input())


for i in range(n):
    if s[i] != s[k-1] :
        s[i] = "*"

for i in s:
    print(i,end="")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input())
k = int(input())

for i in range(n):
    if s[i] != s[k] :
        s[i] = "*"

for i in s:
    print(i,end="")
Problem p03239 (python)

Fixed submission:
n,t = list(map(int,input().split()))
in_time = list()
           
for i in range(n):
    a,b =  list(map(int,input().split()))
    if t >= b:
        in_time.append(a)

if len(in_time) == 0:
    print("TLE")
else:
    print(min(in_time))

Buggy submission (verdict: Runtime Error):
n,t = list(map(int,input().split()))
in_time = list()
           
for i in range(n):
    a,b =  list(map(int,input().split()))
    if t >= b:
        in_time.append(a)
        
print(min(in_time))
Problem p03282 (python)

Fixed submission:
s = input()
k = int(input())

for i in range(k):
    if s[i] != "1":
        print(s[i])
        break
else:
    print(1)

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())

if s[:k+1] == "1"*k:
    print(1)
else:
    for i in range(len(s)):
        if s[i] != "1":
            print(s[i])
            break
Problem p03284 (python)

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

if n%k == 0:
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
n = int(input())
amari = ""

if n == 0:
    print(0)
    exit()

while n :
    if n%2 == 1:
        amari += "1"
        n -= 1
    else:
        amari += "0"
    n = n//-2
    
print(amari[::-1])
Problem p03338 (python)

Fixed submission:
#b
num = int(input())
li = list(input())
ans = 0
for i in range(num):
    fi = set(li[:i])
    se = set(li[i:])
    hoge = len(list(fi & se))
    if hoge > ans:
        ans = hoge
    
print(ans)

Buggy submission (verdict: Runtime Error):
num = int(input())
li = list(input())
ans = 0
for i in range(num):
    fi = set(li[:i])
    se = set(li[i:])
    hoge = len(list(fi & se))
    if hoge > ans:
    ans = hoge
    
print(ans)
Problem p03401 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a.insert(0,0)
a.insert(n+1,0)
total=0
#通常のコストを計算
for i in range(1,n+2):
    total+=abs(a[i]-a[i-1])
for i in range(1,n+1):
    ans=total-(abs(a[i]-a[i-1])+abs(a[i+1]-a[i]))+abs(a[i+1]-a[i-1])
    print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
travel = list(map(int,input().split()))
plan = travel.copy()
start = 0
answer = 0
answer_list = list()

for i in range(n):
    plan.pop(i)
    for j in range(len(plan)):
        answer += abs(plan[j]-start)
        start = plan[j]
    answer += abs(plan[len(plan)-1])
    answer_list.append(answer)
    answer = 0
    start = 0
    plan = travel.copy()
    
for i in range(len(answer_list)):
    print(answer_list[i])
Problem p03408 (python)

Fixed submission:
n = int(input())
s = list()
counter = 0

for i in range(n):
    s.append(input())
    
m = int(input())
t = list()

for i in range(m):
    t.append(input())
    
for word in s:
    counter = max(counter,s.count(word) - t.count(word))
    
print(counter)

Buggy submission (verdict: Runtime Error):
N = map(int,input())
blue = []
red = []
for i in range(N):
    blue.append(input())
M = map(int,input())
for i in range(M):
    red.append(input())
blue_list = Counter(blue)
red_list = Counter(red)
b = max(blue_list)
c=min(red_list)
print(blue_list[b] - red_list[c])
Problem p03416 (python)

Fixed submission:
a , b = input().split()
a = int(a)
b = int(b)
count=0
for i in range(a,b+1):
    test = list(str(i))
    if (test[0] == test[4]) and (test[1]==test[3]):
        count=count+1
print(count)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
count=0
for i in range(a,b+1):
    test = list(str(i))
    if (test[0] == test[4]) and (test[1]==test[3]):
        count=count+1
print(count)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
count=0
for i in range(a,b+1):
    i = str(i)
    test = list(i)
    if (test[0] == test[4]) and (test[1]==test[3]):
        count=count+1
print(count)
Problem p03624 (python)

Fixed submission:
a = "abcdefghijklmnopqrstuvwxyz"
S = input()
flg = 0
for i in a:
    if flg == 0 and i not in S:
        print(i)
        flg = 1
if flg == 0:
    print("None")

Buggy submission (verdict: Runtime Error):
S = input()
flg = 0
for i in a:
    if flg == 0 and i not in S:
        print(i)
        flg = 1
if flg == 0:
    print("None")
Problem p03632 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
if a>=c and b>=d and d>a:
    print(d-a)
elif a<=c and b<=d and b>c:
    print(b-c)
elif a<c and d<b:
    print(d-c)
elif c<a and b<d:
    print(b-a)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
print(max(min(b,d)-max(a,c),0)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
print(max(min(b,d)-max(a,c)),0)
Problem p03738 (python)

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

if a > b:
    print("GREATER")
elif a < b:
    print("LESS")
else:
    print("EQUAL")

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

if a > b:
    print("GREATER")
elif a < b:
    print("LESS")
else:
    print("EQUAL")
Problem p03861 (python)

Fixed submission:
a,b,x=map(int, input().split())
i = a//x
j = b//x
if a%x==0:
    print(j-i+1)
else:
    print(j-i)

Buggy submission (verdict: Runtime Error):
A,B,X = map(int,input().split())
mn = -(-A//X)
mx = B//X
if A == B :
    if A % X == 0:
        prnt(1)
    else:
        print(0)
else:
    print(mx - mn + 1)
Problem p03079 (python)

Fixed submission:
ABC = input().split()
list_ABC= list(ABC)

if list_ABC[0] == list_ABC[1] and list_ABC[0] == list_ABC[2]:
    print('Yes')
else:
    print('No')

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

N1 = int(N)/2

import math
N1= math.ceil(N1)
N1= int(N1)-1

list_s = list(s)
list_s.sort()
X = list_s[N1]

if X=='R':
    print('Yes')
else:
    print('No')

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

N1 = int(N)/2

import math
N1= math.ceil(N1)
N1= int(N1)-1
print(N1)

list_s = list(s)
list_s.sort()
X = list_s[N1]

if X=='R':
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):

ABC = input().split()
list_ABC= list(ABC)
​
if list_ABC[0] == list_ABC[1] and list_ABC[0] == list_ABC[2]:
    print('Yes')
else:
    print('No')
2 2 2

Buggy submission (verdict: Runtime Error):
ABC = import()
list_ABC= list(ABC)

A_ = list_ABC[1] + list_ABC[2]
B_ = list_ABC[2] + list_ABC[0]
C_ = list_ABC[0] + list_ABC[1]

if A_>list_ABC[0] and B_>list_ABC[1] and C_>list_ABC[2]:
    print('Yes')
else:
    print('No')
Problem p03086 (python)

Fixed submission:
S = input()
lis_S = list(S)
Ans = []
index = 0
n = 0
for char in lis_S:
    Ans.append(0)
    if char=="A" or char=="C" or char=="G" or char=="T":
        Ans[n] += 1
        index += 1
    elif index < len(lis_S):
        index += 1
        n += 1
        continue
    else:
        break
print(max(Ans))

Buggy submission (verdict: Runtime Error):
S = input()
lis_S = list(S)
Ans = 0
for char in lis_S:
    if char=="A" or char=="C" or char=="G" or char=="T":
        Ans += 1
    elif index < len(lis_S):
        continue
    else:
        break
print(Ans)
Problem p03697 (python)

Fixed submission:
def read_line():
    return input().rstrip()

def read_ints():
    return [int(x) for x in read_line().split()]

def read_int():
    return int(read_line())


a, b = read_ints()

c = a + b
if c >= 10:
    print('error')
else:
    print(c)

Buggy submission (verdict: Runtime Error):
def read_line():
    return input().rstrip()

def read_ints():
    return [int(x) for x in read_line().split()]

def read_int():
    return int(read_line())

def main():
    a, b = read_int()
    
    c = a + b
    if c >= 10:
        print('error')
    else:
        print(c)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def read_line():
    return input().rstrip()

def read_ints():
    return [int(x) for x in read_line().split()]

def read_int():
    return int(read_line())

a, b = read_int()

c = a + b
if c >= 10:
    print('error')
else:
    print(c)
Problem p03206 (python)

Fixed submission:
def main():
    #a,b = list(map(int, input().split()))
        
    #print(int(a + (b/2)))
    n = int(input())
    if n == 25:
        print('Christmas')
    if n == 24:
        print('Christmas Eve')
    if n == 23:
        print('Christmas Eve Eve')
    if n == 22:
        print('Christmas Eve Eve Eve')

if __name__ == '__main__':

    main()

Buggy submission (verdict: Runtime Error):
N = int(input())
p = []
for i in range(N):
    p.append(int(input()))

ans = sum(p) - max(p)/2

print(int(ans))
Problem p03109 (python)

Fixed submission:
a,b,c=map(int, input().split("/"))

if a<2019:
    print("Heisei")
elif a>2019:
    print("TBD")
else :
    if b<5:
        print("Heisei")
    else:
        print("TBD")

Buggy submission (verdict: Runtime Error):
N=int(input())
s=[input().split() for i in range(N)]
M=0
for i in range(N):
  p=int(i)
  if s[p][1]=="JPY":
    M=M+float(s[p][0])
  else:
    M=M+float(s[p][0])*380000.0
print(M)
Problem p03145 (python)

Fixed submission:
x,y,z=list(map(int,input().split()))                              
print(int(x*y/2))

Buggy submission (verdict: Runtime Error):
  1 x,y,z=list(map(int,input().split()))
  2 print(x*y/2)
Problem p03697 (python)

Fixed submission:
x, y = input().split()

x = int(x)
y = int(y)

if x + y >= 10 :
  print("error")
else:
  print(x+y)

Buggy submission (verdict: Runtime Error):
x = input()
y = input()

x = int(x)
y = int(y)

if x + y >= 10 :
  print("error")
else:
  print(x+y)

Buggy submission (verdict: Runtime Error):
x = input()
y = input()

if x + y >= 10 :
  print("error")
else:
  print(x+y)

Buggy submission (verdict: Runtime Error):
x = input()
y = input()

x = int(x)
y = int(y)
 
if(x + y >= 10):
  print("error")
else:
  print(x+y)

Buggy submission (verdict: Runtime Error):
x = input()
y = input()

if(x + y >= 10):
  print("error")
else:
  print(x+y)
Problem p03067 (python)

Fixed submission:
a, b, c = map(int, input().split())

if (a < c < b) or (b < c < a):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
flag = 0
location1 = 0
location2 = n
for i in range(n):
    #    print(s[i])
    if s[i] == '#':
        location1 = i
        flag = 1
        break

i = 0

for i in range(n):
    #    print(s[n-i-1])
    if s[n-i-1] == '.':
        location2 = n - i - 1
        flag = 2
        break


if flag == 0:
    print(0)
else:
    print(min(s[location1:n].count('.'), s[0:location2].count('#')))
Problem p03471 (python)

Fixed submission:
n, y = map(int, input().split())

for n10000 in range(n+1):
    for n5000 in range(n - n10000 + 1):
        n1000 = n - n5000 - n10000
        money_total = n10000 * 10000 + n5000 * 5000 + n1000 * 1000
        if money_total == y:
            print(n10000, n5000, n1000)
            exit()

print(-1, -1, -1)

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

ans = "-1 -1 -1"

for n10000 in range(n+1):
    for n5000 in range(n - n10000 + 1):
        n1000 = n - n5000 - n10000
        money_total = n10000 * 10000 + n5000 * 5000 + n1000 * 1000
        if money_total == y:
            ans = f"{n10000} {n5000} {n1000}"

print(ans)

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

ans = "-1, -1, -1"

for n10000 in range(n+1):
    for n5000 in range(n - n10000 + 1):
        n1000 = n - n5000 - n10000
        money_total = n10000 * 10000 + n5000 * 5000 + n1000 * 1000
        if money_total == y:
            ans = f"{n10000} {n5000} {n1000}"

print(ans)

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

ans = "-1, -1, -1"

for n10000 in range(n+1):
    for n5000 in range(n+1):
        n1000 = n - n5000 - n10000
        money_total = n10000 * 10000 + n5000 * 5000 + n1000 * 1000
        if money_total == y:
            ans = f"{n10000} {n5000} {n1000}"

print(ans)
Problem p03047 (python)

Fixed submission:
N, K = map(int, input().split())

print(N - K + 1)

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

print(N - K + 1)
Problem p03076 (python)

Fixed submission:
a = []

for i in range(5):
    a.append(int(input()))


result = 0
min_min = 10
for each in a:
    if each % 10 != 0:
        result += each + 10 - (each % 10)
        if min_min > each % 10:
            min_min = each % 10
    else:
        result += each
print(result - (10 - min_min))

Buggy submission (verdict: Runtime Error):
a = []
for i in range(6):
    a.append(int(input()))
    
result = 0
for each in a:
    if each % 10 != 0:
        result += each + 10 - (each % 10)
    else:
        result += each
print(result)
Problem p03079 (python)

Fixed submission:
a = [int(each) for each in input().split()]
if a[0] == a[1] == a[2]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a = [int(each) for each in input().split()]

N, Q = a[0], a[1]

s = input()

remains = int(N)

state = [1] * N

for q in range(Q):
    t = input().split()
    # 対象マスを選定
    for i, st in enumerate(s):
        if st == t[0]:
            golems = state[i]
            state[i] = 0
            if i == 0 and t[1] == 'L' or i == int(N) - 1 and t[1] == 'R':
                remains -= golems
            else:
                if t[1] == 'R':
                    state[i + 1] += golems
                else:
                    state[i - 1] += golems
print(remains)
Problem p03109 (python)

Fixed submission:
a = input()
a = a.replace('/', '')


if int(a) > 20190430:
    print('TBD')
else:
    print('Heisei')

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


def check(x, al, bl):
    rcost = np.inf
    for a in al:
        tmp_c = abs(a - x)
        for b in bl:
            t = abs(b - a)
            rcost = min(rcost, tmp_c + t, abs(b - x) + t)

    print(int(rcost))


n = [int(each) for each in input().split()]
a, b, q = n[0], n[1], n[2]

sl = np.zeros(a)
tl = np.zeros(b)
xl = np.zeros(q)

for i in range(a):
    sl[i] = int(input())
for i in range(b):
    tl[i] = int(input())
for i in range(q):
    xl[i] = int(input())

result = []
for x in xl:
    check(x, sl, tl)