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

Fixed submission:
s = raw_input()
abcd = map(int, s.split())
if abcd[0] > abcd[2]:
	begin = abcd[0]
else:
	begin = abcd[2]
if abcd[1] > abcd[3]:
	end = abcd[3]
else:
	end = abcd[1]

if (end - begin) >= 0:
	print(end - begin)
else:
	print(0)

Buggy submission (verdict: Runtime Error):
s = raw_input()
abcd = map(int, s.split())
if abcd[0] > abcd[2]:
	begin = abcd[0]
else:
	begin = abcd[2]
if abcd[1] > abcd[3]:
	end = abcd[3]
else:
	end = abcd[1]

if (end - begin) >= 0:
	print(end - begin)
else:
	print(0)
Problem p03455 (python)

Fixed submission:
num = list(map(int,input().split()))
a = num[0]
b = num[1]
c = (a * b) % 2
if c == 0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
num = list(map(int,input().split()))
for m in num:
  n = 1
  total = n * m
t = total % 2
if t == 0:
    print("Even")
  else:
    print("Odd")
Problem p03493 (python)

Fixed submission:
s = input()
a = [int(c) for c in s]
total = sum(a)
print(total)

Buggy submission (verdict: Runtime Error):
s = input()
a = [int(c) for c in a]
total = sum(a)
print(total)
Problem p02612 (python)

Fixed submission:
n = int(input())
if n%1000 == 0:
    print(0)
else:
    print(1000 - n % 1000)

Buggy submission (verdict: Runtime Error):
n = int(input())
test = []
for i in range(n):
    test.append(input())
print('AC x ' + str(test.count('AC')))
print('NA x ' + str(test.count('NA')))
print('TLE x ' + str(test.count('TLE')))
print('RE x ' + str(test.count('RE')))

Buggy submission (verdict: Runtime Error):
n = int(input())
test = []
for i in range(n):
    test.append(input())
print('AC x ' + str(test.count('AC')))
print('NA x ' + test.count('NA'))
print('TLE x ' + test.count('TLE'))
print('RE x ' + test.count('RE'))
Problem p02675 (python)

Fixed submission:
n = list(input())
n_1 = int(n[-1])
if n_1 == 3:
    print("bon")
elif n_1 == 0 or n_1 == 1 or n_1 == 6 or n_1 == 8:
    print("pon")
else:
    print("hon")

Buggy submission (verdict: Runtime Error):
import math
a,b,h,m = map(int, input().split())
if h > 12:
    h_c = h-12
else:
    h_c = h
p_d = 6*(abs((h_c)*5 - m))
if p_d >= 180:
    p_d2 = 360 - p_d 
    d_2 = a**2 + b**2 - 2*a*b*math.cos(math.radians(p_d2))
    print(math.sqrt(d_2))
else:
    d_2 = a**2 + b**2 - 2*a*b*math.cos(math.radians(p_d))
    print(math.sqrt(d_2))
Problem p02677 (python)

Fixed submission:
import math
a,b,h,m = map(int, input().split())
if h > 12:
    h_c = h-12
else:
    h_c = h
p_d = 6*(abs((h_c)*5+5*(m/60) - m)) #時針も分針の位置で一変わるんだった・・・
if p_d >= 180:
    p_d2 = 360 - p_d 
    d_2 = a**2 + b**2 - 2*a*b*math.cos(math.radians(p_d2))
    print(math.sqrt(d_2))
else:
    d_2 = a**2 + b**2 - 2*a*b*math.cos(math.radians(p_d))
    print(math.sqrt(d_2))

Buggy submission (verdict: Runtime Error):
mport math
a,b,h,m = map(int, input().split())
if h > 12:
    h_c = h-12
p_d = 6*(abs(h*5 - m))
if p_d >= 180:
    p_d2 = 360 - p_d 
    d_2 = a**2 + b**2 - 2*a*b*math.cos(math.radians(p_d2))
    print(math.sqrt(d_2))
else:
    d_2 = a**2 + b**2 - 2*a*b*math.cos(math.radians(p_d))
    print(math.sqrt(d_2))
Problem p02681 (python)

Fixed submission:
s = list(input())
t = list(input())
t.pop(-1)
print('Yes' if s == t else 'No')

Buggy submission (verdict: Runtime Error):
a, b, c, k = map(int, input().split())
if k <= a:
    k_pa, k_pb, k_pc = k , 0, 0 
