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

Fixed submission:
import math
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n,m = (int(x) for x in input().split())
a = list(map(int, input().split()))

lc = int(lcm_list(a) // 2)

tmp = 0
bol = 0
num = a[0]
while num % 2 == 0:
        num = num // 2
        tmp += 1
cnt = 0
for num in a:
    cnt = 0
    while num % 2 == 0:
        num = num // 2
        cnt += 1
    if cnt != tmp:
        bol = 1

if lc > m: print(0)
elif bol == 1: print(0)
else: print(int(((m / lc) + 1) // 2))

Buggy submission (verdict: Runtime Error):
5 1000000000

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n,m = (int(x) for x in input().split())
a = list(map(int, input().split()))

lc = lcm_list(a) / 2
if lc > m: print(0)
else: print(int((m / lc) // 2 + 1))
Problem p02801 (python)

Fixed submission:
C = input()
 
if C == "a":
    print("b")
elif C == "b":
    print("c")
elif C == "c":
    print("d")
elif C == "d":
    print("e")
elif C == "e":
    print("f")
elif C == "f":
    print("g")
elif C == "g":
    print("h")
elif C == "h":
    print("i")
elif C == "i":
    print("j")
elif C == "j":
    print("k")
elif C == "k":
    print("l")
elif C == "l":
    print("m")
elif C == "m":
    print("n")
elif C == "n":
    print("o")
elif C == "o":
    print("p")
elif C == "p":
    print("q")
elif C == "q":
    print("r")
elif C == "r":
    print("s")
elif C == "s":
    print("t")
elif C == "t":
    print("u")
elif C == "u":
    print("v")
elif C == "v":
    print("w")
elif C == "w":
    print("x")
elif C == "x":
    print("y")
elif C == "y":
    print("z")
else:
    print("era-")

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

if x == "a":
    print("b")
elif x == "b":
    print("c")
elif x == "c":
    print("d")
elif x == "d":
    print("e")
elif x == "e":
    print("f")
elif x == "f":
    print("g")
elif x == "g":
    print("h")
elif x == "h":
    print("i")
elif x == "i":
    print("j")
elif x == "j":
    print("k")
elif x == "k":
    print("l")
elif x == "l":
    print("m")
elif x == "m":
    print("n")
elif x == "n":
    print("o")
elif x == "o":
    print("p")
elif x == "p":
    print("q")
elif x == "q":
    print("r")
elif x == "r":
    print("s")
elif x == "s":
    print("t")
elif x == "t":
    print("u")
elif x == "u":
    print("v")
elif x == "v":
    print("w")
elif x == "w":
    print("x")
elif x == "x":
    print("y")
elif x == "y":
    print("z")
else:
    print("era-")
Problem p02801 (python)

Fixed submission:
C = input()
alphabetlist = [chr(i) for i in range(97, 97+26)]
next_index = alphabetlist.index(C)+1
print(alphabetlist[next_index])

Buggy submission (verdict: Runtime Error):
C = input()
alphabetlist = [chr(i) for i in range(97, 97+26)]
next_index = alphabetlist.index(C)+1
print(alphabetlist(next_index))
Problem p04043 (python)

Fixed submission:
A, B, C= map(int, input().split())
if (A!=5 and A!=7) or (B!=5 and B!=7) or (C!=5 and C!=7):
    print("NO")
elif A==5:
    if (B==5 and C==7) or (B==7 and C==5):
        print ("YES")
    else:
        print("NO")
elif (B==5 and C==5):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
D = list(map(int, input().split()))
shiharai=N
l = [int(x) for x in list(str(N))]
c=len(l)
for i in range(len(l)):
    while l[i] in D:
        shiharai+=1
        l = [int(x) for x in list(str(shiharai))]
if len(l)!=c:
    for i in range(len(l)):
        while l[i] in D:
            shiharai+=1
            l = [int(x) for x in list(str(shiharai))]
print(shiharai)
Problem p02801 (python)

Fixed submission:
alpha = input()
print(chr(ord(alpha)+1))

Buggy submission (verdict: Runtime Error):
import sys

for alpha in sys.stdin:
	sys.stdout.write(chr(ord(alpha)+1))

Buggy submission (verdict: Runtime Error):
import sys

alphas = [chr(i) for i in range(ord('a'), ord('z') +1)]
for alpha in sys.stdin:
	print(alphas[alphas.index(alpha)+1])
Problem p02804 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np

iMod = 1000000007
lModPow = [iP for iP, s in enumerate(bin(iMod-2)[:1:-1]) if s == "1"]

def fnModInv(iDivN):
  lNp  = [iDivN % iMod]
  for _ in range(max(lModPow)):
    lNp.append(lNp[-1]**2 % iMod)
  iRet = 1
  for iP in lModPow:
    iRet *= lNp[iP]
    iRet %= iMod
  return iRet

def fnSolv():
  iNum, iK = map(int, input().split())
  naU = [0]*iNum
  naA = np.array(list(map(int, input().split())), dtype = np.int64)
  naA = np.sort(naA)
  iRet =0
  if iK >= 2:
    naU[-iK] = 1
    for iK0 in range(iNum - iK):
      naU[-iK -iK0 - 1]= ( (naU[- iK - iK0] * (iK + iK0))%iMod * fnModInv(iK0 + 1) )%iMod
  for iL, iA in enumerate(naA):
    iRet += ((naU[-iL-1] - naU[iL])%iMod * iA)%iMod
    iRet %=iMod
  print(iRet)

if __name__ == '__main__':
  fnSolv()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np
iNum, iK = map(int, input().split())
iK -= 1
naA = np.array(list(map(int, input().split())), dtype = "int64")
naA = np.sort(naA)
naA = list(naA)
#print(naA)
iMod = 1000000007
iRet*=0
iNmrt = 1
iDnmt = 1
for iK0 in range(iK):
  iNmrt *= iNum - iK0
  iDnmt *= iK0 + 1
iU0= iNmrt // iDnmt
#print(iNum, iK, iU0)
iL0=0
iU = iNum
for iL, iA in enumerate(naA):
  iU -= 1
  if iL > iK:
    iL0 *= iL
    iL0//= iL - iK
  elif iL == iK:
    iL0 = 1
  else:
    iL0 = 0
  if iU >= iK:
    iU0 *=  iU+1-iK
    iU0 //= iU+1
  else:
    iU0 = 0
  #print("iU, iK, iU0, iA :",iU,iK,iU0, iA)
  #print("iL, iK, iL0, iA :",iL,iK,iL0, iA)
  iL0mU0=  iL0 - iU0
  iRet0 = (iL0mU0 * iA) % iMod
  iRet += iRet0
  #print(iRet0)
  iAp = iA
print(iRet%iMod)
Problem p02805 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np

iNum = int(input())
naXY = np.zeros((iNum,2))
for iI in range(iNum):
  x, y = map(int, input().split())
  naXY[iI] = [x,y]
naXY0 = np.average(naXY, axis = 0) + np.random.rand(2) * 1e-3
fA = 1.0e-1
while fA > 1.0e-10:
  naP  = naXY - naXY0
  naR = np.einsum("ij, ij -> i", naP,naP)
  iImax = np.argmax(naR)
  #fR  = naR[iImax]**0.5
  naE = naP[iImax]
  #naE/= np.dot(naE,naE)**0.5
  #print(iImax, naXY0, fR)
  #naB = np.einsum("ij, j->i", naP, naE)*2
  #naA = (naR - fR**2 ) / (naB - 1.0e-10 - fR)
  #fA  = np.min(naA[naB< - 1.0e-20])
  #print(iImax, fA, fR)
  #naXY0+=naE*fA
  naXY0+=naE*fA
  fA*=0.9998
print(naR[iImax]**0.5)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np

iNum = int(input())
naXY = np.zeros((iNum,2))
for iI in range(iNum):
  x, y = map(int, input().split())
  naXY[iI] = [x,y]
naXY0 = np.average(naXY, axis = 0) + np.random.rand(2) * 1e-3
fA = 1.0e-1
while fA > 1.0e-10:
  naP  = naXY - naXY0
  naR = np.einsum("ij, ij -> i", naP,naP)
  iImax = np.argmax(naR)
  #fR  = naR[iImax]**0.5
  naE = naP[iImax]
  naE/= np.dot(naE,naE)**0.5
  #print(iImax, naXY0, fR)
  #naB = np.einsum("ij, j->i", naP, naE)*2
  #naA = (naR - fR**2 ) / (naB - 1.0e-10 - fR)
  #fA  = np.min(naA[naB< - 1.0e-20])
  #print(iImax, fA, fR)
  #naXY0+=naE*fA
  naXY0+=naE*fA
  fA*=0.9995
print(fR)
Problem p03161 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
def fnSolv():
  iNum, iK = map(int, input().split())
  naHn  = np.array(list(map(int, input().split())))
  naDP  = np.zeros(iNum, dtype='int64')
  naLen = np.ones(iK) * 10**9
  for iI0 in range(1, iNum):
    iK0 = min([iK, iI0])
    naLen = naDP[iI0-iK0:iI0] + np.abs(- naHn[iI0-iK0:iI0] + naHn[iI0])
    naDP[iI0] = naLen.min()
  print(naDP[iNum-1])

if __name__ == '__main__':
  fnSolv()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np
def fnSolv():
  iNum, iK = map(int, input().split())
  naHn  = np.array(list(map(int, input().split())))
  naDP  = np.zeros(iNum, dtype='int64')
  naLen = np.ones(iK) * 10**9
  for iI0 in range(1, iK+1):
    naLen = naDP[0:iI0] + np.abs(- naHn[0:iI0] + naHn[iI0])
    naDP[iI0] = naLen.min()
  if iNum >= iK+1:
    for iI0 in range(iK+1, iNum):
      naLen = naDP[iI0-iK:iI0] + np.abs(- naHn[iI0-iK:iI0] + naHn[iI0])
      naDP[iI0] = naLen.min()
  print(naDP[iNum-1])

if __name__ == '__main__':
  fnSolv()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np
def fnSolv():
  iNum, iK = map(int, input().split())
  naHn  = np.array(list(map(int, input().split())))
  naDP  = np.zeros(iNum, dtype='int64')
  naLen = np.ones(iK) * 10**9
  for iI0 in range(1, iK+1):
    naLen = naDP[0:iI0] + np.abs(- naHn[0:iI0] + naHn[iI0])
    naDP[iI0] = naLen.min()
  if iNum >= iK+1:
    for iI0 in range(iK+1, iNum):
      naLen = naDP[iI0-iK:iI0] + np.abs(- naHn[iI0-iK:iI0] + naHn[iI0])
      naDP[iI0] = naLen.min()
    print(naDP[iNum-1])

if __name__ == '__main__':
  fnSolv()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np
def fnSolv():
  iNum, iK = map(int, input().split())
  naHn  = np.array(list(map(int, input().split())))
  naDP  = np.zeros(iNum, dtype='int64')
  naLen = np.ones(iK) * 10**9
  for iI0 in range(1, iK+1):
    naLen = naDP[0:iI0] + np.abs(- naHn[0:iI0] + naHn[iI0])
    naDP[iI0] = naLen.min()
  for iI0 in range(iK+1, iNum):
    naLen = naDP[iI0-iK:iI0] + np.abs(- naHn[iI0-iK:iI0] + naHn[iI0])
    naDP[iI0] = naLen.min()
  print(naDP[iNum-1])

if __name__ == '__main__':
  fnSolv()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
#import numpy as np
def fnSolv():
  iNum, iK = map(int, input().split())
  lHn  = list(map(int, input().split()))
  lDP  = [0]*iK
  lLen = [0]*len(lRange)
  for iI0 in range(1, iNum):
    lRange = range(max([0, iI0 - iK]), iI0)
    iLen = len(lRange)
    for iI2, iI1 in enumerate(lRange):
      lLen[iI2] = lDP[iI1%iK] + abs(lHn[iI0] - lHn[iI1])
    lDP[iI0%iK] = min(lLen[:iLen])
    #print(iI0, lDP, lLen)
  print(lDP[(iNum-1)%iK])

if __name__ == '__main__':
  fnSolv()
Problem p02801 (python)

Fixed submission:
c=input()
print(chr(ord(c)+1))

Buggy submission (verdict: Runtime Error):
c=input()
print(char(ord(c)+1)
Problem p02812 (python)

Fixed submission:
X=input()
c=list(input())
result=0
i=0
while i<len(c)-2:
    if c[i]=='A':
        if c[i+1]=='B' and c[i+2]=='C':
            result+=1
            i+=3
        else:
            i+=1
    else:
        i+=1
print(result)

Buggy submission (verdict: Runtime Error):
X=input()
c=list(input())
result=0
i=0
while i<len(c):
    if c[i]=='A':
        if c[i+1]=='B' and c[i+2]=='C':
            result+=1
            i+=1
        else:
            i+=1
    else:
        i+=1
print(result)

Buggy submission (verdict: Runtime Error):
X=input()
c=list(input())
result=0
i=0
while i<len(c):
    if c[i]=='A':
        if c[i+1]=='B' and c[i+2]=='C':
            result+=1
            i+=3
        else:
            i+=1
    else:
        i+=1
print(result)
Problem p02802 (python)

Fixed submission:
#Nが問題数Mが提出数
N, M = map(int, input().split())
 
submit = []
for _ in range(M):
  temp = [x for x in input().split()]
  submit.append(temp)
 
ac = [0]*(N + 1)
wa = [0]*(N + 1)
  
for i in range(M):
  result = submit[i][1]
  question = int(submit[i][0])
  
  if result == 'AC' and ac[question] == 0:
    ac[question] = 1
  elif result == 'WA' and ac[question] == 0:
    wa[question] += 1
 
for i in range(N + 1):
  if ac[i] != 1:
    wa[i] = 0
 
print(sum(ac), sum(wa))

Buggy submission (verdict: Runtime Error):
#Nが問題数Mが提出数
N, M = map(int, input().split())

submit = []
for _ in range(M):
  temp = [x for x in input().split()]
  submit.append(temp)

ac = [0]*(N + 1)
wa = [0]*(N + 1)
  
for i in range(M):
  result = submit[i][1]
  question = int(submit[i][0])
  
  if result == 'AC' and ac[question] == 0:
    ac[question] = 1
  elif result == 'WA' and ac[question] == 0:
    wa[question] += 1

for i in range(n + 1):
  if ac[i] != 1:
    wa[i] = 0

print(sum(ac), sum(wa))
Problem p02818 (python)

Fixed submission:
A, B, K = map(int, input().split())
     
if A >= K:
  a = A - K
  b = B
elif A+B >= K:
  a = 0
  b = A + B - K
else:
  a = 0
  b = 0
     
print(str(a) + " " + str(b))

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

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

print(str(a) + " " + str(b))
Problem p02817 (python)

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

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
print(t + s)
Problem p02801 (python)

Fixed submission:
C = input()
alp = 'abcdefghijklmnopqrstuvwxyz'
alp_list = list(alp)
num = alp_list.index(C)
print(alp_list[num+1])

Buggy submission (verdict: Runtime Error):
import math
INF = math.inf
h,w = map(int,input().split())
n = h*w

field = []
for i in range(h):
    field.append(input())

dist = [[INF] * n for _ in range(n)]

for i in range(h):
    for j in range(w):
        if field[i][j] == "#":continue
        if j + 1 < w and field[i][j+1] != "#":
            dist[i * w + j][i * w + j + 1] = 1
            dist[i * w + j + 1][i * w + j] = 1
        if i + 1 < h and field[i+1][j] != "#":
            dist[i * w + j][(i+1) * w + j] = 1
            dist[(i+1) * w + j][i * w + j] = 1

for i in range(n):
    for j in range(n):
        for k in range(n):
            dist[j][k] = min(dist[j][k],dist[j][i]+dist[i][k])

ans = 0
for i in range(n):
    for j in range(n):
        if(i==j):continue
        if(dist[i][j]==INF):continue
        ans = max(ans,dist[i][j])

print(ans)
Problem p03062 (python)

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

numbers_abs = [abs(n) for n in numbers]
sum_abs = sum(numbers_abs)
min_abs = min(numbers_abs)

count_negative = sum([1 for n in numbers if n < 0])

answer = sum_abs
if (count_negative % 2 == 1):
  answer = sum_abs - 2 * min_abs

print(answer)

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

numbers_abs = [abs(n) for n in numbers if n != 0]
sum_abs = sum(numbers_abs)
min_abs = min(numbers_abs)

count_negative = 0
count_zero = 0
for n in numbers:
  if (n < 0):
    count_negative += 1
  elif (n == 0):
    count_zero += 1

answer = sum_abs
if (count_negative % 2 == 1 and count_zero < 1):
  answer = sum_abs - 2 * min_abs

print(answer)
Problem p02802 (python)

Fixed submission:

N , M = [int(n) for n in input().split(' ')]

list_AC = [0] * N
list_WAcount = [0] * N
sumAC = 0
sumWA = 0

for i in range(M):
    sp , S = input().split(' ')
    p = int(sp)
    
    if (list_AC[p-1] != 0):
        # 既にAC済みの場合は何もしない
        continue 
    else:
        # 最初に正解したときにそれまでのWA回数を加算
        if S == 'AC':
            sumAC += 1
            list_AC[p-1] = 1
            sumWA += list_WAcount[p-1]
        else:
            list_WAcount[p-1] += 1

print("{} {}".format(sumAC,sumWA))

Buggy submission (verdict: Runtime Error):

N , M = [int(n) for n in input().split(' ')]

list_AC =[]
list_WAcount = [0] * N
sumWA = 0

for i in range(M):
    p , S = input().split(' ')
    
    if (p in list_AC):
        # 既にAC済みの場合は何もしない
        continue 
    else:
        # 最初に正解したときにそれまでのWA回数を加算
        if S == 'AC':
            list_AC.append(p)
            sumWA += list_WAcount[p-1]
        else:
            list_WAcount[p-1] += 1

print("{} {}".format(len(list_AC),sumWA))

Buggy submission (verdict: Runtime Error):
N , M = [int(n) for n in input.split(' ')]

list_AC = []
count_WA = {}

for i in range(M):
    p , S = input.split(' ')
    
    if (p in list_AC):
        # 既にAC済みの場合は何もしない
        continue 
    else:
        if S == 'AC':
            list_AC.append(p)
        else:
            if p in count_WA:
                count_WA[p] += 1
            else:
                count_WA[p] = 1
        
for i in list_AC:
    if i in count_WA:
        print(count_WA[i])
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
N , M = [int(n) for n in input.split(' ')]

list_AC = []
count_WA = {}

for i in range(M):
    p , S = input.split(' ')
    
    if (p in list_AC):
        # 既にAC済みの場合は何もしない
        continue 
    else:
        if S = 'AC':
            list_AC.append(p)
        else:
            if p in count_WA:
                count_WA[p] += 1
            else:
                count_WA[p] = 1
        
for i in list_AC:
    if i in count_WA:
        print(count_WA[i])
    else:
        print(0)
Problem p02801 (python)

Fixed submission:
D = list('abcdefghijklmnopqrstuvwxyz')
C = input()
print(D[D.index(C)+1])

Buggy submission (verdict: Runtime Error):
N, K, M = map(int,input().split())
A = list(map(int,input().split(' ')))

goal = N*M

if K < M or (sum(A)+K) < goal:
    print("-1")
elif 0 <= goal - sum(A) <= K:
    print(goal - sum(A))
elif goal - sum(A) < 0:
    print("0")
Problem p02811 (python)

Fixed submission:
# https://atcoder.jp/contests/abc150/tasks/abc150_a

def read_int_n(): return list(map(int, input().split()))

K, X = read_int_n()

if K*500 >= X:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
def read_int(): return int(input())
N = read_int()
def read_str(): return input().strip()
S = list(read_str())

__DEBUG__ = False

def solution():
    count = 0    
    for i in range(N-2):
        if __DEBUG__: print(f"checking {S[i]} at index: {i}")
        if S[i] == 'A':
            if S[i+1] == 'B' and S[i+2] == 'C':
                count += 1
                continue
    return count

    
if __name__ == '__main__':
    print(solution())

Buggy submission (verdict: Runtime Error):
# https://atcoder.jp/contests/abc150/tasks/abc150_a

def read_int_n(): return list(map(int, input().split()))

K, X = read_int_n()

print(f"Nubmer coins K = {K}; Total X = {X}")
if K*500 >= X:
    print("Yes")
else:
    print("No")
Problem p02830 (python)

Fixed submission:
N = int(input())
S, T = input().split()
 
ans = "".join([S[i] + T[i] for i in range(N)])
print(ans)

Buggy submission (verdict: Runtime Error):

N = int(input())
S, T = map(list, input().split())

out = []
for i in range(N):
    #print(f"i = {i} {type(out)} S[i] = {S[i]}")
    #print(f"Output => {out}")
    out.append(S[i])
    out.append(T[i])

out = "".join(out)

print(f"{out}")
Problem p04031 (python)

Fixed submission:
n = int(input())
s = [int(c) for c in input().split()]
def solution(s):
    cost = 0
    mean = round(sum(s)/len(s))
    for i in s:
        cost += abs(i-mean) ** 2
        #print(f"DEBUG >> {mean} {i} {cost}")
    return cost
  
print(solution(s))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = map(int, input().split())
def solution(s):
    cost = 0
    mean = round(sum(s)/len(s))
    for i in s:
        cost += abs(i-mean) ** 2
        #print(f"DEBUG >> {mean} {i} {cost}")
    return cost
  
print(solution(s))
Problem p03341 (python)

Fixed submission:
input()
s = input()

l = 0
r = s[1:].count('E')
x = l + r

for i in range(1, len(s)):
  if s[i - 1] == 'W':
    l += 1

  if s[i] == 'E':
    r -= 1
  x = min(x, l + r)

print(x)

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

def f(i):
  return s[0:i].count('W') + s[i:].count('E')

x = len(s)

for i in range(len(s)):
  x = min(x, f(i))

print(min(arr))
Problem p02958 (python)

Fixed submission:
def main37():
    num = int(input())
    data = input().split()
    retu = []
    for i in range(num):
        retu.append(int(data[i]))
    kari = list(retu)
    kari.sort()
    kosu = 0
    for i in range(num):
        if retu[i] != kari[i]:
            kosu = kosu + 1
    if kosu == 2 or kosu == 0:
        print("YES")
    else:
        print("NO")

if __name__ == "__main__":
    main37()

Buggy submission (verdict: Runtime Error):
def main37():
    num = int(input())
    data = input().split()
    retu = []
    for i in range(num):
        retu.append(int(data[i]))
    kari = list(retu)
    kari.sort()
    kosu = 0
    for i in range(num):
        if retu[i] != kosu[i]:
            kosu = kosu + 1
    if kosu == 2 or kosu == 0:
        print("YES")
    else:
        print("NO")

if __name__ == "__main__":
    main37()
Problem p02981 (python)

Fixed submission:
def main01():
    data = input().split()
    num = []

    for i in range(3):
        num.append(int(data[i]))
    densya = num[0] * num[1]
    if densya > num[2]:
        print(num[2])
    else:
        print(densya)


if __name__ == "__main__":
    main01()

Buggy submission (verdict: Runtime Error):
def main01():
    data = input().split()
    nums = []

    for i in range(3):
        nums.append(int(data))
    densya = num[0] * num[1]
    if densya > num[2]:
        print(num[2])
    else:
        print(densya)


if __name__ == "__main__":
    main01()
Problem p02994 (python)

Fixed submission:
def main08():
    data = input().split()
    nl = []
    for i in range(2):
        nl.append(int(data[i]))
    hantei = nl[0] + nl[1]
    result = 0
    if hantei <= nl[0] and 1 <= hantei:
        for i in range(nl[0]):
            result = result + nl[1] + i
    elif nl[1] > 0:
        for i in range(nl[0]-1):
            result = result + nl[1] + i + 1
    else:
        for i in range(nl[0]-1):
            result = result + nl[1] + i
    print(result)

if __name__ == "__main__":
    main08()

Buggy submission (verdict: Runtime Error):
def main08():
    data = input().split()
    nl = []
    for i in range(2):
        nl.append(int(data[i]))
    hantei = nl[0] + nl[1]
    result = 0
    if hantei <= nl[0] and 1 <= hantei:
        for i in range(nl[0]):
            result = result + nl[1] + i
    elif nl[1] > 0:
        for i in range(nl[0]-1):
            result = result + nl[1] + i + 1
    else:
        for i in range(nl[0]-1):
            result = result + nl[i] + i
    print(result)

if __name__ == "__main__":
    main08()
Problem p03000 (python)

Fixed submission:
def main15():
    data = input().split()
    num = []
    for i in range(2):
        num.append(int(data[i]))
    data2 = input().split()
    num2 = []
    for i in range(num[0]):
        num2.append(int(data2[i]))
    length = 0
    result = 1
    for i in range(num[0]):
        length = length + num2[i]
        if length > num[1]:
            break
        else:
            result = result + 1
    print(result)

if __name__ == "__main__":
    main15()

Buggy submission (verdict: Runtime Error):
def main15():
    data = input().split()
    num = []
    for i in range(2):
        num.append(int(data[i]))
    data2 = input().split()
    num2 = []
    for i in range(num[0]):
        num2.append(int(data2[i]))
    length = 0
    result = 1
    for i in range(num[0]):
        length = length + num[2]
        if length > num[1]:
            break
        else:
            result = result + 1
    print(result)

if __name__ == "__main__":
    main15()
Problem p03211 (python)

Fixed submission:
def main42():
    data = input()
    nagasa = len(data)
    result = 10000
    for i in range(0,nagasa-2,1):
        kari = data[i:i+3]
        num = int(kari)
        if result > abs(num - 753):
            result = abs(num - 753)
    print(result)

if __name__ == "__main__":
    main42()

Buggy submission (verdict: Runtime Error):
def main42():
    data = input()
    nagasa = len(data)
    result = 10000
    for i in range(0,nagasa-2,1):
        kari = data[i:i+3]
        num = int(kari)
        if result > abs(num - 753)

if __name__ == "__main__":
    main42()