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

Fixed submission:
Ns=input()
N=int(Ns)
fX=0
for s in Ns:
  fX+=int(s)
if N%fX==0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
Ns=input()
N=int(N)
fX=0
for s in Ns:
  fX+=int(s)
if N%fX==0:
  print('Yes')
else:
  print('No')
Problem p03503 (python)

Fixed submission:
N=int(input())
F=[list(map(int,input().split())) for _ in range(N)]
P=[list(map(int,input().split())) for _ in range(N)]
from itertools import product
gain=[]
for p in product([0,1,2,3],repeat=5):
    C=[0 for i in range(N)]
    for i in range(5):
        for j in range(N):
            am=F[j][2*i]
            pm=F[j][2*i+1]
            if p[i]==1:
                C[j]+=am
            elif p[i]==2:
                C[j]+=pm
            elif p[i]==3:
                C[j]+=am+pm
    g=0
    for j in range(N):
        g+=P[j][C[j]]
    
    flag=False
    for i in range(5):
        if p[i]!=0:
            flag=True
    if flag:
        gain.append(g)

print(max(gain))

Buggy submission (verdict: Runtime Error):
N=int(input())
C=[]
S=[]
F=[]
from math import ceil
for _ in range(N-1):
    c,s,f=map(int,input().split())
    C.append(c)
    S.append(s)
    F.append(f)
ans=[]
for i in range(0,N-1):
    t=S[i]+C[i]
    sta=i+1
    while sta<N-1:
        if t<=S[sta]:
            t=S[sta]+C[sta]
        else:
            k=ceil((t-S[sta])/F[sta])
            t=S[sta]+k*F[sta]+C[sta]
        sta+=1
    ans.append(t)
for a in ans:
    print(a)
print(0)
Problem p03544 (python)

Fixed submission:
def memoize(f):
    cache={}
    def helper(*args):
        if args not in cache:
            cache[args] = f(*args)
        return cache[args]
    return helper

@memoize
def ans(N):
    if N==0:
        return 2
    elif N==1:
        return 1
    else:
        return ans(N-1)+ans(N-2)

N=int(input())
print(ans(N))

Buggy submission (verdict: Runtime Error):
def memoize(f):
  cache={}
    def helper(*args):
      if args not in cache:
        cache[args] = f(*args)
        return cache[args]
      return helper

@memoize
def ans(N):
  if N==0:
    return 1
  elif N==1:
    return 2
  else:
    return ans(N-1)+ans(N-2)
  
N=int(input())
print(ans(N))
Problem p03547 (python)

Fixed submission:
X,Y=input().split()
if X==Y:
  print('=')
elif X<Y:
  print('<')
else:
  print('>')

Buggy submission (verdict: Runtime Error):
X,Y=list(input())
if X==Y:
  print('=')
elif X<Y:
  print('<')
else:
  print('>')

Buggy submission (verdict: Runtime Error):
X,Y=map(int,input().split())
if X==Y:
  print('=')
elif X<Y:
  print('<')
else:
  print('>')
Problem p03644 (python)

Fixed submission:
def num2(n):
  ans=0
  while n%2==0:
    ans+=1
    n//=2
  return ans
N=int(input())
l=[[i,num2(i)] for i in range(1,N+1)]
l.sort(key=lambda x:x[1],reverse=True)

print(l[0][0])

Buggy submission (verdict: Runtime Error):
def num2(n):
  ans=0
  while n%2==0:
    ans+=1
    n//=2
  return ans

l=[[i,num2(i)] for i in range(1,N+1)]
l.sort(key=lambda x:x[1])

print(l[0][0])
Problem p03645 (python)

Fixed submission:
N,M=map(int,input().split())
from collections import defaultdict

d1=defaultdict(int)
d2=defaultdict(int)

for _ in range(M):
    a,b=map(int,input().split())
    if a==1:
        d1[b]=1
        if d2[b]==1:
            print('POSSIBLE')
            exit()
    if b==N:
        d2[a]=1
        if d1[a]==1:
            print('POSSIBLE')
            exit()
print('IMPOSSIBLE')

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

ans=''
for i in range(N):
    ans+=str(i+1)*a[i]