elif k >= a and k-a <= b:
    k_pa, k_pb, k_pc = a, k-a, 0
elif k >= a and k-a >= b:
    k_pa, k_pb, k_pc = a, k-a, k-a-b
point = k_pa - (k-k_pa-k_pb)
print(point)

Buggy submission (verdict: Runtime Error):
a, b, c, k = map(int, input().split())
if k <= a:
    k_pa, k_pb, k_pc = k , 0, 0 
elif k >= a and k-a <= b:
    k_pa, k_pb, k_pc = a, k-a, 0
elif k >= a and k-a >= b:
    k_pa, k_pb, k_pc = a, k-a, k-a-b
point = k_pa - (k - k_pa - k_pb)
print(point)
Problem p03485 (python)

Fixed submission:
import math
a, b = input().split()
a = int(a)
b = int(b)
mean = (a + b) / 2
print(math.ceil(mean))

Buggy submission (verdict: Runtime Error):
s = list(input())
s_ = sorted(s)
t = list(input())
t_ = sorted(t,reverse=True)
print('Yes' if s_< t_ else 'No')
Problem p02817 (python)

Fixed submission:
s,t=input().split()
print(t+s)

Buggy submission (verdict: Runtime Error):
#include<stdio.h>
int main() {
	char s[100], t[100];
	scanf("%s %s", s,t);
	for (int i = 0; i != '\0'; i++) {
		printf("%c", t[i]);
	}
	for (int j = 0; j != '\0'; j++) {
		printf("%c", s[j]);
	}
	
	return 0;
}
Problem p02641 (python)

Fixed submission:
from sys import stdin
input = stdin.readline

x, n  = map(int, input().split())
p_list = list(map(int, input().split()))

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

li = []
# res = float('inf')
# for i in n:
#      std = abs(x - p_list[i])
#      if std <= res:
#          res = std    
def dfslower(std) :
    """
    argument x : 基準となる数字
    y 結果となりうる数字？
    return : 結果
    """
    if std  in p_list:
        return dfslower(std-1)
        #print(std)
    else:
        return std
        

def dfsupper(std) :
    """
    argument x : 基準となる数字
    y 結果となりうる数字？
    return : 結果
    """
    if std  in p_list:
        return dfsupper(std+1)
        #print(std)
    else:
        return(std)

mininte = dfslower(x)
maxinte =  dfsupper(x)

if abs(mininte-x)> abs(maxinte -x):
    print(maxinte)
elif abs(mininte-x) <= abs(maxinte -x):
    print(mininte)

Buggy submission (verdict: Runtime Error):
from sys import stdin
import numpy as np
input = stdin.readline

N = int(input())
A_list = list(map(int, input().split()))
ans_list =np.ones(N)
A_list = np.array(A_list)

for i in range(N):
    for j in range(i+1,N):
        if A_list[i] %  A_list[j] == 0:
            ans_list[i] = 0
            if (A_list[j] %  A_list[i] == 0):
                ans_list[j] = 0
        elif A_list[i] ==  A_list[j]:
                ans_list[i] = 0
                ans_list[j] = 0
        elif(A_list[j] %  A_list[i] == 0):
            ans_list[j] = 0
print(int(np.sum(ans_list)))
Problem p02999 (python)

Fixed submission:
import sys
input = sys.stdin.readline
X,A = map(int,input().split())

if X < A:
    print(0)

else:
    print(10)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
N,X = map(int,input().split())

li = list(map(int,input().split()))	


res = 0
i = 0
ans = 1
for i in range(N):
    res += li[i]
    ans += 1
    if res > X:
        ans -= 1
        break
    
print(min(ans,N+1))
Problem p03005 (python)

Fixed submission:
import sys
input = sys.stdin.readline
N,K = map(int,input().split())

if K == 1:
    print(0)

else:
    print(N-K)

Buggy submission (verdict: Runtime Error):

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

cross = []

##計算量に余裕があるので全探索します
for i in range(N):
    for j in range (i+1, N):
        a = [li[j][0]-li[i][0],li[j][1]-li[i][1]]
        cross.append(a) 

lencross = len(cross)

res = 0
ans = []

for i in range (lencross):
    res = 0
    for j in range (lencross):
        if cross[i] == cross[j]:
            res += 1
    ans.append(res)
if N-1 < max(ans):
    reduce = N-1
else:
    reduce = max(ans)

if N != 1:
    print(N - reduce)
else:
    print(1)
Problem p03006 (python)

