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

Fixed submission:
people,point,quiz = map(int,input().split())
an = [int(input()) for _ in range(quiz)]
each_p = [point-quiz] * people

for x in an:
    each_p[x-1] += 1

for y in each_p:
    if y <= 0:
        print("No")
    else:
        print("Yes")

Buggy submission (verdict: Runtime Error):
eople,point,quiz = map(int,input().split())
an = [int(input()) for _ in range(quiz)]
each_p = [point-quiz] * people

for x in an:
    each_p[x-1] += 1

for y in each_p:
    if y <= 0:
        print("No")
    else:
        print("Yes")
Problem p02917 (python)

Fixed submission:
#nは数列Aの長さ　Bの長さはn-1
n = int(input())
bn = list(map(int,input().split()))

an =[bn[0]]


for x in range(n-2):
    if bn[x+1] >= bn[x] :
        an.append(bn[x])
    else:
        an.append(bn[x+1])

an.append(bn[-1])

print(sum(an))

Buggy submission (verdict: Runtime Error):
n = int(input())
b = [int(i) for i in input().split()]

a =[b[0]]

for x in range(n-1):
  s = min(b[x],b[x+1])
  a.append(s)
  
a.append(b[-1])

print(sum(a))
Problem p02946 (python)

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

min_ans = x-k+1
max_ans = x+k-1

for x in range(min_ans,max_ans+1):
  print(x, end=" ")

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

min_ans = x-k+1
max_ans = x+K-1

for x in range(min_ans,max_ans+1):
  print(x, end=" ")
Problem p02947 (python)

Fixed submission:
import itertools,math
n = int(input())
word = [input() for _ in range(n)]
count = 0

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(n):
    word[i] = sorted(word[i])

new_word = list(sorted(word))

x = 1

for i in range(n-1):
    if new_word[i] == new_word[i+1]:
        x += 1
    elif x >= 2:
        count += combinations_count(x,2)
        x = 1
if x >= 2:
    count +=  combinations_count(x,2)

print(count)

Buggy submission (verdict: Runtime Error):
#他の人の回答
import collections

N = int(input())
s = ["".join(sorted(input())) for _ in range(N)]　#sortedでリストになった文字列をjoinでもう一度文字列に
c = collections.Counter(s)　　#cは辞書の形をとる
ans = 0
for si in set(s):　# sから重複を無くす
    n = c[si]
    ans += n * (n - 1) // 2   # n C 2を計算
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools,math
n = int(input())
word = [input() for _ in range(n)]
count = 0

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(n):
    word[i] = sorted(word[i])

new_word = list(sorted(word))

x = 1

for i in range(n-1):
    if new_word[i] == new_word[i+1]:
        x += 1
    else:
        count += combinations_count(x,2)
        x = 1
if x >= 2:
    count +=  combinations_count(x,2)
    
print(count)
Problem p02983 (python)

Fixed submission:
l,r = map(int,input().split())
mod = 2019
a = l%mod
b = r%mod

if r-l >= 2018:
    print(0)

else:
    if a > b:
        print(0)
    else:
        t = (a*(a+1))%mod
        for x in range(a,b):
            for y in range(x+1,b+1):
                if (x*y)%mod < t:
                    t = (x*y)%mod
        print(t)

Buggy submission (verdict: Runtime Error):
l.r = map(int,input().split())

mod = 2019
a = l%2019
b = l%2019

if r-l >= 2018:
  print(0)

else:
  if a < b:
    print(a*a+1)
  else:
    print(0)
Problem p03000 (python)

Fixed submission:
# nは跳ねる回数　d1 = 1 dn+1 = dn + ln

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

d = 0
count = 1

for y in range(n):
  d = d + l[y]
  if d <= x:
    count += 1
  else:
    break
    
print(count)

Buggy submission (verdict: Runtime Error):
# nは跳ねる回数　d1 = 1 dn+1 = dn + ln

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

d = 1
count = 1

for y in range(n):
  d = d + l[n]
  if d <= x:
    count += 1
  else:
    break
    
print(count)
Problem p02548 (python)

