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

Fixed submission:
n = int(input())
p = tuple(map(int,input().split()))
c = 0
ans = "YES"
for i in range(n) :
    if p[i] != i+1 :
        c += 1
if c > 2 :
    ans = "NO"
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = tuple(map(int,input().split()))
c = 0
ans = "YES"
for i in range(1,n+1) :
    if p[i] != i :
        c += 1
if c <= 2 :
    ans = "NO"
print(ans)
Problem p02995 (python)

Fixed submission:
import fractions
a,b,c,d = map(int,input().split())
lg = b - a + 1

def div (n):
    rt = lg // n
    if lg % n != 0 and ((n- a%n) + (b%n) < n):
        rt += 1
    return(rt)

cm = c * d // fractions.gcd(c,d)
ans = lg - div(c) - div(d) + div(cm)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
lg = b - a + 1

def div (n):
    rt = lg // n
    if lg % n != 0 and ((n- a%n) + (b%n) < n):
        rt += 1
    return(rt)

cm = c * d // math.gcd(c,d)
ans = lg - div(c) - div(d) + div(cm)
print(ans)
Problem p03047 (python)

Fixed submission:
n , k = map ( int , input ().split())
ans = n - k + 1
print ( ans)

Buggy submission (verdict: Runtime Error):
n , k = imap ( int , input ().split())
ans = n - k + 1
print ( ans)
Problem p03060 (python)

Fixed submission:
num = int(input())
value = tuple( map (int,input().split()))
price = tuple(map (int,input().split()))
ans = 0
for i in range(num):
  if value[i] > price[i] :
      income = value[i] - price[i]
      ans += income
print(ans)

Buggy submission (verdict: Runtime Error):
num = int(input())
value = map (int,input().split())
price = map (int,input().split())
ans = 0
for i in range(num):
  if value[i] > price[i] :
      income = value[i] - price[i]
      ans += income
print(ans)
Problem p03079 (python)

Fixed submission:
a,b,c = map ( int , input () .split())
if a==b and b==c :
    print ("Yes")
else :
    print ("No")

Buggy submission (verdict: Runtime Error):
a,b,c = map ( int , input () .split())
if a==b && b==c :
    print ("Yes")
else :
    print ("No")
Problem p03080 (python)

Fixed submission:
num = int(input())
col = input()
r = col.count("R")
b = num - r
if r > b :
    ans = "Yes"
else :
    ans = "No"
print (ans)

Buggy submission (verdict: Runtime Error):
num = int(input())
col = input()
r = clo.count("R")
b = num - r
if r > b :
    ans = "Yes"
else :
    ans = "No"
print (ans)
Problem p03125 (python)

Fixed submission:
a,b = map (int , input().split())
if b % a == 0 :
    c = a+b
else:
    c = b-a
print (c)

Buggy submission (verdict: Runtime Error):
a,b = map (int , input().split())
if b % a == 0 ;
    c = a+b
else;
    c = b-a
print (c)

Buggy submission (verdict: Runtime Error):
a,b = map (int , input().split())
if b % a == 0 ;
    c = a+b
else;
    c = b-a
print (c)
Problem p03126 (python)

Fixed submission:
man,food = map ( int ,input().split())
num = set(range(food+1))
for i in range(man) :
    a = list ( map ( int  , input().split ()))
    del a[0]
    a = set (a)
    num = num & a
print (len (num) )

Buggy submission (verdict: Runtime Error):
man,food = map ( int ,input ().split())
num = set(range(food+1))
for i in range(man) :
    a = list ( map ( int () , input . split ()))
    del a[0]
    num = num & a
plint (len (num) )
Problem p03160 (python)

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
cost = [100000] * n
cost[0] = 0
cost[1] = abs(h[0]-h[1])
for i in range(2,n):
    sgl = cost[i-1] + abs(h[i]-h[i-1])
    dbl = cost[i-2] + abs(h[i]-h[i-2])
    cost[i] = min(sgl,dbl)