Fixed submission:
import sys
N = int(input())
li = []
if N == 1 or N == 2:
    a = list(map(int,input().split()))
    print(1)
    sys.exit()   

for i in range(N):
    a = list(map(int,input().split()))
    li.append(a)

cross = []

##計算量に余裕があるので全探索します
for i in range(N):
    for j in range (i+1, N):
        a = [li[j][0]-li[i][0],li[j][1]-li[i][1]]
        if a[0] <= 0 and a[1] <= 0:
            b = [abs(li[j][0]-li[i][0]),abs(li[j][1]-li[i][1])]
            cross.append(b)
        elif a[0] < 0 and a[1] >= 0:
            c = li[j][1]-li[i][1]
            b = [abs(li[j][0]-li[i][0]),-c]
            cross.append(b) ####
        else:
            cross.append(a) 
lencross = len(cross)

res = 0
ans = []

for i in range (lencross):
    res = 0
    for j in range (lencross):
        if cross[i] == cross[j]:
            res += 1
    ans.append(res)
reduce = max(ans)

print(N - reduce)

Buggy submission (verdict: Runtime Error):

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

cross = []

##計算量に余裕があるので全探索します
for i in range(N):
    for j in range (i+1, N):
        a = [li[j][0]-li[i][0],li[j][1]-li[i][1]]
        cross.append(a) 

lencross = len(cross)

res = 0
ans = []

for i in range (lencross):
    res = 0
    for j in range (lencross):
        if cross[i] == cross[j]:
            res += 1
    ans.append(res)
if N-1 < max(ans):
    reduce = N-1
else:
    reduce = max(ans)

if N != 1:
    print(N - reduce)
else:
    print(1)

Buggy submission (verdict: Runtime Error):

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

##計算量に余裕があるので全探索します
for i in range(N):
    for j in range (i+1, N):
        a = [li[j][0]-li[i][0],li[j][1]-li[i][1]]
        cross.append(a) 

lencross = len(cross)

res = 0
ans = []

for i in range (lencross):
    res = 0
    for j in range (lencross):
        if cross[i] == cross[j]:
            res += 1
    ans.append(res)
maxa = max(ans)
print(N - maxa)

Buggy submission (verdict: Runtime Error):

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

##計算量に余裕があるので全探索します
for i in range(N):
    for j in range (i+1, N):
        a = [li[j][0]-li[i][0],li[j][1]-li[i][1]]
        cross.append(a) 

lencross = len(cross)

res = 0
ans = []

for i in range (lencross):
    res = 0
    for j in range (lencross):
        if cross[i] == cross[j]:
            res += 1
    ans.append(res)
maxa = max(ans)
print(cross)  
print(N - maxa)
Problem p03030 (python)

Fixed submission:

N = int(input())
li = []

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


copyli = li.copy()
ans = []
##copyli.sort()
a = sorted(copyli, key = lambda copyli: copyli[1],  reverse=True)
c = sorted(a, key = lambda a: a[0])


##copyli.sort(key=attrgetter(1), reverse=True)

for i in range(N):
    for j in range(N):
        if (li[j][0] == c[i][0]) and (li[j][1] == c[i][1]):
            ans.append(j+1)

for i in range(N):
    print(ans[i])

Buggy submission (verdict: Runtime Error):

N = int(input())
li = []

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


copyli = li.copy()
ans = []
##copyli.sort()
a = sorted(copyli, key = lambda copyli: copyli[1],  reverse=True)
c = sorted(a, key = lambda a: a[0])


##copyli.sort(key=attrgetter(1), reverse=True)

for i in range(N):
    for j in range(N):
        if (li[j][0] == c[i][0]) and (li[j][1] == c[i][1]):
            ans.append(j+1)

for i in range(N):
    print(ans[i])

Buggy submission (verdict: Runtime Error):

from operator import itemgetter
from operator import attrgetter
N = int(input())
li = []

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


copyli = li.copy()
ans = []
##copyli.sort()
a = sorted(copyli, key = itemgetter(1),  reverse=True)
c = sorted(a, key = itemgetter(0))


##copyli.sort(key=attrgetter(1), reverse=True)

for i in range(N):
    for j in range(N):
        if (li[j][0] == c[i][0]) and (li[j][1] == c[i][1]):
            ans.append(j+1)

for i in range(N):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
import copy
from operator import itemgetter
from operator import attrgetter
N = int(input())
li = []

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