for j in range(H):
    s=ans[W*j:W*(j+1)]
    if j%2==0:
        print(' '.join(s))
    else:
        print(' '.join(s[::-1]))
Problem p04043 (python)

Fixed submission:
if sorted(list(map(int,input().split())))==[5,5,7]:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
if sotred(list(map(int,input().split())))==[5,5,7]:
  print('YES')
else:
  print('NO')
Problem p02576 (python)

Fixed submission:
n,x,t=map(int,input().split())
a=n//x

if x*a!=n:
  a=a+1

print(a*t)

Buggy submission (verdict: Runtime Error):
#ABC176
#D - Wizard in Maze

h,w=map(int,input().split())
ch,cw=map(int,input().split())
dh,dw=map(int,input().split())
b=[ch-1,cw-1]
a,c,d,f=[],[],[],[]
c.append(b)
d.append(b)
y=0

for i in range(h):
  a.append(list(input()))

warp=0

def def1():
  global c,d
  if 0<=ch1<h and 0<=cw1<w:
    e=[ch1,cw1]
    if a[ch1][cw1]=="." and d not in e:
      c.append(e)
      d.append(e)
def def2():
  global f
  if 0<=ch2<h and 0<=cw2<w:
    e=[ch2,cw2]
    if a[ch2][cw2]=="." and f not in e:
      f.append(e)

while len(c)>0 or len(f)>0 or y==0:
  while len(c)>0 or y==0:
    ch,cw=c[0]
    if ch==dh-1 and cw==dw-1:
        y=1
    if a[ch][cw]==".":
      a[ch][cw]=str(warp)
    c.pop(0)
    ch1,cw1=ch-1,cw
    def1()
    ch1,cw1=ch+1,cw
    def1()
    ch1,cw1=ch,cw-1
    def1()
    ch1,cw1=ch,cw+1
    def1()

    for i in range(5):
      ch2=ch-2+i
      for j in range(5):
        cw2=cw-2+j
        def2()
  for i in f:
    if i not in d:
      c.append(i)
  f=[]
  warp=warp+1
z=a[dh-1][dw-1]
if z==".":
  print(1)
else:
  print(z)
Problem p02553 (python)

Fixed submission:
a, b, c, d = map(int, input().split())
print(max(a * c, a * d, b * c, b * d))

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
if b * d >= 0:
  print(b * d)
else:
  z = []

  for x in range(a, b + 1):
    for y in range(c, d + 1):
      z.append(x * y)
print(max(z))
Problem p02717 (python)

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

Buggy submission (verdict: Runtime Error):
a, b, c = (int, input().split())
print(c, a, b)
Problem p02778 (python)

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

Buggy submission (verdict: Runtime Error):
print(x * len(input()))
Problem p02817 (python)

Fixed submission:
a, b = input().split()
print(b + a)

Buggy submission (verdict: Runtime Error):
a, b = map(input().split())
print(b + a)
Problem p03109 (python)

Fixed submission:
a = input()
if int(a[5]) == 1:
  print('TBD')
else:
  if int(a[6]) > 4:
    print('TBD')
  else:
    print('Heisei')

Buggy submission (verdict: Runtime Error):
a = input()
if a[6] > 4:
  print('TBD')
elif a[6] < 3:
  print('heisei')
else:
  if a[8] < 2:
    print('heisei')
  else:
    if a[9] > 0:
      print('heisei')
    else:
      print('TBD')
Problem p03206 (python)

Fixed submission:
a = int(input())
if a == 22:
  print('Christmas Eve Eve Eve')
elif a == 23:
  print('Christmas Eve Eve')
elif a == 24:
  print('Christmas Eve')
elif a == 25:
  print('Christmas')

Buggy submission (verdict: Runtime Error):
a = int(input())
if a == 22:
  print('Christmas Eve Eve Eve')
elif a == 23:
  print('Christmas Eve Eve')
elif a == 24:
  print('Christmas Eve')
else a == 25:
  print('Christmas')
Problem p03323 (python)

Fixed submission:
a, b = map(int, input().split())
if a <= 8 and b <= 8:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
a, b = map(int, inuput().split())
if a >= 8 and b => 8:
  print('Yay!')