print(cost[-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
cost = [100000] * n
cost[0] = 0
cost[1] = abs(h[0]-h[1])
for i in range(2,n):
    sgl = cost[i-1] + abs(h[i]-h[i-1])
    dbl = cost[i-2] + abs(h[i]-h[i-2])
    cost[i] = min(sgl,dbl)
print(cost[n])

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
cost = [100000] * n
cost[0] = 0
cost[1] = abs(h[0]-h[1])
for i in range(2,n):
    sgl = cost[i-1] + abs(h[i]-[i-1])
    dbl = cost[i-2] + abs(h[i]-[i-2])
    cost[i] = min(sgl,dbl)
print(cost[n])

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
cost = [100000] * n
cost[0] = 0
cost[1] = abs(h[0]-h[1])
for i in range(2,n):
    sgl = cost[i-1] + abs(h[i]-abs[i-1])
    dbl = cost[i-2] + abs(h[i]-abs[i-2])
    cost[i] = min(sgl,dbl)
print(cost[n])
Problem p03163 (python)

Fixed submission:
n,w = map(int,input().split())
dp = [[0]*(w+1) for _ in range(n+1)]#[[0]*(w+1)] *(n+1)
for i in range(1,n+1):
    wi,vi = [int(i) for i in input().split()]
    #DPテーブルの更新
    for j in range(w+1):
        if j >= wi : #選べるかどうか
            dp[i][j] = max(dp[i-1][j] , dp[i-1][j-wi]+vi) #選ぶ場合
        else:
            dp[i][j] = max(dp[i-1][j] , dp[i][j]) #選ばない場合
print(dp[n][w])

Buggy submission (verdict: Runtime Error):
n,w = map(int,input().split())
dp = [[0]*(w+1)] *(n+1)
for i in range(1,n+1):
    wi,vi = map(int,input().split())
    #DPテーブルの更新
    for j in range(w+1):
        if j >= wi : #選べるかどうか
            dp[i][j] = max(dp[i-1][j] , dp[i-1][j-wi]+vi) #選ぶ場合
        else:
            dp[i][j] = max(dp[i-1][j] , dp[i][j]) #選ばない場合
print(dp[n+1][w+1])
Problem p02677 (python)

Fixed submission:
import math
a, b, h, m = map(int, input().split())
angle = abs(30*h - 5.5*m)
distance = (a*a + b*b - 2*a*b*math.cos(math.radians(angle)))
print(math.sqrt(distance))

Buggy submission (verdict: Runtime Error):
import math
a, b, h, m = map(int(), input().split())
angle = abs(30*h - 5.5*m)
distance = (a*a + b*b - 2*a*b*math.cos(math.radians(angle)))
print(math.sqrt(distance))
Problem p03220 (python)

Fixed submission:
N = int(input())
T, A = map(int, input().split())
palace = [abs(T - (int(x)*0.006) - A) for x in input().split()]
print(palace.index(min(palace))+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = map(int, input().split())
palace = [abs(T - (int(x)*0.006) -A) for x in input().split('')]
print(palace.index(min(min(palace)+1)))
Problem p03370 (python)

Fixed submission:
N, X = map(int, input().split())
M = [int(input()) for _ in range(N)]
ans = 0
for m in M:
    X -= m
    ans += 1
ans += X // min(M)
print(ans)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
M = [int(input()) for _ in range(N)]
ans = 0
for m in range(M):
    X -= m
    ans += 1
ans += X // min(M)
print(ans)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
M = list(map(int, input().split()))
ans = 0
for m in range(M):
    X -= m
    ans += 1
ans += X // min(M)
print(ans)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
M = list(map(int. input().split()))
ans = 0
for m in range(M):
    X -= m
    ans += 1
ans += X // min(M)
print(ans)
Problem p03471 (python)

Fixed submission:
N, Y = map(int, input().split())
x = -1
y = -1
z = -1
for i in range(N+1):
    for j in range(N+1-i):
        k = N-i-j
        if 10000*i + 5000*j + 1000*k == Y:
            x = i
            y = j
            z = k
print(x, y, z)

Buggy submission (verdict: Runtime Error):
N, Y = map(int, input().split())
x = -1
y = -1
z = -1
for i in range(n+1):
    for j in range(n+1-i):
        k = n-i-j
        if 10000*i + 5000*j + 1000*k == y:
            x = i
            y = j
            z = k
print(x, y, z)
Problem p03693 (python)

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

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

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

p.sort()
print(sum(p[0:K]))

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

p.sort()
print(sum(p[0:k]))
Problem p03062 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
sei=[0]*n
mai=0
zero=0
pr=0
for i in range(n):
  sei[i]=max(a[i],-a[i])
  pr+=sei[i]
  if a[i]<0:
    mai +=1
  elif a[i]==0:
    zero+=1
  else:
    pass
#ゼロと負の数を数える
if mai%2==0 or zero >=1:
    print(pr)
else:
    print(pr-2*min(sei))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
f=0
for i in range(n-1):
  if a[i]<=0 and a[i+1]<=0 and f==0:
    a[i]=a[i]*(-1)
    a[i+1]=a[i+1]*(-1)
    f=1
  elif a[i]*a[i+1]<=0:
Problem p03071 (python)

Fixed submission:
a,b=map(int,input().split())
if a-b!=0:
  t=max(a,b)
  print(2*t-1)
else:
  print(a+b)

Buggy submission (verdict: Runtime Error):
a,b=int(input().split())
if a-b!=0:
  t=max(a,b)
  print(2*t-1)
else:
  print(a+b)

Buggy submission (verdict: Runtime Error):
a,b=(int(x) for x int(input().split()))
if a-b!=0:
  t=max(a,b)
  print(2*t-1)
else:
  print(a+b)
Problem p03697 (python)

Fixed submission:
c,d = input().split()
a = int(c)
b = int(d)
if a+b>=10:
  print('error')
else:
    print(a+b)

Buggy submission (verdict: Runtime Error):
a,b=int(input().split())
if a+b>=10:
  print('error')
else:
    print(a+b)
Problem p03699 (python)

Fixed submission:
T=int(input())
si=[]
sum=0
for i in range(T):
  si.append(int(input()))
si.sort()
for k in range(T):
    sum=sum+si[k]
if sum%10!=0:
    print(sum)
else:
    for j in range(T):
        if si[j]%10!=0:
            sum=sum-si[j]
            break
        else:
            pass
    if sum%10==0:
        sum=0
    else:
        pass
    print(sum)

Buggy submission (verdict: Runtime Error):
T=int(input())
si=[]
sum=0
for i in range(T):
  si.append(int(input()))
  sum=sum+int(input())
sorted(si)
for j in range(T):
  if si[j]%10!=0:
    sum=sum-si[j]
    break
  else:
    sum=sum-si[j]
print(sum)
Problem p02628 (python)

Fixed submission:
from functools import reduce

N, K = [int(x) for x in input().split()]
p = sorted([int(x) for x in input().split()])
print(reduce(lambda x, y: x + y, p[0:K]))

Buggy submission (verdict: Runtime Error):
N, K = input().split()
p = sorted([list(map(int, input().split()))])
res = 0
for x in range(K):
  res += p[x]
print(res)

Buggy submission (verdict: Runtime Error):
N, K = input().split()
p = list(map(int, input().sort().split()))
res = 0
for x in range(K):
  res += p[x]
print(res)

Buggy submission (verdict: Runtime Error):
N, K = input().split()
p = list(map(int, input().split())).sort()
res = 0
for x in range(K):
  res += p[x]
print(res)
Problem p02789 (python)

Fixed submission:
n,m = map(int,input().split())
if n==m:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n,m = int(input()), int(input())
if (n==m):
  print("yes")
else: 
  print("no")
Problem p02811 (python)

Fixed submission:
k, x = input().split()
if int(k)*500 >= int(x):
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
k, x = int(input()), int(input())
print ("yes") if k*500 >= x else ("no")

Buggy submission (verdict: Runtime Error):
k, x = input(), input()
print ("yes") if k*500 >= x else ("no")

Buggy submission (verdict: Runtime Error):
k, x = map(int, raw_input().split())
if k*500 >= x:
  print("yes")
else: 
  print("no")

Buggy submission (verdict: Runtime Error):
K = int(input("Enter K: "))
X = int(input("Enter X: "))
if K*500 >= X:
  print("yes")
else:
  print("no")
Problem p02813 (python)

Fixed submission:
def permutation(lst):
    # If lst is empty then there are no permutations
  if len(lst) == 0:
    return []

        # If there is only one element in lst then, only
    # one permuatation is possible
  if len(lst) == 1:
    return [lst]

        # Find the permutations for lst if there are
    # more than 1 characters

  l = []  # empty list that will store current permutation

    # Iterate the input(lst) and calculate the permutation
  for i in range(len(lst)):
    m = lst[i]

        # Extract lst[i] or m from the list.  remLst is
        # remaining list
    remLst = lst[:i] + lst[i + 1:]

        # Generating all permutations where m is first
        # element
    for p in permutation(remLst):
      l.append([m] + p)
  return l


N = input()
x = [int(x) for x in input().split()]
y = [int(x) for x in input().split()]

NN = list(range(1, int(N) + 1))
P = permutation(NN)

xx = P.index(x)
yy = P.index(y)
print(abs(xx - yy))

Buggy submission (verdict: Runtime Error):
def permutation(lst): 
  
    # If lst is empty then there are no permutations 
    if len(lst) == 0: 
        return [] 
  
    # If there is only one element in lst then, only 
    # one permuatation is possible 
    if len(lst) == 1: 
        return [lst] 
  
    # Find the permutations for lst if there are 
    # more than 1 characters 
  
    l = [] # empty list that will store current permutation 
  
    # Iterate the input(lst) and calculate the permutation 
	for i in range(len(lst)): 
		m = lst[i] 
  
       # Extract lst[i] or m from the list.  remLst is 
       # remaining list 
       remLst = lst[:i] + lst[i+1:] 
  
       # Generating all permutations where m is first 
       # element 
	for p in permutation(remLst): 
           l.append([m] + p) 
    return l 

N= input()
x = [int(x) for x in input().split()]
y = [int(x) for x in input().split()]
 
NN = list(range(1,int(N)+1))
P = permutation(NN)
 
xx = P.index(x)
yy = P.index(y)
print(abs(xx-yy))

Buggy submission (verdict: Runtime Error):
def permutation(lst): 
    # If lst is empty then there are no permutations 
	if len(lst) == 0: 
		return [] 
  
    # If there is only one element in lst then, only 
    # one permuatation is possible 
	if len(lst) == 1: 
		return [lst] 
  
    # Find the permutations for lst if there are 
    # more than 1 characters 
  
    l = [] # empty list that will store current permutation 
  
    # Iterate the input(lst) and calculate the permutation 
    for i in range(len(lst)): 
       m = lst[i] 
  
       # Extract lst[i] or m from the list.  remLst is 
       # remaining list 
       remLst = lst[:i] + lst[i+1:] 
  
       # Generating all permutations where m is first 
       # element 
       for p in permutation(remLst): 
           l.append([m] + p) 
    return l 
 
N = input()
x = [int(x) for x in input().split()]
y = [int(x) for x in input().split()]
 
NN = list(range(1,int(N)+1))
P = permutation(NN)
 
xx = P.index(x)
yy = P.index(y)
print(abs(xx-yy))
Problem p02675 (python)

Fixed submission:
n=int(input())
n%=10
if(n==3):
	print("bon")
elif(n==0 or n==1 or n==6 or n==8):
	print("pon")
else:
	print("hon")

Buggy submission (verdict: Runtime Error):
n=(input())
n%=10
if(n==3)
	print("bon")
else if(n==0 or n==1 or n==6 or n==8)
	print("pon")
else
	print("hon")
Problem p03125 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,input(),split())
if b%a==0:
    print(a+b)
else:
    print(b-a)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())   
if b % a == 0:
    print(a+b)
else:
    print(b-a)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())   