copyli = li.copy()
ans = []
##copyli.sort()
a = sorted(copyli, key = itemgetter(1),  reverse=True)
c = sorted(a, key = itemgetter(0))


##copyli.sort(key=attrgetter(1), reverse=True)

for i in range(N):
    for j in range(N):
        if (li[j][0] == c[i][0]) and (li[j][1] == c[i][1]):
            ans.append(j+1)

for i in range(N):
    print(ans[i])
Problem p03047 (python)

Fixed submission:
N, K =  map(int,input().split())
print(N-K+1)

Buggy submission (verdict: Runtime Error):
import numpy as np
import sys
input = sys.stdin.readline
res = 0
p = 0
R, G, B, N = map(int, input().split())
for i in range (N // R + 1):
    for j in range(N // G + 1):
        P =N - i*R - j*G
        if P < 0:
            break
        else:
            if(P % B == 0):
                res += 1


print(res)
Problem p03069 (python)

Fixed submission:
import sys
input = sys.stdin.readline

n = int(input())
s = list(input())
res = 10**9

cta = 0
ctb = 0
a = [0]*n
b = [0]*n
for i in range(n):
    if s[i] == '.':
        cta += 1
    else:
        ctb += 1
    a[i] = cta
    b[i] = ctb
for i in range(n):
    res = min(res,b[i]+a[-1]-a[i])
res = min(res,a[-1],b[-1])
print(res)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

n = int(input())
s = list(input())
res = 10**6
ctw = 0
ctb = 0
w = [0]*n
b = [0]*n

for i in range(n):
     if s[i] == ".":
          ctw += 1
     else:
          ctb += 1
     w[i]= ctw
     b[i]= ctb
for i in range(n):
     res = min(res,b[i]+w[-1]-w[i])
res = min(res,[-1],b[-1])
print(res)

Buggy submission (verdict: Runtime Error):

import sys
input = sys.stdin.readline

n = int(input())
s = list(input())
res = 10**9



ctw = 0
ctb = 0
w = [0]*n
b = [0]*n

for i in range(n):
     if s[i] == ".":
          ctw += 1
     else:
          ctb += 1
     w[i]= ctw
     b[i]= ctb
for i in range(n):
     res = res,b[i]+w[-1]-w[i]
res = min(res,w[-1],b[-1])
print(res)
Problem p03071 (python)

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

list= [A+A-1,B+B-1,A+B]
print(max(list))

Buggy submission (verdict: Runtime Error):
s = list(input())
N = len(s)
cont = 0
for i in xrange(1,N):
    if s[i-1]==s[i]:
        cont += 1
        if s[i] == '0':
            del s[i]
            s.insert(i, '1')          
        else:
            del s[i]
            s.insert(i, '0')    
print(cont)
Problem p03545 (python)

Fixed submission:
s = input()

for bit in range(1 << (3)):
    f = s[0]
    
    for i in range(3):
        # if bit & (1 << i)で、bitにiが含まれているか（フラグが立っているか）を判定してくれるらしい
        if bit & (1 << i):
            f += '+'
        else:
            f += '-'
        f += s[i+1]    
    if eval(f)  == 7:
        f += "=7"
        print(f)
        exit()

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

for bit in range(1 << (3)):
    f = s[0]
    
    for i in range(3):
        # if bit & (1 << i)で、bitにiが含まれているか（フラグが立っているか）を判定してくれるらしい
        if bit & (1 << i):
            f += '+'
        f += s[i + 1]
    if sum(list(map(int, f.split('+')))) == 7:
        print(f"{f}=7")
        exit()
Problem p04001 (python)

Fixed submission:
s = input()
n = len(s)

ans = 0

for bit in range(1 << (n - 1)):
    # 各場合で式 f を生成する
    f = s[0]

    for i in range(n - 1):
        if bit & (1 << i):
            # フラグが立っているならば "+" を式の末尾に追加する
            f += "+"
        f += s[i + 1]

    ans += sum(map(int, f.split("+")))

print(ans)

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

# def dfs(i, f) :
#     """
#     argument i : どこから始めるか
#     f :　最初の数
#     returen : falese or ture(作れるならtrue)
#     """
#     if i == k-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]))

#bit木を書いていきます

ans = 0

for bit in range(1 << (k-1)):
    f = s[0]
    
    for i in range(k-1):
        # if bit & (1 << i)で、bitにiが含まれているか（フラグが立っているか）を判定してくれるらしい
        if bit & (1 << i):
            f += '+'
        f += f[i + 1]
    ans += sum(list(map(int, f.split('+'))))

print(ans)

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

# def dfs(i, f) :
#     """
#     argument i : どこから始めるか
#     f :　最初の数
#     returen : falese or ture(作れるならtrue)
#     """
#     if i == k-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]))

#bit木を書いていきます

ans = 0

for bit in range(1 << k-1):
    f = s[0]
    
    for i in range(k-1):
        # if bit & (1 << i)で、bitにiが含まれているか（フラグが立っているか）を判定してくれるらしい
        if bit & (1 << i):
            f += '+'
        f += f[i + 1]
    ans += sum(list(map(int, f.split('+'))))

print(ans)

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

ans = 0

for bit in range(1 << k-1):
    f = s[0]
    
    for i in range(k-1):
        # if bit & (1 << i)で、bitにiが含まれているか（フラグが立っているか）を判定してくれるらしい
        if bit & (1 << i):
            f += '+'
        f += f[i + 1]
    ans += sum(list(map(int, f.split('+'))))

print(ans)
Problem p03469 (python)

Fixed submission:
s = input()
print(s.replace('2017', '2018'))

Buggy submission (verdict: Runtime Error):
N,Y = map(int,input().split())
exist_flag = False
for i in range(N+1):
    for j in range(N+1-i):
        if Y == 10000*i + 5000*j + 1000*(N-i-j):
            exist_flag = True
            break
    if exist_flag:
        break
if not exist_flag:
    i,j,k = -1, -1, -1
print(i, j, k)
Problem p03471 (python)

Fixed submission:
N,Y = map(int,input().split())
exist_flag = False
for i in range(N+1):
    for j in range(N+1-i):
        if Y == 10000*i + 5000*j + 1000*(N-i-j):
            exist_flag = True
            break
    if exist_flag:
        break
if not exist_flag:
    print(-1, -1, -1)
else:
    print(i, j, N-i-j)

Buggy submission (verdict: Runtime Error):
N,Y = map(int,input().split())
exist_flag = False
for i in range(N+1):
    for j in range(N+1-i):
        if Y == 10000*i + 5000*j + 1000*(N-i-j):
            exist_flag = True
            break
    if exist_flag:
        break
if not exist_flag:
    i,j,k = -1, -1, -1
print(i, j, k)

Buggy submission (verdict: Runtime Error):
N,Y = map(int,input().split())
exist_flag = False
exist_flag = False
for i in range(N+1):
    for j in range(N+1-i):
        if Y == 10000*i + 5000*j + 1000*(N-i-j):
            exist_flag = True
            break
    if exist_flag:
        break
if not exist_flag:
    i,j,k = -1, -1, -1
print(i, j, k)

Buggy submission (verdict: Runtime Error):
N = int(input())
Y = int(input())
exist_flag = False
for i in range(N+1):
    for j in range(N+1):
        for k in range(N+1):
            if not i+j+k == N:
                continue
            if Y == 10000*i + 5000*j + 1000*k:
                exist_flag = True
                break
        if exist_flag:
            break
    if exist_flag:
        break
if not exist_flag:
    i,j,k = -1, -1, -1
print(i, j, k)
Problem p02765 (python)

Fixed submission:
i = list(map(int,input().split()))
ans = 0
if i[0] >=10:
    ans = i[1]
else:
    ans = i[1] + 100 * (10 - i[0])

print(ans)

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

for i in range(len(s)):
    s[i] = s[i] - n
    s[i] = s[i] * s[i]
ans = 0
for i in range(len(s)):
    ans += s[i]

print(ans)
Problem p02772 (python)

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

ans = "APPROVED"

for i in range(len(m)):
    if ans == "DENIED":
        break;
    if m[i] % 2 == 0:
        if m[i] % 5 == 0 or m[i] % 3 == 0:
            ans = 'APPROVED'
        else:
            ans = 'DENIED'
            break;

print(ans)

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

for i int range(len(m))
    if i % 2 == 0:
        if i % 5 == 0 or i % 3 == 0:
            ans = 'APPROVED'
        else:
            ans = 'DENIED'

print(ans)
Problem p02675 (python)

Fixed submission:
a = input()
if a[-1] in ("2", "4", "5", "7", "9"):
  print("hon")
elif a[-1] in ("0", "1", "6", "8"):
  print("pon")
else:
  print("bon")

Buggy submission (verdict: Runtime Error):
if input()[-1] in ("2", "4", "5", "7", "9"):
  print("hon")
elif input()[-1] in ("0", "1", "6", "8"):
  print("pon")
else:
  print("bon")
Problem p03136 (python)

Fixed submission:
n = int(input())
p = list(map(int, input().split(' ')))
p = sorted(p, reverse=True)
if p[0] < sum(p[1:]):
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split(' ')))
p = sorted(p, reverse=True)
if len(p) != n or n < 4:
  raise ValueError