Fixed submission:
n=int(input())
ans=0
for i in range(1,n):
  ans+=(n-1)//i
print(ans)

Buggy submission (verdict: Runtime Error):
import sympy

n=int(input())
abc=n
ans=0
for c in range(1,n):
  ab=abc-c
  ans+=len(sympy.divisors(ab))

print(ans)
Problem p02553 (python)

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

q=a*c
w=a*d
e=b*c
r=b*d

ans=max(q,w,e,r)
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
ans=-999999999999999999
for i in range(a,b+1):
  for j in range(c,d+1):
    ans=max(ans,i*j)

print(ans
Problem p02583 (python)

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

ans=0
for i in range(n):
  for j in range(n):
    for k in range(n):
      if i <= j <= k:
        if l[i]==l[j] or  l[j]==l[k] or l[i]==l[k]:
          continue
        if max(l[i],l[j],l[k]) < l[i] +l[j] + l[k] - max(l[i],l[j],l[k]):
          ans+=1
print(ans)

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

ans=0
for i in range(n):
  for j in range(n):
    for k in range(n):
      if i <= j <= k:
        if l[i]==l[j] or  l[j]==l[k] or l[i]==l[k]:
          continue
        if max(l[i],l[j],l[k]) < sum(sum(l[i],l[j]),l[k]) - max(l[i],l[j],l[k]):
          ans+=1
print(ans)

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

ans=0
for i in range(n):
  for j in range(n):
    for k in range(n):
      if i <= j <= k:
        if l[i]==l[j] or  l[j]==l[k] or l[i]==l[k]:
          continue
        if max(l[i],l[j],l[k]) < sum(l[i],l[j],l[k]) - max(l[i],l[j],l[k]):
          ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools

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

ijk=[x for x in range(n)]

ijkl=list(itertools.permutations(ijk,3))

a=[]
for ii in ijkl:
  if ii[0]<ii[1]<ii[2]:
    a.append(ii)

ans=0

for aa in a:
  list_=[]
  if l[aa[0]] != l[aa[1]] != l[aa[2]]:
    list_.append(l[aa[0]])
    list_.append(l[aa[1]])
    list_.append(l[aa[2]])

    max_=max(l[aa[0]],l[aa[1]],l[aa[2]])
    sum_=sum(list_)
    if max_ < (sum_-max_):
      ans+=1i

print(ans)
Problem p02584 (python)

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

x=abs(x)
ans=0
if x>=d*k:
  ans=x-k*d
else:
  e= int(x/d)
  k-=e
  x-=e*d
  if k%2==1:
    x=abs(x-d)
  ans=x

print(ans)

Buggy submission (verdict: Runtime Error):
x,k,d=map(int,input().split())
c=0
for i in range(k):
  while x>0 and i<k:
    x-=d
    i+=1
  while x<0 and i<l:
    x+=d
    i+=1
print(abs(x))

Buggy submission (verdict: Runtime Error):
x,k,d=map(int,input().split())
c=0
for i in range(k):
  while x>0 and i<k:
    x-=d
    i+=1
  while x<0i and i<k:
    x+=d
    i+=1
print(abs(x))

Buggy submission (verdict: Runtime Error):
x,k,d=map(int,input().split())
c=0
for i in range(k):
  while x>0 and i<k:
    x-=d
    i+=1
  while x<0i and i<l:
    x+=d
    i+=1
print(abs(x))

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

for i in range(k):
  if abs(x-d)<abs(x+d):
    x-=di
  else:
    x+=d
print(abs(x))

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

for i in range(k):
  if abs(x-d)<abs(x+d):
    x-=di
  else:
    x+=d
print(abs(x))
Problem p02600 (python)

Fixed submission:
x=int(input())
     
if 400 <= x <= 599:
  print(8)
elif 600 <= x <= 799:
  print(7)
elif 800 <= x <= 999:
  print(6)
elif 1000 <= x <= 1199:
  print(5)
elif 1200 <= x <= 1399:
  print(4)
elif 1400 <= x <= 1599:
  print(3)
elif 1600 <= x <= 1799:
  print(2)
elif 1800 <= x <= 1999:
  print(1)

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

if 400 <= x <= 599:
  print(8)
elif 600 <= x <= 799:
  print(7)
elif 800 <= x <= 999:
  print(6)
elif 1000 <= x <= 1199:
  print(5)
elif 1200 <= x <= 1399:
  print(4)
elif 1400 <= x <= 1599:
  print(3)
elif 1600 <= x <= 1799:
  print(2)
elif 1800 <= x <= 1999:
  print(1)
Problem p02606 (python)

Fixed submission:
l, r, d = map(int, input().split())
count = 0
for i in range (l, r+1):
  if i % d == 0:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
l, r, d = map(int, input().split())
count = 0
for i int range (l, r+1):
  if i % d == 0:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
l, r, d = map(int, input().split())
count = 0
for i int range (l, r+1):
  if i % 2 == 0:
    count += 1
print(count)
Problem p02613 (python)

Fixed submission:
n=int(input())
S = []
for _ in range(n):
    S.append(input())
print("AC x", S.count("AC"))
print("WA x", S.count("WA"))
print("TLE x", S.count("TLE"))
print("RE x", S.count("RE"))

Buggy submission (verdict: Runtime Error):
n=int(input())
x= list()
for i in range n:
  x.append(input())
print("AC x", x.count("AC"))
print("WA x", x.count("WA"))
print("TLE x", x.count("TLE"))
print("RE x", x.count("RE"))
Problem p02621 (python)

Fixed submission:
num = int(input())
num2 = num + num*num+num*num*num
print(num2)

Buggy submission (verdict: Runtime Error):
a=input()
x=a+a*a+a*a*a
print(a)

Buggy submission (verdict: Runtime Error):
a=input()
print(a+a*a+a*a*a)
Problem p02628 (python)

Fixed submission:
n,k=map(int,input().split())
p=list(map(int,input().split()))
p.sort()
_sum=0
for i in range(k):
    _sum += p[i]
print(_sum)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
p=list(map(int,input().split()))
p.sort()
_sum=0
for i in range(k):
  _sum += p[k]
print(_sum)
Problem p02675 (python)

Fixed submission:
n=input()
a=int(n[-1])
if a==2 or a==4 or a==5 or a ==7 or a==9:
  print('hon')
elif a==0 or a==1 or a==6 or a==8:
  print('pon')
else:
  print('bon')

Buggy submission (verdict: Runtime Error):
n=input()
a=int(n[-1])
if a==2 or a==4 or a==5 or a ==7 or a==9:
  print('hon')
elif a==0 or a==1 or a==6 a==8:
  print('pon')
else:
  print('bon')
Problem p02718 (python)

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
     
limit=sum(a)/(4*m)
c=0
for aa in a:
  if aa >=limit:
    c+=1
  else:
    pass
if c>=m:
  print('Yes')
else:
  print('No')

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

limit=sum(a)/(4*m)
c=0
for aa in a:
  if a >=limit:
    c+=1
  else:
    pass
if c==0:
  print('No')
else:
  print('Yes')
Problem p02767 (python)

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

min_=min(x)
max_=max(x)
ans=list()
for xy in range(min_, max_+1):
  life=0
  for xx in x:
    life+=(xx-xy)**2
  ans.append(life)
print(min(ans))

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

mean_=sum(x)//len(x)

for i in range(n):
  ans+=(x[i]-mean_)**2
print(ans)
Problem p02801 (python)

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

Buggy submission (verdict: Runtime Error):
s=input()
print (chr(ord(s) + 1)
Problem p02861 (python)

Fixed submission:
n=int(input())
l=[]

for i in range(n):
  x,y=map(int,input().split())
  l.append([x,y])

import itertools

seq=[i for i in range(n)]
p=list(itertools.permutations(seq))
import math

ans=0
for pp in p:
  for i in range(n-1):
    xy=math.sqrt((l[pp[i]][0]-l[pp[i+1]][0])**2 + (l[pp[i]][1]-l[pp[i+1]][1])**2)
    ans+=xy

print(ans/len(p))

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

for i in range(n):
  x,y=map(int,input().split())
  l.append([x,y])

import itertools

seq=[i for i in range(n)]
p=list(itertools.permutations(seq))
import mathi

ans=0
for pp in p:
  for i in range(n-1):
    xy=math.sqrt((l[pp[i]][0]+l[pp[i+1]][0])**2 + (l[pp[i]][1]+l[pp[i+1]][1])**2)
    ans+=xy

print(ans/len(p))
Problem p02898 (python)

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

ans=0

for hh in h:
  if hh>=k:
    ans+=1
print(ans)

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

ans=0

for hh in h:
  if hh>=k:
    ans+=1
print(ans)

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

ans=0

for hh in h:
  if hh>=k:
    ans+=1
print(ans)

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

ans=0

for hh in h:
  if hh>=k:
    ans+=1
print(ans)
Problem p02899 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=[x for x in range(n)]
for i in range(n):
  ans[(a[i] - 1)] = i + 1
for aaa in ans:
  print(aaa)

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

n=int(input())
a=list(map(int,input().split()))
ans=[]
for i in range(1,n+1):
  ans.append(a.index(i)+1)

print(ans)

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

a=sorted(a3)
for ia in a:
  print(c.index(ia)+1, end='')
Problem p02934 (python)

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

ll=[1/x for x in l]

print(1/sum(ll))

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[]
for i in range(n):
  a=int(input())
  l.append(1/a)

print(1/sum(l))

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[]
for i in range(n):
  a=int(input())
  l.append(1/a)

print(sum(l))
Problem p02646 (python)

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

if V <= W:
    print("NO")
    exit()



diff = max(A, B) - min(A, B)

speed = V - W

if diff / speed <= T:
    print("YES")
else:
    print("NO")

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

if A <= B:
    print("NO")
    exit()



diff = max(A, B) - min(A, B)

speed = V - W

if diff / speed <= T:
    print("YES")
else:
    print("NO")
Problem p02922 (python)

Fixed submission:
from math import ceil
A, B = map(int, input().split())
if B == 1:
    print(0)
else:
    print(int(ceil((B-1)/(A-1))))

Buggy submission (verdict: Runtime Error):
from math import ceil
A, B = map(int, input())
print(ceil(B/A))
Problem p02945 (python)

Fixed submission:
A, B = map(int, input().split())
print(max(A+B, max(A-B, A*B)))

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
return max(A+B, max(A-B, A*B))
Problem p02946 (python)

Fixed submission:
K, X = map(int, input().strip().split())
print(' '.join([str(i) for i in range(X-K+1, X+K)]))

Buggy submission (verdict: Runtime Error):
K, X = input().split()
K, X = int(K), int(X)
print(' '.join([i for i in range(X-K+1, X+K)]))

Buggy submission (verdict: Runtime Error):
K, X = map(int, input().split())
print(' '.join([i for i in range(X-K+1, X+K)]))
Problem p03035 (python)

Fixed submission:
A, B = map(int, input().strip().split())
if A >= 13:
    print(B)
elif 6 <= A <= 12:
    print(B // 2)
else:
    print(0)

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

N, M = map(int, input().strip().split())
A = list(map(int, input().strip().split()))
for i in range(M):
    B, num = map(int, input().strip().split())
    for j in range(B):
        A[A.index(min(map(lambda x: x - num, nums))+num)] = max(num,x)
print(sum(A))

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().strip().split())
if A >= 13:
  return B
elif 6 <= A <= 12:
  return B // 2
else:
  return 0
Problem p03471 (python)

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

if not boolean:
    print(-1, -1, -1)

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

if boolean:
    print(i, j, N - i - j)
else:
    print(-1, -1, -1)

Buggy submission (verdict: Runtime Error):
N, Y = map(int, input().aplit())
boolean = False
for i in range(N+1):
    for j in range(N+1-i):
        if (Y - 10000 * i + 5000 * j) // 1000 == (N - i - j):
            boolean = True

if boolean:
    print(i, j, N - i - j)
else:
    print(-1, -1, -1)

Buggy submission (verdict: Runtime Error):
N, Y = map(int, input().aplit())
boolean = False
for i in range(N+1):
    for j in range(N+1-i):
        if (Y - 10000 * i + 5000 * j) % 1000 == N:
            boolean = True

if boolean:
    print(i, j, N - i - j)
else:
    print(-1, -1, -1)
Problem p04001 (python)

Fixed submission:
from functools import reduce
S = input()

def dfs(res, depth, path, S):
    if len(''.join(path)) == len(S):
        res.append(path)
    for i in range(depth + 1, len(S) + 1):
        dfs(res, i, path + [S[depth:i]], S)

res = []

dfs(res, 0, [], S)

print(sum(int(num) for nums in res for num in nums))

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

def dfs(res, depth, path, S):
    res.append(path)
    if depth == len(S) - 1:
        return
    for i in range(depth + 1, len(S)):
        dfs(res, i, int(S[depth:i+1]), S)

res = []

dfs(res, -1, [], S)
print(sum(res))
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())
if n%1000==0:
  print(0)
elif:
  print(1000-n%1000)
Problem p02613 (python)

Fixed submission:
n = int(input())
ac=0
wa=0
tle=0
re=0
for i in range(n):
  x = input()
  if x =='AC':
    ac+=1
  if x =='WA':
    wa+=1
  if x =='TLE':
    tle+=1
  if x =='RE':
    re+=1
    
print('AC x {}'.format(ac))
print('WA x {}'.format(wa))
print('TLE x {}'.format(tle))
print('RE x {}'.format(re))

Buggy submission (verdict: Runtime Error):
n = int(input())
ac=0
wa=0
tle=0
re=0
for i range(n):
  x = input()
  if x =='AC':
    ac+=1
  if x =='WA':
    wa+=1
  if x =='TLE':
    tle+=1
  if x =='RE':
    re+=1
    
print('AC x {}'.format(ac))
print('WA x {}'.format(wa))
print('TLE x {}'.format(tle))
print('RE x {}'.format(re))
Problem p02641 (python)

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

for i in range(100):
    if not((x - i) in p):
        print (x - i)
        exit ()
    elif not((x + i) in p):
        print (x + i)
        exit()

Buggy submission (verdict: Runtime Error):
def py():
  x, n = map(int, input().split())
  p = list(map(int, input().split()))
  if p == []:
    print(x)
    return
  list0=[]
  for i in range(1,101):
    list0.append(i)
  for j in p:
    list0.remove(j)
  list1=[]
  for i in list0:
    list1.append(abs(x-i))
  if x-min(list1) in list0:
    print(x-min(list1))
  else:
    print(x+min(list1))
    
py()
Problem p02658 (python)

Fixed submission:
def pyn():
  n = int(input())
  a = list(map(int, input().split()))
  if 0 in a:
    print(0)
    return
    
  ans=1
  for i in a:
    ans *= i
    if ans>10**18:
      print(-1)
      return
  print(ans)

pyn()

Buggy submission (verdict: Runtime Error):
def pyn():
	n = int(input())
	a = list(map(int, input().split()))
    if 0 in a:
      print(0)
      return
    
	ans=1
	for i in a:
 	 	ans *= i
		if ans>10**18:
  			print(-1)
            return
	print(ans)
Problem p02767 (python)

Fixed submission:
n= int(input())
x= list(map(int,input().split()))
m= sum(x)/len(x)
g= int(m)
ans=0
if m-g<g+1-m:
  ans=g
else:
  ans=g+1
aaa=0
for i in x:
  aaa+= (ans-i)**2
print(aaa)

Buggy submission (verdict: Runtime Error):
n= int(input())
x= list(map(int,input().split()))
m= mean(x)
g= int(m)
if m-g<g+1-m:
  print(g)
else:
  print(g+1)
Problem p03289 (python)

Fixed submission:
s = input()
flag = False

if s[0]=="A":
	if s[2:-1].count("C")==1:
		if (s[1:s.index("C")].islower() and s[s.index("C")+1:].islower()):
			flag = True
print("AC" if flag else "WA")

Buggy submission (verdict: Runtime Error):
S= input()
count=0
if S[0]!='A':
  print('WA')
  return
S.lower(0)
for i in range(3,len(S)-1):
  if S[i]=='C':
    count+=1
    S.lower(i)
if count==1 && S.islower():
  print('AC')
Problem p02642 (python)

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

dp = [True]*(A[-1]+1)

ans = 0

for i in range(len(A)):
    if dp[A[i]]:
        if (i == len(A)-1) or (A[i] != A[i+1]):
            ans += 1
    try:
        k = 1
        while(True):
            dp[k*A[i]] = False
            k += 1
    except:
        pass

print(ans)

Buggy submission (verdict: Runtime Error):
from sympy import sieve

N = int(input())
A = sorted(list(set(map(int, input().split()))))

ans = 0

if len(A) > 2:
    for i in range(len(A)):
        if A[i] in sieve:
            ans += 1
            continue
        for j in range(i+1):
            if A[i] % A[j] == 0:
                if j != i:
                    break
        else:
            ans += 1

print(ans)

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

ans = 0

if len(A) > 2:
    for i in range(N):
        for j in range(i):
            if j == i:
                continue
            if A[i] % A[j] == 0:
                break
        else:
            ans += 1

print(ans)
Problem p02608 (python)

Fixed submission:
from collections import deque
from copy import copy

N = int(input())
result = [0]*N

if N < 6:
    for i in range(N):
        print(0)
    exit()

result[5] += 1

coord = deque()
coord.append([[1, 1, 1], 6, 0])

while len(coord):
    sol, ans, level = coord.popleft()
    for i in range(level, 3):
        new_sol = copy(sol)
        new_sol[i] += 1
        new_ans = ans + sum(sol) + sol[i] + 1
        if new_ans <= N:
            coord.append([new_sol, new_ans, i])
            result[new_ans-1] += 1

print(*result, sep='\n', end='')

Buggy submission (verdict: Runtime Error):
from collections import deque
from copy import copy

N = int(input())
result = [0]*N

if N < 6:
    for i in range(N):
        print(0)
    exit()

result[5] += 1

coord = deque()
coord.append([[1,1,1], 6, 0])

while len(coord):
    sol, ans, level = coord.popleft()
    for i in range(level, 3):
        new_sol = copy(sol)
        new_sol[i] += 1
        new_ans = ans + sum(sol) + sol[i] + 1
        if new_ans <= N:
            coord.append([new_sol, new_ans, i])
            result[new_ans] += 1

print(*result, sep='\n', end='')
Problem p03494 (python)

Fixed submission:
from itertools import takewhile

data_num = int(input())
data_list = [bin(int(num)) for num in input().split(' ')]

results = [takewhile(lambda x: x == '0', data[::-1]) for data in data_list]

print(min([len(list(result)) for result in results]))

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

data_num = int(input())
data_list = [bin(int(num)) for num in input().split(' ')]

combine_data = reduce(lambda x, y: x or y, data_list)

results = takewhile(lambda x: x == '0', combine_data[::-1])

print(len(results))
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(in,input().split())
print(a*b)
Problem p02743 (python)

Fixed submission:
a, b, c = map(int, input().split())
print('Yes' if 4 * a * b < (c - a - b) * (c - a - b)
      and c - a - b > 0 else 'No')

Buggy submission (verdict: Runtime Error):
#include <cmath>
#include <iostream>
using namespace std;
typedef long long ll;

int main() {
    ll a, b, c;
    cin >> a >> b >> c;
    if (sqrt(a) + sqrt(b) + 1e-11 < sqrt(c)) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}
Problem p02797 (python)

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

M = 1000000000
_S = M - 1 if S == M else M
print(' '.join(list(map(str, [S] * K + [_S] * (N - K)))))

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

M = 1_000_000_000
_S = M - 1 if S == M else M
print(' '.join(list(map(str, [S] * K + [_S] * (N - K)))))