if b%a==0:
	print(a+b)
else:
	print(b-a)

Buggy submission (verdict: Runtime Error):
    a=int(input('>>'))
    b=int(input('>>'))
    
    if b%a==0:
        print(a+b)
    else:
        print(b-a)

Buggy submission (verdict: Runtime Error):
# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.

__author__ = "c0117054"
__date__ = "$2019/02/18 19:31:49$"

if __name__ == "__main__":

    a=int(input())
    b=int(input())
    
    if b%a==0:
        print(a+b)
    else:
        print(b-a)

Buggy submission (verdict: Runtime Error):
# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.

__author__ = "c0117054"
__date__ = "$2019/02/18 19:31:49$"

if __name__ == "__main__":

    a=int(input('>>'))
    b=int(input('>>'))
    
    if b%a==0:
        print(a+b)
    else:
        print(b-a)
Problem p03719 (python)

Fixed submission:
v = input().split(' ')
if int(v[0]) <= int(v[2]) and int(v[2]) <= int(v[1]):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a, b, c = input()
if a <= c and c <= b:
    print('Yes')
else:
    print('No')
Problem p02630 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
# q=int(input())
L=[0]*(100001)
s=sum(a)

for i in a:
    L[i] +=1

q= int(input())
for _ in range(q):
    b, c = map(int,input().split())
    L[c] += L[b]
    s+= L[b]*(c-b)
    L[b]=0
    print(s)