if p[0] < sum(p[1:]):
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
p = [int(input()) for i in range(n)]
p = sorted(p)
if p[0] < sum(p[1:]):
	print('Yes')
else:
	print('No')
Problem p03139 (python)

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

if n > 100 or a > n or b > n:
    raise ValueError

ret_max = min(a, b)

if n > a + b:
    ret_min = 0
else:
    ret_min = (max(a, b) + min(a, b)) - n

print(ret_max, ret_min)

Buggy submission (verdict: Runtime Error):
n, a, b, c = [input() for i in range(4)]
n = int(n)

ret = 0
for i in range(n):
    if (a[i] == b[i]) and (a[i] == c[i]):
        pass

    elif (a[i] == b[i]) and (a[i] != c[i]):
        c = c[:i] + a[i] + c[i + 1:]
        ret += 1

    elif a[i] == c[i] and a[i] != b[i]:
        b = b[:i] + a[i] + b[i + 1:]
        ret += 1

    elif a[i] != c[i] and b[i] == c[i]:
        a = a[:i] + b[i] + a[i + 1:]
        ret += 1

    elif a[i] != b[i] and a[i] != c[i]:
        b = b[:i] + a[i] + b[i + 1:]
        c = c[:i] + a[i] + c[i + 1:]
        ret += 2


