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

Fixed submission:
from collections import Counter

n = int(input())
l = list(input())
l = list(Counter(l).values())

ans = 1

for i in l:
    ans *= i+1
print((ans-1)%(10**9+7))

Buggy submission (verdict: Runtime Error):
import itertools
from collections import Counter
import numpy as np

n = int(input())
l = list(input())
l = list(Counter(l).values())

ans = n

for i in range(2, len(l)+1):
    conbis = list(itertools.combinations(l, i))
    for conbi in conbis:
        ans += np.prod(conbi)

print(ans%(10**9 + 7))
Problem p03160 (python)

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

ans = [0, abs(l[0]-l[1])]
for i in range(2, n):
  ans.append(min(abs(l[i]-l[i-1])+ans[i-1], abs(l[i]-l[i-2])+ans[i-2]))

print(ans[n-1])

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

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

dp = np.zeros(n, dtype = int)
for i in range(1, n):
  start_index = max(i-k, 0)
  dp[i] = np.min(dp[start_index:i]+np.abs(l[start_index:i]-l[i]))

print(dp[-1])
Problem p02789 (python)

Fixed submission:
arg=input().split()
N=int(arg[0])
M=int(arg[1])
if N==M:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
args=input().split()
if args[0]==args[1]:
  print("Yes")
else:
  pint("No")
Problem p03260 (python)

Fixed submission:
a,b = map(int,input().split())
if (a*b)%2 == 0:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
a,s,c=int(input());print(["No","Yes"][a*c%2])
Problem p03264 (python)

Fixed submission:
import math

k = int(input())

if k%2:
    print(math.floor(k/2)*math.ceil(k/2))
else:
    print(int((k/2)**2))

Buggy submission (verdict: Runtime Error):
import math

k = int(input())

if k%2:
    print(math.floor(k/2)*math.cei(k/2))
else:
    print((k/2)*2)
Problem p03281 (python)

Fixed submission:
divisors_8 = [105]

for i in range(107, 200, 2):
    divisors = []
    for j in range(1, 201):
        if i%j == 0:
            divisors.append(j)
    if len(divisors) == 8:
        divisors_8.append(i)

n = int(input())

divisors_8.append(n)
divisors_8.sort()
result = divisors_8.index(n)
divisors_8.remove(n)

if n not in divisors_8:
    print(result)
else:
    print(result+1)

Buggy submission (verdict: Runtime Error):

for i in range(107, 200, 2):
    divisors = []
    for j in range(1, 201):
        if i%j == 0:
            divisors.append(j)
    if len(divisors) == 8:
        divisors_8.append(i)

n = int(input())

divisors_8.append(n)
divisors_8.sort()
result = divisors_8.index(n)

if n not in divisors_8:
    print(result)
else:
    print(result+1)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if (a*b)%2 == 0:
    print("No")
else:
    print("Yes")
Problem p04001 (python)

Fixed submission:
s = list(input())
total = []
n = len(s)

def search(i,s):
	if i == n-1:
		li = []
		s = "".join(s)
		li = list(map(int,s.split("+")))
		total.append(sum(li))
		return

	else:
		search(i+1,s)

		_s = s[:-(n-i)+1] + ["+"] + s[-(n-i)+1:]
		search(i+1,_s)

search(0,s)
print(sum(total))

Buggy submission (verdict: Runtime Error):
def search(i,s):
	if i == n-1:
		li = []
		s = "".join(s)
		li = list(map(int,s.split("+")))
		total.append(sum(li))
		return

	else:
		search(i+1,s)

		_s = s[:-(n-i)+1] + ["+"] + s[-(n-i)+1:]
		search(i+1,_s)

search(0,s)
print(sum(total))
Problem p02600 (python)

Fixed submission:
X = int(input())
b = 400
cnt = 8
 
a = (X - b) // 200
for i in range(1,9):
    a = (X - b) // 200
    if  0 <= a < 1:
        print(cnt)
        break
    else:
        cnt -= 1
        b += 200

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

cnt = 1

a = X - 400 / 200
for i in range(.7):
    if  7 <= a < 8:
        print(cnt)
    else:
        cnt += 1
Problem p02612 (python)

Fixed submission:
N = int(input())
a = 1000 - N
while a < 0:
	a += 1000
print(a)