# b=[]
# c=[]
# for i in range(q):
#     d,e=input().split()
#     b.append(int(d))
#     c.append(int(e))


# if q >= len(b):
#     for j in range(q):
#         for i in range(len(b)):
#             if q < len(b):
#                 if a[j]==b[i]:
#                     a[j]=c[i]
# else:
#     for i in range(len(b)):
#         for j in range(q):
#             if a[i] == b[j]:
#                 a[i]=c[j]
#         # elif q < len(b):
#         #     if a[i] == b[i]:
#         #         a[i]=c[j]
#         #         if a[-1] ==b[j]:
#         #             a[-1]=c[i]
#         print(sum(a))



# # print(a)
# # print(a)
# # print(b)
# # print(c)

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

b=[]
c=[]
for i in range(q):
    d,e=input().split()
    b.append(int(d))
    c.append(int(e))

for i in range(q):
    for j in range(len(b)):
        if a[i] == b[j]:
            a[i]=c[j]
            # if a[-1] ==b[j]:
            #     a[-1]=c[i]
print(sum(a))
    # print(a)
# print(a)
# print(b)
# print(c)
Problem p02658 (python)

Fixed submission:
# from operator import mul
# from functools import reduce

n=int(input())
a=list(map(int, input().split()))
# limit=10**18