else:
  print(':(')
Problem p03369 (python)

Fixed submission:
print(700 + int(input().count('o')) * 100)

Buggy submission (verdict: Runtime Error):
a = input()
print(700 + int(input()).count('o'))
Problem p03415 (python)

Fixed submission:
print(input()[0] + input()[1] + input()[2])

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
print(a[0] + b[1] + c[2])
Problem p03447 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
print((a - b) % c)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
print(x = a - b // c)
Problem p03469 (python)

Fixed submission:
a = input()
print('2018' + a[4:])

Buggy submission (verdict: Runtime Error):
a = input()
a[3] = '8'
print(a)

Buggy submission (verdict: Runtime Error):
a = input()
a[4] = '8'
print(a)
Problem p03485 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
import math
print(math.ceil(a + b / 2)
Problem p03493 (python)

Fixed submission:
print(input().count('1'))

Buggy submission (verdict: Runtime Error):
a = input()
print(a.count(1))
Problem p03547 (python)

Fixed submission:
a, b = input().split()
if a == b:
  print('=')
elif a > b:
  print('>')
else:
  print('<')

Buggy submission (verdict: Runtime Error):
a, b = input()
if a == b:
  print('=')
elif a > b:
  print('>')
else:
  print('<')
Problem p03597 (python)

Fixed submission:
a = int(input())
b = int(input())
print(a * a - b)

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

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

Buggy submission (verdict: Runtime Error):
a, b = map(int, input()split())
x = a * a
print(x - b)
Problem p03605 (python)

Fixed submission:
a = input()
if '9' in a:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a = input()
if 9 in a:
  print('Yes')
else:
  print('No')
Problem p03636 (python)

Fixed submission:
a = input()
print(a[0] + str(len(a) - 2) + a[-1])

Buggy submission (verdict: Runtime Error):
a = input()
print(s[0] + str(len(s) - 2) + s[-1])
Problem p03657 (python)

Fixed submission:
a, b = map(int, input().split())
if (a + b) % 3 == 0 or b % 3 == 0 or a % 3 == 0:
    print("Possible")
else:
    print("Impossible")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
x = a + b
if x % 3 == 0:
  print('Possible')
else('Impossidle')
Problem p03693 (python)

Fixed submission:
a, b, c = map(int, input().split())
x = str(a) + str(b) + str(c)
if int(x) % 4 == 0:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
a, b, c = map(input().split())
int(x) = a + b + c
if x % 4 == 0:
  print('YES')
else:
  print('NO')
Problem p03737 (python)

Fixed submission:
a, b, c = input().split()
print((a[0] + b[0] + c[0]).upper())

Buggy submission (verdict: Runtime Error):
a, b, c = input().split()
print((s1[0] + s2[0] + s3[0]).upper())
Problem p03826 (python)

Fixed submission:
a, b, c, d = map(int, input().split())
x = a * b
y = c * d
if x == y:
  print(x)
elif x > y:
  print(x)
elif y > x:
  print(y)

Buggy submission (verdict: Runtime Error):
a, b, c, d = int(input().split())
x = a * b
y = c * d
if x == y:
  print(x)
elif x > y:
  print(x)
elif y > x:
  print(y)
Problem p03844 (python)

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

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

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

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

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

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

Buggy submission (verdict: Runtime Error):
a = input()
print(int(input()))
Problem p04029 (python)

Fixed submission:
n = int(input())
print (n * (n + 1) // 2)

Buggy submission (verdict: Runtime Error):
n = input()
print(n * (n + 1) / 2)
Problem p02700 (python)

Fixed submission:
th, tMon, ah, aMon  = map(int, input().split())
turn = 1
#1 represent takashi monster turn
#0 represent aoki monster turn
while(1):
  if(turn):
    ah-=tMon
    if(ah<=0):
      print("Yes")
      break
  else:
    th-=aMon
    if(th<=0):
      print("No")
      break
  turn^=1

Buggy submission (verdict: Runtime Error):
th, ts, ah,as  = map(int, input().spilt())
turn = 1
#1 represent takashi monster turn
#0 represent aoki monster turn
while(1):
  if(turn):
    ah-=ts
    if(ah<=0):
      print("No")
      break
  else:
    th-=as
    if(th<=0):
      print("Yes")
      break
  turn^=1
Problem p03323 (python)

Fixed submission:
a,b = map(int, input().split())
if(a<9 and b<9):
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
if(a<9 && b<9):
  print("Yay!")
else:
  print(":(")
Problem p02639 (python)

Fixed submission:
a = list(map(int,input().split()))
print(a.index(0) + 1)

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
print(aa.index(0))
Problem p02724 (python)

Fixed submission:
a = int(input())
b = 0
while a >= 500:
  a-=500
  b+=1000
while a >= 5:
  a-=5
  b+=5
print(b)

Buggy submission (verdict: Runtime Error):
a = input()
b = 0
while a >= 500:
  a-=500
  b+=1000
while a >= 5:
  a-=5
  b+=5
print(b)
Problem p02783 (python)

Fixed submission:
a, b = map(int, input().split())
c = 0
while a > 0:
  a -= b
  c += 1
print(c)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = 0
while a > 0:
  a -= b
  c += 1
print(c
Problem p02789 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = input().split
if a == b:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a, b = input().split
if a == b:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a, b = input().split
if a > b:
  print("No")
else:
  print("Yes")
Problem p02811 (python)

Fixed submission:
a = list(map(int,input().split()))
 
if 500*a[0] >= a[1]:
  print("Yes")
else:
  print("No")

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

if 500*a >= b:
  print("Yes")
else:
  primt("No")
Problem p02817 (python)

Fixed submission:
a, b = input(). split()
c = (b + a)
print(c)

Buggy submission (verdict: Runtime Error):
a = str(input())
b = str(input())
c = (b + a)
print(c)

Buggy submission (verdict: Runtime Error):
a = str(input())
b = str(input())
print(a + b)

Buggy submission (verdict: Runtime Error):
print(str(input()) + str(input()))
Problem p02802 (python)

Fixed submission:
n, m = map(int, input().split())
ac = [0 for _ in range(n)]
pen = [0 for _ in range(n)]

for _ in range(m):
  p, s = input().split()
  p = int(p) - 1
  if s == 'WA':
    if ac[p] == 0:
      pen[p] += 1
  else:
    ac[p] = 1

for p in range(n):
  if ac[p] == 0:
    pen[p] = 0
print(str(sum(ac)) + ' ' + str(sum(pen)))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
ac = [0 for _ in range(n)]
pen = [0 for _ in range(n)]

for _ in range(m):
  p, s = input().split()
  p = int(p) - 1
  if s == 'WA':
    if ac[p] == 0:
      pen[p] += 1
  else:
    ac[p] = 1

for p in range(m):
  if ac[p] == 0:
    pen[p] = 0
print(str(sum(ac)) + ' ' + str(sum(pen)))
Problem p02817 (python)

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

Buggy submission (verdict: Runtime Error):
s = input()
print(s.replace(' ', '')
Problem p02946 (python)

Fixed submission:
k, x = map(int, input().split())
rng = range(x-k+1, x+k)
print(' '.join(map(str, rng)))

Buggy submission (verdict: Runtime Error):
k, x = map(int, input())
rng = range(x-k+1, x+k)
print(' '.join(map(str, rng)))
Problem p02971 (python)

Fixed submission:
n = int(input())
an = []
for _ in range(n):
  an.append(int(input()))
maxl = [an[0]]
maxr = [an[-1]]
for a in an[1:]:
  maxl.append(max(maxl[-1], a))
for a in an[:-1][::-1]:
  maxr.append(max(maxr[-1], a))
maxr = maxr[::-1]

print(maxr[1])
for i in range(1, n-1):
  print(max(maxl[i-1], maxr[i+1]))
print(maxl[n-2])

Buggy submission (verdict: Runtime Error):
n = int(input())
an = []
for _ in range(n):
  an.append(int(input()))
maxl = [an[0]]
maxr = [an[-1]]
for a in an[1:]:
  maxl.append(max(maxl[-1], a))
for a in an[1::-1]:
  maxr.insert(0, max(maxr[0], a))

print(maxr[1])
for i in range(1, n-1):
  print(max(maxl[i-1], maxr[i+1]))
print(maxl[n-2])

Buggy submission (verdict: Runtime Error):
n = int(input())
an = []
for _ in n:
  an.append(int(input()))
maxl = [an[0]]
maxr = [an[-1]]
for a in an[1:]:
  maxl.append(max(maxl[-1], a))
for a in an[:-2:-1]:
  maxr.insert(0, max(maxr[0], a))

print(maxr[1])
for i in range(1, n-1):
  print(max(maxl[i-1], maxr[i+1]))
print(maxl[n-2])
Problem p02981 (python)

Fixed submission:
n, a, b = map(int, input().split())
pa = n * a
print(min(pa, b))

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().spalit())
pa = n * a
print(min(pa, b))
Problem p03006 (python)

Fixed submission:
n = int(input())
if n == 1:
  print(1)
  exit()
xy = []
for _ in range(n):
  x, y = map(int, input().split())
  xy.append([x, y])

vecs = {}
for i in range(n):
  for j in range(i+1, n):
    if xy[i][0] < xy[j][0]:
      vec = (xy[j][0] - xy[i][0], xy[j][1] - xy[i][1])
    elif xy[i][0] > xy[j][0]:
      vec = (xy[i][0] - xy[j][0], xy[i][1] - xy[j][1])
    else:
      vec = (0, abs(xy[j][1] - xy[i][1]))
    
    if vec in vecs:
      vecs[vec] += 1
    else:
      vecs[vec] = 1

vec_max = max(list(vecs.values()))
print(n - vec_max)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n = 1:
  print(1)
  exit()
xy = []
for _ in range(n):
  x, y = map(int, input().split())
  xy.append([x, y])

vecs = {}
for i in range(n):
  for j in range(i+1, n):
    if xy[i][0] < xy[j][0]:
      vec = (xy[j][0] - xy[i][0], xy[j][1] - xy[i][1])
    elif xy[i][0] > xy[j][0]:
      vec = (xy[i][0] - xy[j][0], xy[i][1] - xy[j][1])
    else:
      vec = (0, abs(xy[j][1] - xy[i][1]))
    
    if vec in vecs:
      vecs[vec] += 1
    else:
      vecs[vec] = 1

vec_max = max(list(vecs.values()))
print(n - vec_max)

Buggy submission (verdict: Runtime Error):
n = int(input())
xy = []
for _ in range(n):
  x, y = map(int, input().split())
  xy.append([x, y])

vecs = {}
for i in range(n):
  for j in range(i+1, n):
    if xy[i][0] < xy[j][0]:
      vec = (xy[j][0] - xy[i][0], xy[j][1] - xy[i][1])
    elif xy[i][0] > xy[j][0]:
      vec = (xy[i][0] - xy[j][0], xy[i][1] - xy[j][1])
    else:
      vec = (0, abs(xy[j][1] - xy[i][1]))
    
    if vec in vecs:
      vecs[vec] += 1
    else:
      vecs[vec] = 1

vec_max = max(list(vecs.values()))
print(n - vec_max)
Problem p03037 (python)

Fixed submission:
n,m = map(int, input().split())
lmax,rmin=0,n+1
for i in range(m):
  l,r=map(int, input().split())
  lmax=max(l,lmax)
  rmin=min(r,rmin)
print(max(0,rmin-lmax+1))

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
lmax,rmin=0,n+1
for i in range(m):
  l,r=map(int, input().split()
  lmax=max(l,lmax)
  rmin=min(r,rmin)
print(max(0,lmax-rmin+1))

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
lmax,rmin=0,n+1
for i in range(m):
  l,r=map(int, input().split()
  lmax=max(l,lmax)
  rmin=min(r,rmin)
print(max(0,lmax-rmin+1)
Problem p03059 (python)

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

print(b * (t // a))

Buggy submission (verdict: Runtime Error):
a, b, t = map(int, input().split())
return (t % a) * b
Problem p03061 (python)

Fixed submission:
from fractions import gcd

n = int(input())
a = list(map(int, input().split()))

l = [a[0]]
r = [a[-1]]
for i in range(n-1):
  l.append(gcd(l[-1], a[i+1]))
  r.append(gcd(r[-1], a[-2-i]))
r = r[::-1]

maxi = max(l[-2], r[1])
for i in range(1, n-1):
  maxi = max(maxi, gcd(l[i-1], r[i+1]))
print(maxi)

Buggy submission (verdict: Runtime Error):
n = int(input())
an = list(map(int, input().split(' ')))
an = list(set(an))
if len(an) == 1:
  print(an[0])
  exit()
  
from fractions import gcd
from functools import reduce
import copy

max_g = 1
g0 = reduce(gcd, an)
for i in range(n):
  bn = copy.copy(an)
  bn.pop(i)
  g = reduce(gcd, bn)
  max_g = max(g, max_g)
print(max_g)
Problem p03146 (python)

Fixed submission:
def col(a):
  if a % 2 == 0:
    return a//2
  else:
    return a*3 + 1

s = int(input())

an = [s]
i = 1
while True:
  i += 1
  an_1 = col(an[-1])
  if an_1 in an:
    break
  else:
    an.append(an_1)

print(i)

Buggy submission (verdict: Runtime Error):
def col(a):
  if a % 2 == 0:
    return a//2
  else:
    return a*3 + 1

s = int(input())

an = [a]
i = 1
while True:
  i += 1
  an_1 = col(an[-1])
  if an_1 in an:
    break
  an.append(an_1)

print(i)

Buggy submission (verdict: Runtime Error):
def col(a):
  if a % 2 == 0:
    return a//2
  else:
    return a*3 + 1

s = int(input())

an = [a]
i = 1
while True:
  i += 1
  an_1 = col(a)
  if an_1 in an:
    break
  an.append(an_1)

print(i)
Problem p03149 (python)

Fixed submission:
n = list(map(int, input().split()))
if 1 in n:
  if 4 in n:
    if 7 in n:
      if 9 in n:
        print('YES')
        exit()
print('NO')

Buggy submission (verdict: Runtime Error):
n = list(map(int, input().split()))
if 1 in n:
  if 4 in n:
    if 7 in n:
      if 9 in n:
        print(‘YES’)
        exit()
print(‘NO’)

Buggy submission (verdict: Runtime Error):
n = map(int, input().split())
if 1 in n:
  if 4 in n:
    if 7 in n:
      if 9 in n:
        print(‘YES’)
        exit()
print(‘NO’)
Problem p03308 (python)

Fixed submission:
n = int(input())
an = list(map(int, input().split()))
print(max(an) - min(an))

Buggy submission (verdict: Runtime Error):
n = int(input().split())
an = list(map(int, input().split()))
print(max(an) - min(an))
Problem p02639 (python)

Fixed submission:
A, B, C, D, E = map(int, input().split())
if A == 0:
    print(1)
elif B == 0:
    print(2)
elif C == 0:
    print(3)
elif D == 0:
    print(4)
elif E == 0:
    print(5)

Buggy submission (verdict: Runtime Error):
A, B, C, D, E = map(int, input().split())
if A == 0:
    print(1)
elif B == 0:
    print(2)
elif C == 0:
    print(3)
elif D == 0:
    print(4)
else E == 0:
    print(5)
Problem p02741 (python)

Fixed submission:
# coding: utf-8

a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
b = int(input()) - 1

print(a[b])

Buggy submission (verdict: Runtime Error):
# coding: utf-8

h, w = map(int, input().split())

m = (h * w)

if m % 2 == 0:
    print(int(m / 2))
else:
    print(int(m / 2) + 1)
Problem p03309 (python)

Fixed submission:
import numpy as np

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

for i in range(N):
    an[i] = an[i] - (i+1)
    
b = int(np.median(an))

k = []
for i in range(N):
    y = abs(an[i] - b)
    k.append(y)
ans = sum(k)

print(ans)

Buggy submission (verdict: Runtime Error):
from statistics import median

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

for i in range(N):
    an[i] = an[i] - (i+1)
    
b = int(median(bn))

k = []
for i in range(N):
    y = abs(an[i] - b)
    k.append(y)
ans = sum(k)

print(ans)