Buggy submission (verdict: Runtime Error):
N = int(input())
cnt = 1000

while true:
  if cnt > N:
    print(N - cnt)
  else:
    cnt += 1000
break
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
A. B = map(int,input().split())
print(A * B)
Problem p02675 (python)

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

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

a = len(S)


if a <= K:
    print(S)
else:
    print(S[:K] + ("..."))

Buggy submission (verdict: Runtime Error):
s = str(input())
s[-1] = z
if z = 2 or 4 or 5 or 7 or 9;
	print("hon")
elif z = 0 or 1 or 6 or 8;
    print("pon")
else;
	print("bon")
Problem p02783 (python)

Fixed submission:
import math

H, A = map(int, input().split())

print(math.ceil(H/A))

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

print(H_list)
Problem p02789 (python)

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

if M==N:
  print('Yes')
else:
  print('No')

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

import numpy as np
P = np.array(P)

answer = 0
for i in range(N):
  if P[i]==min(P[:i+1]):
    answer += 1
    
print(answer)
Problem p02687 (python)

Fixed submission:
str = input()
if str == 'ABC':
  print(str.replace('B','R'))
else:
  print(str.replace('R','B'))

Buggy submission (verdict: Runtime Error):
str = input()
if str = 'ABC':
  print(str.replace('B','R'))
else:
  print(str.replace('B','R'))

Buggy submission (verdict: Runtime Error):
str = input()
if str = 'ARC':
  print(str.replace('B','R'))
else:
  print(str.replace('B','R'))
Problem p02645 (python)

Fixed submission:
a = input()
print(a[:3])

Buggy submission (verdict: Runtime Error):
a = input()
print(a[3])
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
A, B = int(input())
print(A * B )
Problem p02741 (python)

Fixed submission:
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]
n = int(input())
print(a[n-1])

Buggy submission (verdict: Runtime Error):
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]
n = int(input())
print(a[n])

Buggy submission (verdict: Runtime Error):
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]
print(a[n])

Buggy submission (verdict: Runtime Error):
a = [
  1,2,3,4,5,4,32,1,2,3,
  4,5,7,5,43,3,2,2,7,8,
  9,8,6,54,6,5,3,3,5,6,
  2,5]
K = a[n-1]
print(K)

Buggy submission (verdict: Runtime Error):
a = [
  1,2,3,4,5,4,32,1,2,3,
  4,5,7,5,43,3,2,2,7,8,
  9,8,6,54,6,5,3,3,5,6,
  2,5]
K = a[k-1]
print(K)
Problem p03795 (python)

Fixed submission:
N = int(input())
n = N // 15
x = 800 * N
y = 200 * n

print(x-y)

Buggy submission (verdict: Runtime Error):
N = map(int, input())
n = N // 15
x = 800 * N
y = 200 * n

print(x-y)
Problem p02995 (python)

Fixed submission:
def gcd(x, y):
    if y == 0:
        return x
    if x < y:
        return gcd(y, x)
    return gcd(y, x%y)