# if 0 in a:
#     print(0)
#     exit()

ans = 1
# ans = reduce(mul, a) #=> 1320

for i in range(n):
  ans *= a[i]
  if ans > 10 ** 18:
  # if a[i] == 0:
  #   break
  # elif (ans*a[i]) > limit:
    ans = -1
    break

for i in range(n):
  if a[i] == 0:
      ans = 0

# if ans > limit:
#   print(-1)
# else:
print(ans)

Buggy submission (verdict: Runtime Error):
# from operator import mul
# from functools import reduce

n=int(input())
a=list(map(int,input().split()))
# limit=10**18

# if 0 in a:
#     print(0)
#     exit()

ans = 1
# ans = reduce(mul, a) #=> 1320

for i in range(n):
  ans *= a[i]
  if sum > 10 ** 18:
  # if a[i] == 0:
  #   break
  # elif (ans*a[i]) > limit:
    ans = -1
    break

for i in range(n):
  if a[i] == 0:
      ans = 0

# if ans > limit:
#   print(-1)
# else:
print(ans)

Buggy submission (verdict: Runtime Error):
# from operator import mul
# from functools import reduce

n=int(input())
a=list(map(int,input().split()))
limit=10**18

# if 0 in a:
#     print(0)
#     exit()

ans = 1
# ans = reduce(mul, a) #=> 1320

for i in range(a):
  ans *= a[i]
  if sum> limit:
  # if a[i] == 0:
  #   break
  # elif (ans*a[i]) > limit:
    ans = -1
    break

for i in range(n):
  if a[i] == 0:
      ans = 0

# if ans > limit:
#   print(-1)
# else:
print(ans)

Buggy submission (verdict: Runtime Error):
# from operator import mul
# from functools import reduce

n=int(input())
a=list(map(int,input().split()))
limit=10**18

if 0 in a:
    print(0)
    exit()

ans = 1
# ans = reduce(mul, a) #=> 1320

for i in range(a):
  ans *= a[i]
  if sum> limit:
  # if a[i] == 0:
  #   break
  # elif (ans*a[i]) > limit:
    ans = -1
    break