print(ret)

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

if n > 100 or a > n or b > n:
    raise ValueError

ret_max  = min(a,b)	

if n > a + b :
    ret_min = 0
else : 
    ret_min = max(a, b) - min(a,b)

print({} {}).format(ret_max, ret_min)
Problem p03210 (python)

Fixed submission:
year = int(input())

if year < 1 or 9 < year:
    raise ValueError('Input value must be less than 9 and more than 1')
elif year in [3, 5, 7]:
    print('YES')
else:
    print('NO')

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

if year < 1 or 9 < year:
    raise ValueError
elif year is in [3, 5, 7]:
    print('YES')
else:
    print('NO')
Problem p03260 (python)

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

if a + b < 2 or 6 < a + b:
    raise ValueError('Input value is more than 1 and less than 3.')

print('Yes' if (a * b) % 2 == 1 else "No")

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

if sum(num) < 2 or 6 < sum(num):
    raise ValueError('Input value is more than 1 and less than 3.')

print('Yes' if (a * b) % 2 == 1 else "No")

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

if sum(num) < 2 or 6 < sum(num):
    raise ValueError('Input value is more than 1 and less than 3.')

print('Yes' if (a * b) % 2 == 1 else "No")
Problem p03288 (python)

Fixed submission:
r = int(input())
if 0 <= r and r < 1200:
    print('ABC')
elif 1200 <= r and r < 2800:
    print('ARC')
elif 2800 <= r and r <= 4208:
    print('AGC')
else:
    raise ValueError

Buggy submission (verdict: Runtime Error):
r = int(input())
if 0 <= r and r < 1200:
    print('ABC')
elif 1200 <= r and r < 2800:
    print('ARC')
elif 2800 <= r and r < 4208:
    print('AGC')
else:
    raise ValueError
Problem p03693 (python)

Fixed submission:
a = int(input().replace(' ', ''))
if a % 4 == 0:
  print('YES') 
else: 
  print('NO')

Buggy submission (verdict: Runtime Error):
a = int(input().replace(' ', ''))
if a % 4 == 0: print('YES') else: print('NO')
Problem p02628 (python)

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

list = map(int,input().split())
list = sorted(list)

a = 0

for i in range(k):
    a += list[i]

print(a)

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

list = sorted(list)

a = 0

for i in range(k):
    a += list[k]

print(a)

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

a = 0

for i in range(k):
    a += list[k]

print(a)

Buggy submission (verdict: Runtime Error):
n , k = map(int,input().split())
list = input().split()
list1 = list.sort()
a = 0
 
for i in range(k):
  a += list[i]

Buggy submission (verdict: Runtime Error):
n , k = map(int,input().split())
list = input().split()
list = list.sort()
a = 0

for i in range(k):
  a += list[i]