def fai(n, x, y):
    g = gcd(x, y)
    l = x * (y//g)
    return n - (n//x) - (n//y) + (n//l)

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

alpha = 0
if a%c != 0 and a%d != 0:
    alpha = 1

print(fai(b, c, d) - fai(a, c, d) + alpha)

Buggy submission (verdict: Runtime Error):
import math

def fai(n, x, y):
    g = math.gcd(x, y)
    l = x * (y//g)
    return n - (n//x) - (n//y) + (n//l)

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

alpha = 0
if a%c != 0 and a%d != 0:
    alpha = 1

print(fai(b, c, d) - fai(a, c, d) + alpha)
Problem p03048 (python)

Fixed submission:
r, g, b, n = map(int, input().split())

dp = [0 for i in range(n+1)]
dp[0] = 1

for i in range(r, n+1, r):
    dp[i] = 1

for i in range(g, n+1):
    dp[i] += dp[i-g]

for i in range(b, n+1):
    dp[i] += dp[i-b]

print(dp[n])

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

dp = [[0 for i in range(n)] for j in range(3)]

for i in range(r-1, n, r):
    dp[0][i] = 1

dp[1][g-1] = 1
for i in range(n):
    dp[1][i] += dp[0][i]
    if i-g >= 0:
        dp[1][i] += dp[1][i-g]

dp[2][b-1] = 1
for i in range(n):
    dp[2][i] += dp[1][i]
    if i-b >= 0:
        dp[2][i] += dp[2][i-b]

print(dp[2][n-1])
Problem p03061 (python)

Fixed submission:
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a

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

l = [0 for i in range(n+1)]
r = [0 for i in range(n+1)]

for i in range(1, n+1):
    l[i] = gcd(l[i-1], a[i-1])

for i in range(n)[::-1]:
    r[i] = gcd(r[i+1], a[i])

m = [0 for i in range(n)]

for i in range(n):
    m[i] = gcd(l[i], r[i+1])

print(max(m))

Buggy submission (verdict: Runtime Error):
import math

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

dp = [a[1], a[0], math.gcd(a[0], a[1])]
for i in range(2, n):
    for j in range(i+1):
        if j != i:
            dp[j] = math.gcd(a[i], dp[j])
    dp += [math.gcd(a[i], dp[i])]


print(max(dp))

Buggy submission (verdict: Runtime Error):
import math, copy

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

dp = [a[1], a[0], math.gcd(a[0], a[1])]
for i in range(2, n):
    for j in range(i+1):
        if j != i:
            dp[j] = math.gcd(a[i], dp[j])
    dp += [math.gcd(a[i], dp[i])]


print(max(dp))
Problem p02684 (python)

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

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

l=[1]
di={}
di[1]=1

for i in a:
    b=a[l[-1]-1]
    if b in di:
        x=b
        break
    l.append(b)
    di[b]=1
aa=0
for j in l:
    if j==x:
        break
    else:
        aa+=1

bb=len(l)-aa
if k<=aa:
    print(l[k])

else:
    cc=(k-aa)%bb
    print(l[aa+cc])

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

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

l=[1]
di={}
di[1]=1

for i in a:
    b=a[l[-1]-1]
    if b in di:
        x=b
        break
    l.append(b)
    di[b]=1
t1=0
for j in l:
    if j==x:
        break
    else:
        aa+=1

t2=len(l)-t1
if k<=t1:
    print(l[k])

else:
    aa=(k-t1)%t2
    print(l[t1+aa])
Problem p02690 (python)

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

for i in range(300):
    a=i**5
    l.append(a)
    l.append(-a)
        

for j in l:
    for k in l:
        aa=j-k
        if j!=k and aa==x:
            ans=[]
            for z in [j,k]:
                aaa=abs(z)**(1/5)
                if z>=0:
                    ans.append(int(aaa))
                else:
                    ans.append(int(-aaa))
            print(*ans)                
            exit()

Buggy submission (verdict: Runtime Error):
import math

x=int(input())
l=[]

for i in range(100):
    a=i**5
    if a>10**9:
        break
    else:
        l.append(a)
        l.append(-a)
for j in l:
    for k in l:
        aa=j-k
        if j!=k and aa==x:
            ans=[]
            for z in [j,k]:
                aaa=abs(z)**(1/5)
                if z>=0:
                    ans.append(int(aaa))
                else:
                    ans.append(int(-aaa))
    
print(*ans)
Problem p02714 (python)

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

r_cnt=s.count('R')
g_cnt=s.count('G')
b_cnt=s.count('B')

ans=r_cnt*g_cnt*b_cnt

for i in range(n):
    for d in range(n):
        j=i+d
        k=j+d
        if k>=n:break
        if s[i]!=s[j] and s[j]!=s[k] and s[k]!=s[i]:
            ans-=1
            
print(ans)

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

r=s.count('R')
g=s.count('G')
b=s.count('B')

ans=r*g*b

for i in range(n):
    for d in range(n):
        j=i+d
        k=j+d
        if s[i]!=s[j] and s[j]!=s[k] and s[k]!=s[i] and k<n:
            ans-=1

print(ans)
Problem p02717 (python)

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

print(c,a,b)

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

print(a[1])
Problem p02727 (python)

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

p=list(map(int,input().split()))
q=list(map(int,input().split()))
r=list(map(int,input().split()))
p=sorted(p,reverse=True)[:x]
q=sorted(q,reverse=True)[:y]
r=sorted(r)

p.extend(q)
p=sorted(p)

ans=0
for i in range(x+y):
    if len(r)>0:
        if p[-1]<r[-1]:
            ans+=r[-1]
            r.pop(-1)
        else:
            ans+=p[-1]
            p.pop(-1)
    else:
        ans+=p[-1]
        p.pop(-1)
        
print(ans)

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

p=list(map(int,input().split()))
q=list(map(int,input().split()))
r=list(map(int,input().split()))
p=sorted(p,reverse=True)[:x]
q=sorted(q,reverse=True)[:y]
r=sorted(r)

p.extend(q)
p=sorted(p)

ans=0
for i in range(x+y):
    if p[-1]<r[-1]:
        ans+=r[-1]
        r.pop(-1)
    else:
        ans+=p[-1]
        p.pop(-1)
        
print(ans)
Problem p02802 (python)

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

l=list(input().split() for _ in range(m))

w=[0]*n
a=[0]*n
seitou=0
pena=0

for i in l:
    k=int(i[0])-1
    if a[k]==0:
        if i[1]=="AC":
            a[k]+=1
        else:
            w[k]+=1

seitou=sum(a)
for j in range(n):
    if int(a[j])==1:
        pena+=w[j]
        
print(seitou,pena)

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

l=list(input().split() for _ in range(m))

w=[0]*n
a=[0]*n
seitou=0
pena=0

for i in l:
    k=int(i[0])-1
    if a[k]==0:
        if i[1]=="AC":
            a[k]+=1
        else:
            w[k]+=1

seitou=sum(a)
for j in range(n):
    if a[i]==1:
        pena+=w[i]
        
print(seitou,pena)
Problem p02861 (python)

Fixed submission:
import itertools
import math
import numpy as np

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

ll=[]
for v in itertools.permutations(range(n)):
    ll.append(list(v))
a=0
for j in ll:
    for k in range(len(j)-1):
        x=j[k]
        y=j[k+1]
        dis=math.sqrt((l[x][0]-l[y][0])**2+(l[x][1]-l[y][1])**2)
        a+=dis

print(a/len(ll))

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

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

ll=[]
for v in itertools.permutations(range(n)):
    ll.append(list(v))
a=0
for j in ll:
    for k in range(len(j)-1):
        x=j[k]
        y=j[k+1]
        dis=math.sqrt((l[x][0]-l[y][0])**2+(l[x][1]-l[y][1])**2)
        a+=dis

print(a/len(ll))

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

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

ll=[]
for v in itertools.permutations(range(n)):
    ll.append(list(v))
a=0
for j in ll:
    for k in range(len(j)-1):
        x=j[k]
        y=j[k+1]
        dis=math.sqrt((l[x][0]-l[y][0])**2+(l[x][1]-l[y][1])**2)
        a+=dis

print(a/len(ll))
Problem p02922 (python)

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

ans=1
c=a
if b==1:
    print(0)
    exit()
while c<b:
    c-=1
    c+=a
    ans+=1
print(ans)

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

ans=1
c=a[:]
if a[1]==1:
    print(0)
    exit()
while c[0]<a[1]:
    c-=1
    c+=a[0]
    ans+=1
print(ans)
Problem p02947 (python)

Fixed submission:
import sys

n=int(input())
l=["".join(sorted(sys.stdin.readline().strip())) for i in range(n)]


res={}
ans=0
 
for j in range(n):
    ll=list(l[j])
    ll.sort()
    aa="".join(ll)
    if aa in res:
        ans+=res[aa]
        res[aa]+=1
    else:
        res[aa]=1

print(int(ans))

Buggy submission (verdict: Runtime Error):
import heapq

n,m=map(int,input().split())
l=[[int(_) for _ in input().split()] for __ in range(n)]

l=sorted(l, key=lambda x:x[1], reverse=True)

a=[]
day=0
ans=0
for j in range(1,m+1):
    while 1:
        if day>=n:
            break
        if l[day][0]<=j:
            heapq.heappush(a,-l[day][1])
            day+=1
        else:
            break
    if a:
        ans-=heapq.heappop(a)
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

n=int(input())
l=set(map(str,sys.stdin))
alp=[chr(_) for _ in range(97,97+26)]
res=[0]
res2=[0]
ans=0

for j in range(n):
    ll=list(l[j])
    ll.sort()
    aa="".join(ll)
    tmp2=0
    for z in range(len(res)):
        if aa==res[z]:
            tmp2+=res2[z]
            res2[z]+=1
    if tmp2==0:
        res.append(aa)
        res2.append(1)
    ans+=tmp2

print(int(ans))
Problem p02995 (python)

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

e=b//c
f=-(-a//c)

ans=e-f+1

g=b//d
h=-(-a//d)

ans=ans+g-h+1

i=(c*d)//fractions.gcd(c,d)

j=b//i
k=-(-a//i)

ans=ans-(j-k+1)

print(b-a+1-ans)

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

e=math.floor(b/c)
f=math.ceil(a/c)

ans=e-f+1

g=math.floor(b/d)
h=math.ceil(a/d)

ans=ans+g-h+1

i=(c*d)//math.gcd(c,d)

j=math.floor(b/i)
k=math.ceil(a/i)

ans=ans-(j-k+1)

print(b-a+1-ans)
Problem p03087 (python)

Fixed submission:
N, Q = map(int, input().split())
S = input()
t = [0] * (N + 1)
for i in range(N):
    t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=list(input())
l=[]
for _ in range(q):
    [a,b]=map(int,input().split())
    l.append([a,b])

for i,j in l:
    ans=0
    tmp=0
    for k in range(i-1,j):
        if s[k]=="A" and s[k+1]=="C" and k!=j-1:
            ans+=1
    print(ans)
Problem p03111 (python)

Fixed submission:
import sys

n,A,B,C=map(int,input().split())

x=[int(input()) for _ in range(n)]
inf=10**9

def dfs(cur,a,b,c):
    if cur==n:
        #print("abs",abs(a-A),abs(b-B),abs(c-C))
        #print("abs...",abs(a-A)+abs(b-B)+abs(c-C)-30)
        return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else inf
    ret0 = dfs(cur+1,a,b,c)
    ret1 = dfs(cur+1,a+x[cur],b,c) + 10
    ret2 = dfs(cur+1,a,b+x[cur],c) + 10
    ret3 = dfs(cur+1,a,b,c+x[cur]) + 10
    #print(ret0,ret1,ret2,ret3)
    return min(ret0, ret1, ret2, ret3)

print(dfs(0,0,0,0))

Buggy submission (verdict: Runtime Error):
import sys

n,A,B,C=map(int,input().split())
x=list(set(map(int,sys.stdin)))

inf=10**9

def dfs(cur,a,b,c):
    if cur==n:
        #print("abs",abs(a-A),abs(b-B),abs(c-C))
        #print("abs...",abs(a-A)+abs(b-B)+abs(c-C)-30)
        return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else inf
    ret0 = dfs(cur+1,a,b,c)
    ret1 = dfs(cur+1,a+x[cur],b,c) + 10
    ret2 = dfs(cur+1,a,b+x[cur],c) + 10
    ret3 = dfs(cur+1,a,b,c+x[cur]) + 10
    #print(ret0,ret1,ret2,ret3)
    return min(ret0, ret1, ret2, ret3)

print(dfs(0,0,0,0))
Problem p03212 (python)

Fixed submission:
from itertools import product
n = int(input())
cnt = 0
for i in range(3,10):
    for m in product(["3","5","7"],repeat = i):
        if "3" in m and "5" in m and "7" in m and int("".join(m))<=n:
            cnt += 1
print(cnt)

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

a=[0]*n
aa=0
for i in range(n):
    b=set(list(str(i)))
    if len(b)==3:
        if "3" in b and "5" in b and "7" in b:
            aa+=1
    a[i]+=aa

print(a[n-1])

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

a=[0]*n
aa=0
for i in range(n):
    b=set(list(str(i)))
    if len(b)==3:
        if b.count("7")>0 and b.count("5")>0 and b.count("3")>0:
            aa+=1
    a[i]+=aa


print(a[n-1])
Problem p03316 (python)

Fixed submission:
n=input()
a=0
for i in n:
    a+=int(i)

if int(n)%a==0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n=input()
a=0
for i in n:
    a+=int(i)

if n%a==0:
    print("Yes")
else:
    print("No")
Problem p03369 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=input().split()
test = lambda x:int(x)
a=test(a)
b=test(b)

w=[int(input()) for i in range(a)]
w.sort()
sum=0
num=len(w)
for i in w:
    sum=sum+i
while b-sum>=w[0]:
    sum=sum+w[0]
    num=num+1
    
print(num)
Problem p03471 (python)

Fixed submission:
a,b=map(int, input().split())
ans=0
for i in range(a+1):
    for j in range(a-i+1):
        z=a-i-j
        if 10000*i+5000*j+1000*z==b and ans==0:
            print(i,j,z)
            ans+=1
if ans==0:
    print(-1,-1,-1)

Buggy submission (verdict: Runtime Error):
a,b=map(int, input().split())
ans=0
f=b//10000
for i in range(f+1):
    for j in range(a-i+1):
        if 10000*i+5000*j+1000*(a-i-j)==b and ans==0:
            z=a-i-j
            print(i,j,z)
            ans+=1
if ans==0:
    print(f'-1 -1 -1')

Buggy submission (verdict: Runtime Error):
a,b=map(int, input().split())
ans=0
for i in range(a+1):
    for j in range(a-i+1):
        if 10000*i+5000*j+1000*(a-i-j)==b and ans==0:
            print(f'{i} {j} {(a-i-j)}')
            ans+=1
if ans==0:
    print(f'-1 -1 -1')

Buggy submission (verdict: Runtime Error):
a,b=map(int, input().split())
ans=0
for i in range(a+1):
    for j in range(a-i+1):
        if 10000*i+5000*j+1000*(a-i-j)==b and ans==0:
            print(f'{i} {j} {(a-i-j)}')
            ans+=1
if ans==0:
    print(f'-1 -1 -1')
Problem p03557 (python)

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

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

for j in range(3):
    a[j].sort()
ans=0
for l in a[1]:
    aa=bisect.bisect_left(a[0],l)
    bb=(n-bisect.bisect_right(a[2],l))
    ans+=aa*bb
print(ans)

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

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

for j in range(3):
    a[j].sort()

q=[0]*n
b=0

for k in range(n):
    b+=n-bisect.bisect_right(a[2],a[1][-k-1])
    q[-k-1]=b

ans=0
max1=max(a[1])

for l in a[0]:
    if l<=max1:
        ans+=q[bisect.bisect_right(a[1],l)]
print(ans)
Problem p04029 (python)

Fixed submission:
a=int(input())
ans=0
for i in range(a+1):
  ans+=i
print(ans)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=list(map(int,input().split()))
cost=999999
for i in range(-100,1,101):
    c=0
    for j in b:
        c=c+(i-j)**2
    if c<cost:
        cost=c
print(cost)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=list(map(int,input().split()))
cost=999999
for i in range(-100,101):
    c=0
    for j in b:
        c=c+(i-j)**2
    if c<cost:
        cost=c
print(cost)
Problem p02657 (python)

Fixed submission:
x, y  = map(int, input().split())
print(x * y)

Buggy submission (verdict: Runtime Error):
x, y  = map(int, input().split)
print(x * y)
Problem p02658 (python)

Fixed submission:
import heapq
from collections import deque
from enum import Enum
import sys
import math
from _heapq import heappush, heappop
import copy
from test.support import _MemoryWatchdog

BIG_NUM = 2000000000
HUGE_NUM = 99999999999999999
MOD = 1000000007
EPS = 0.000000001
sys.setrecursionlimit(100000)


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


for a in A:
    if a == 0:
        print("0")
        sys.exit()

num = 1
for a in A:
    num *= a
    if num > 1000000000000000000:
        print(-1)
        sys.exit()

print(num)

Buggy submission (verdict: Runtime Error):
import sys

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

for a in A:
	if a == 0:
		print("0")
		sys.exit()

num = 1
for a in A:
	num *= a
	if num > 1000000000000000000:
		print(-1)
		sys.exit()

print(num)
Problem p02742 (python)

Fixed submission:
from math import ceil
h,w = map(int,input().split())
ans = h * (w // 2)
if w % 2 != 0 :
    ans += ceil(h/2)
if h == 1 or w == 1:
    ans = 1
print(ans)

Buggy submission (verdict: Runtime Error):
from decimal import Decimal

h, w = input().split()
h_d = Decimal(h)
w_d = Decimal(w)
d_05 = Decimal('0.5')

if int(h) % 2 == 0:
    print(int(h_d*w_d*d_05))
else:
    if int(w) % 2 == 0:
        c = h_d * w * d_05
    else:
        c = d_05 * (h_d * w_d + Decimal('1'))
    print(int(c))