# if ans > limit:
#   print(-1)
# else:
print(ans)

Buggy submission (verdict: Runtime Error):
# from operator import mul
# from functools import reduce

n=int(input())
a=list(map(int,input().split()))
limit=10**18

if 0 in a:
    print(0)
    exit()

# ans = 1
# ans = reduce(mul, a) #=> 1320

for i in range(a):
  ans *= a[i]
  if sum>limit:
  # if a[i] == 0:
  #   break
  # elif (ans*a[i]) > limit:
    ans = -1
    break

# if ans > limit:
#   print(-1)
# else:
print(ans)

Buggy submission (verdict: Runtime Error):
# from operator import mul
# from functools import reduce

n=int(input())
a=list(map(int,input().split()))
limit=10**18

if 0 in a:
    print(0)
    exit()

# ans = 1
# ans = reduce(mul, a) #=> 1320

for i in range(a):
  ans *= a[i]
  if sum>limit:
  # if a[i] == 0:
  #   break
  # elif (ans*a[i]) > limit:
    ans = -1
    break

# if ans > limit:
#   print(-1)
# else:
  print(ans)

Buggy submission (verdict: Runtime Error):
# from operator import mul
# from functools import reduce

n=int(input())
a=list(map(int,input().split()))
limit=10**18

# ans = 1
# ans = reduce(mul, a) #=> 1320

for i in range(n):
  ans *= a[i]
  if a[i] == 0:
    break

if ans > limit:
  print(-1)
else:
  print(ans)
Problem p02675 (python)

Fixed submission:
n = int(input())
a = n%10

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

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

if int(n[-1]) in [2,4,5,7,9]:
    print("hon")
elif int(n[-1]) in [0, 1, 6, 8]:
    print("pon")
else:
    print("bon")

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

if (n[-1].in(2,4,5,7,9)):
  print('pon')
elif (n[-1].in(0,1,6,8)):
  print('hon')
elif (n[-1] == 3):
  pirint('bon')

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

if (n[-1].in(2,4,5,7,9)):
  print('pon')
elif (n[-1].in(0,1,6,8)):
  print('hon')
elif (n[-1] == 3):
  pirint('bon')

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

if (n[-1].include(2,4,5,7,9)):
  print('pon')
elif (n[-1].include(0,1,6,8)):
  print('hon')
elif (n[-1] == 3):
  pirint('bon')
Problem p02801 (python)

Fixed submission:
c = input()
alpha_list = 'abcdefghijkfmnopqrstuvrxyz'

for i in range(len(alpha_list)):
  if c == alpha_list[i]:
    print(alpha_list[i+1])
    break

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

int main() {
  char c;
  cin >> c;
  cout << char(c+1) << endl;
  return 0;
}
Problem p02802 (python)

Fixed submission:
n,m = map(int,input().split())
ac,wa = 0,0
number=[0]*n

for i in range(m):
  p,s = input().split()
  p = int(p) - 1
  if number[p]!=-1:
    if s == "WA":
      number[p]+=1
    elif s == "AC":
      ac+=1
      wa+=number[p]
      number[p]=-1
print(ac,wa)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
ac,wa = 0,0
number=[0]*N

for m in range(m):
  p,s = input().split()
  p = int(p) - 1
  if number[p]!=1:
    if s == "WA":
      number[p]+=1
    elif s == "AC":
      ac+=1
      wa+=number[p]
      number[p]=-1
print(ac,wa)
Problem p02818 (python)

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

if a>=k:
  print(a-k, b)
else:
  print(0, max(0, b-(k-a)))

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

for i in range(k):
  if a > 0:
    a-=1
  elif b > 0:
    b-=1

  print(a+b)
Problem p02886 (python)

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

ans = 0
for i in range(n):
  for j in range(i+1, n):
    ans +=d[i]* d[j]
print(ans)

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i< (n); ++i)
using namespace std;
typedef long long ll;

int main() {
  int n;
  cin >> n;
  vector<int> d(n);
  rep(i, n) cin >> d[i];
  int ans = 0;
  rep(i, n) for (int j = i+1; j<n; ++j) {
    ans += d[i]*d[j];
  }
  cout << ans << endl;
  return 0;
  }