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

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
H[0] -= 1
count = 0
for i in range(1, N):
    if H[i] > H[i - 1]:
        H[i] -= 1 

for i in range(1, N):
    if H[i] <H[i - 1]:
        print("No")
        exit()
print("Yes")

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

if H[1] == H[0] + 1:
    print("Yes")
 
elif H[0] - 1 == H[1]:
    print("Yes")
    
else:
    print("No")
Problem p03001 (python)

Fixed submission:
W, H ,x, y = map(int, input().split())

print(W * H / 2, end=" ")
if 2 * x == W and 2 * y == H:
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
W, H ,x, y = map(int, input().split())
if W % x == 0 and H % y == 0:
    print((W * H) /2, 1)
else:
    if x > y:
      print(min(W * y, W * (H - y)), 0)
    else:
      print(min(H * x, H * (W - x)), 0)

Buggy submission (verdict: Runtime Error):
W, H ,x, y = map(int, input().split())
difx = W - x
dify = H - y
if W % x == 0 and H % y == 0:
    print(W * dify, 1)
else:
    if difx >= dify:
        print(difx* H, 0)
    else:
        print(dify * W,0)

Buggy submission (verdict: Runtime Error):
W, H, x, y = map(int, input().split())
c = 0
if W == H or (x == W and y == H) or (x == 0 and y == H) or (x == W or y == 0) or (y == 0 and x == 0):
    c = 1
if x > W // 2:
    min1 = H * (W - x)
    if y > H // 2:
        mini2 = (H - y) * W
    else:
        mini2 = y * W
    
    print(max(mini1, mini2),c)

else:
    mini1 = x * H
    if y > H // 2:
        mini2 = (H - y) * W
    else:
        mini2 = y * W
    
    print(max(mini1, mini2),c)
Problem p03262 (python)

Fixed submission:
def gcd(x1, x2):
    if x2 == 0:
        return x1
    return gcd(x2, x1 % x2)

N, X = map(int, input().split())
x = list(map(int, input().split()))
if N == 1:
    print(abs(X - x[0]))
    exit()
x.sort()
D = gcd(abs(X-x[0]), abs(X-x[1]))
for i in range(2, N):
    D = gcd(D, abs(X - x[i]))
print(D)

Buggy submission (verdict: Runtime Error):
def gcd(x1, x2):
    if x2 == 0:
        return x1
    return gcd(x2, x1 % x2)

N, X = map(int, input().split())
x = list(map(int, input().split()))
if N == 1:
    print(abs(X-x[0]))
x.sort()
D = gcd(abs(X-x[0]), abs(X-x[1]))
for i in range(2, N):
    D = gcd(D, abs(X - x[i]))
print(D)
Problem p03281 (python)

Fixed submission:
N = int(input())
ans = 0
for i in range(N + 1):
    if i % 2 == 0:
        continue
    c = 0
    for j in range(1, i + 1):
        if i % j == 0:
            c += 1
    if c == 8:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
def hantei(x):
    

N = int(input())
if N >= 105:
    print(1)
else:
    print(0)
Problem p03435 (python)

Fixed submission:
C = [list(map(int, input().split())) for i in range(3)]
x = [0,0,0]
y = [0,0,0]
for i in range(3):
    y[i] = C[0][i] - x[0]
for i in range(3):
    x[i] = C[i][0] - y[0]
flag = True
for i in range(3):
    for j in range(3):
        if x[i] + y[j] != C[i][j]:
            flag = False
print('Yes' if flag else 'No')

Buggy submission (verdict: Runtime Error):
C = [list(map(int, input().split())) for i in range(3)]
x = [0,0,0]
y = []
for i in range(3):
    y.append(C[0][i] - x[0])
for i in range(3):
    x[i] = C[i][0] - y[0]

for i in range(3):
    for j in range(3):
        if x[i] + y[j] != C[i][j]:
            print('No')
            exit(1)
print('Yes')
Problem p03544 (python)

Fixed submission:
N = int(input())
L = [2, 1]
for i in range(2, N+1):
    L.append(L[i - 1] + L[i - 2])
print(L[N])

Buggy submission (verdict: Runtime Error):
N = int(input())
L = [2, 1]
for i in range(2, N+1):
    L.append(L[i - 1] + L[i - 2])
print(L[i])
Problem p03574 (python)

Fixed submission:
H, W = map(int, input().split())
S = []
for i in range(H):
    s = list(input())
    for j in range(W):
        if s[j] == '.':
            s[j] = 0
    S.append(s)

dx = [0,1,1,1,0,-1,-1,-1]
dy = [1,1,0,-1,-1,-1,0,1]
for i in range(H):
    for j in range(W):
        if S[i][j] == "#":
            continue
        for k in range(8):
            nx = j + dx[k]
            ny = i + dy[k]
            if nx >= 0 and ny >= 0 and ny < H and nx < W :
                if S[ny][nx] == "#":
                    S[i][j] += 1
for i in range(H):
    l = map(str,S[i])
    ans = "".join(l)
    print(ans)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = []
for i in range(H):
    s = list(input())
    for j in range(W):
        if s[j] == '.':
            s[j] = 0
    S.append(s)

dx = [0,1,1,1,0,-1,-1,-1]
dy = [1,1,0,-1,-1,-1,0,1]
for i in range(H):
    for j in range(W):
        for k in range(8):
            nx = j + dx[k]
            ny = i + dy[k]
            if nx >= 0 and ny >= 0 and ny < H and nx < W:
                if S[ny][nx] == "#":
                    S[i][j] += 1
for i in range(H):
    l = map(str,S[i])
    ans = "".join(l)
    print(ans)
Problem p02747 (python)

Fixed submission:
x=input()
if x == 'hi':
	print('Yes')
elif x == 'hihi':
	print('Yes')
elif x == 'hihihi':
	print('Yes')
elif x == 'hihihihi':
	print('Yes')
elif x == 'hihihihihi':
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
x=input()
if x == 'hi':
	print('Yes')
else if x == 'hihi':
	print('Yes')
else if x == 'hihihi':
	print('Yes')
else if x == 'hihihihi':
	print('Yes')
else if x == 'hihihihihi':
	print('Yes')
else:
	print('NO')

Buggy submission (verdict: Runtime Error):
x=input()
if x == 'hi'
	print('Yes')
else if x == 'hihi'
	print('Yes')
else if x == 'hihihi'
	print('Yes')
else if x == 'hihihihi'
	print('Yes')
else if x == 'hihihihihi'
	print('Yes')
else
	print('NO')

Buggy submission (verdict: Runtime Error):
x=input()
x1=len(x)
x2 = x1 / 2
if x1 %2 == 0
	if "hi"*x2 == s:
		print("Yes")
	else
		print("No")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
x=input()
x1=len(x)
if x1 %2 == 0
	if "hi"*x1 == s:
		print("Yes")
	else
		print("No")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
x=input()
x1=len(x)
if x1 %2 == 0
	print("yes")
else
	print("no")
Problem p02748 (python)

Fixed submission:
A,B,M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = min(a) + min(b)
for i in range(M):
  x,y,c = map(int, input().split())
  ans = min(ans, a[x-1]+b[y-1]-c)
print(ans)

Buggy submission (verdict: Runtime Error):
A,B,M = map(int, input().split())
a = map(int, input().split())
b = map(int, input().split())
a_min = min(a)
b_min = min(b)
ans = a_min + b_min
for i in range(M):
  x,y,c = map(int, input().split())
  x -= 1
  y -= 1
  ans = min(ans, a[x]+b[y]-c)
print(ans)
Problem p03048 (python)

Fixed submission:
r, g, b, n = [int(i) for i in input().split()]
total = 0
rm = n//r
for rn in range(rm + 1):
	gm = (n - rn * r) // g
	for gn in range(gm + 1):
		bd = n - r * rn - g * gn
		if bd % b == 0:
			total += 1
print(total)

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

rm = n//r
for i in range(rm + 1):
	for j in range(gm + 1):
		bd = n - r * i - g * j
		if bd % b == 0:
			total += 1
print(total)
Problem p03049 (python)

Fixed submission:
n = int(input())
a = 0
b = 0
ab = 0
total = 0
t = []

for i in range(n):
	t.append(input())

for i in t:
	total += i.count("AB")
	if i[-1] == "A" and i[0] == "B":
		ab += 1
	else:
		a += i[-1] == "A"
		b += i[0] == "B"
if ab == 0:
	print(total + min(a,b))
elif a == 0 and b == 0:
	print(total + ab - 1)
elif a > 0 and b > 0:
	print(total + ab + min(a, b))
else:
	print(total + ab)

Buggy submission (verdict: Runtime Error):
n = int(input())
t = []
a = 0
b = 0
total = 0
for i in range(n):
	t.append(input())
    total += t[-1].count("AB")
    a += t[-1][-1] == "A"
    b += t[-1][0] == "B"
print(min(a,b) + total)
Problem p02747 (python)

Fixed submission:
a = input()
a=a.replace("hi","")
if(len(a)==0):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
inp=list(map(int,input().split(" ")))
N=inp[0]
T=inp[1]+0.5

a=[0]*N
b=[0]*N
for i in range(N):
    inp=list(map(int,input().split(" ")))
    a[i]=inp[0]
    b[i]=inp[1]


time=0
get =0

while(1):
    time+=1
    if(time>T or len(a)==0):
        break
    need=list(map(lambda x,y:x*time+y,a,b))
    mini=min(need)
    time+=mini
    go=[i for i, x in enumerate(need) if x == mini]#get list to minimum
    gomin=[]
    for i in range(len(go)):#make list a
        gomin.append(a[go[i]])
    go=gomin.index(max(gomin))#find a minimum index
    del a[go]
    del b[go]
    if(time>T):
        break
    get+=1

print(get)

Buggy submission (verdict: Runtime Error):
inp = input().split(" ")
A=int(inp[0])
B=int(inp[1])
M=int(inp[2])

if A!=0:
    a=input().split(" ")
else:
    a=[0]
if B!=0:
    b=input().split(" ")
else:
    b=[0]

s=[0]*(M+(1))
m=[[0]*3]*M
i=0
for x in m:
    x=input().split(" ")
    s[i]=int(a[int(x[0])-1])+int(b[int(x[1])-1])-int(x[2])
    i+=1

s[i]=int(min(a))+int(min(b))

print(min(s))
Problem p02756 (python)

Fixed submission:
import sys
a = sys.stdin.read().split('\n')[:-1]
q = int(a[1])
f = 1
l = [[], []]
for i in range(2, q + 2):
    if a[i][0] == '1':
        f = 1 - f
    else:
        l[0 if a[i][2] == '21'[f] else 1].append(a[i][4])
if f != 1:
    l[1].reverse()
    print(''.join(l[1]) + ''.join(reversed(list(a[0]))) + ''.join(l[0]))
else:
    l[0].reverse()
    print(''.join(l[0]) + a[0] + ''.join(l[1]))

Buggy submission (verdict: Runtime Error):
import sys
a = sys.stdin.read().split('\n')[:-1]
s = list(a[0])
q = int(a[1])
f = 1
for i in range(2, q + 2):
    if a[i][0] == '1':
        f = 1 - f
    else:
        l = len(s)
        s.insert(a[i][2] == '21'[f] ? 0 : l, a[i][4])
if f == 1:
    print(''.join(s))
else:
    print(''.join(reversed(s)))
Problem p02802 (python)

Fixed submission:
import sys
from functools import reduce

n, m = map(int, input().split())
ps = [r.split() for r in sys.stdin.read().split('\n') if r != '']
ps.sort(key=lambda t: int(t[0]))
log = []
for i in range(0, n):
    log.append([])
for j in range(0, m):
    i = int(ps[j][0])
    log[i-1].append(ps[j][1])
wacount = sum(map(lambda l: l.index('AC'), filter(lambda e: e.count('AC') > 0, log)))
print(len(list(filter(lambda e: e.count('AC') > 0, log))),
        wacount)

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

n, m = map(int, input().split())
ps = [r.split() for r in sys.stdin.read().split('\n') if r != '']
ps.sort(key=lambda t: int(t[0]))
ac = {}
wa = {}
for j in range(0, m):
    i = int(ps[j][0])
    if i in ac:
        continue
    if ps[j][1] == 'AC':
        ac[i] = 1
        continue
    if i not in wa:
        wa[i] = 1
    else:
        wa[i] += 1
wacount = reduce(lambda a, b: a + b, map(lambda t: t[1], filter(lambda t: t[0] in ac, wa.items()))) if len(wa) > 0 else 0
print(len(ac), wacount)
Problem p02947 (python)

Fixed submission:
import sys
p = [r for r in sys.stdin.read().split('\n') if r != '']
n = int(p[0])
s = p[1:]
for i, r in enumerate(s):
    t = list(r)
    t.sort()
    s[i] = ''.join(t)
d = {}
for i in s:
    if i in d:
        d[i] += 1
    else:
        d[i] = 0
count = 0
for k, v in d.items():
    count += int((v + 1) * v / 2)
print(count)

Buggy submission (verdict: Runtime Error):
import sys
p = [r for r in sys.stdin.read().split('\n') if r != '']
n = int(p[0])
s = p[1:]
for i, r in enumerate(s):
    t = list(r)
    t.sort()
    s[i] = ''.join(t)
total = 0
while n:
    a = s.pop(-1)
    count = 0
    for i in reversed(range(0, len(s))):
        if s[i] == a:
            count += 1
            s[i] = None
    total += int((count + 1) * count / 2)
    n -= (count + 1)
print(total)
Problem p02953 (python)

Fixed submission:
import sys
p = [[int(c) for c in r.split()] for r in sys.stdin.read().split('\n') if r != '']
n = p[0][0]
if n == 1:
    print('Yes')
    quit()
h = p[1]
h.reverse()
for i in range(len(h)-1):
    if h[i] + 1 < h[i+1]:
        print('No')
        quit()
    if h[i] < h[i+1]:
        h[i+1] -= 1
if h[i] < h[i+1]:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
import sys
p = [[int(c) for c in r.split()] for r in sys.stdin.read().split('\n') if r != '']
n = p[0][0]
h = p[1]
h.reverse()
for i, x in enumerate(h[:-1]):
    if x + 1 < h[i+1]:
        print('No')
        quit()
    if x < h[i+1]:
        h[i+1] -= 1
if h[i] < h[i+1]:
    print('No')
else:
    print('Yes')
Problem p03029 (python)

Fixed submission:
import sys
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2))
a()

Buggy submission (verdict: Runtime Error):
import sys
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2)
a()

Buggy submission (verdict: Runtime Error):
import sys
from functools import reduce
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2)
a()
import sys
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2)
a()

Buggy submission (verdict: Runtime Error):
import sys
from functools import reduce
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2)
a()
Problem p03035 (python)

Fixed submission:
def abc127a():
    A, B = (int(s) for s in input().split(" "))
    answer = int(0 if A <= 5 else B / 2 if A <= 12 else B)
    print(answer)

def main():
    abc127a()

main()

Buggy submission (verdict: Runtime Error):
def abc127d():
    N, M = (int(s) for s in input().split(" "))
    A = sorted(list(int(s) for s in input().split(" ")))
    for i in range(0, M):
        B, C = (int(s) for s in input().split(" "))
        r = len(list(filter(lambda x: x < C, A[:B])))
        A = sorted([C for n in range(0, r)] + A[r:])
    print(sum(A))
abc127d()
Problem p02811 (python)

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

if 500 * K - X >= 0  :
  print('Yes') 
else:
  print('No')

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

if (500 * K - X） >= 0  :
  print('Yes') 
else:
  print('No')

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

if (500 * K） < X  :
  print('No') 
else:
  print('Yes')
Problem p02910 (python)

Fixed submission:
S = input()

counter = 1
yorn = 1
for foot in S:
    if foot == 'R':
        if counter % 2 == 0:
            yorn=0
            break
    elif foot == 'L':
        if counter % 2 == 1:
            yorn = 0
            break
    counter+=1

if yorn == 1:
    print("Yes")
else:
    print("No")

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

counter = 1
yorn = 1
for foot in S:
    if foot == 'R':
        if counter % 2 == 0:
            yorn=0
            break
    elif foot == 'L':
        if counter % 2 == 1:
            yorn = 0
            break
    counter++

if yorn == 1:
    print("Yes")
else:
    print("No")
Problem p02993 (python)

Fixed submission:
S = input()
n=0
b=0
while n<3 :
    if S[n]==S[n+1]:
        b=1
    n+=1
if b==1:
    print("Bad")
else:
    print("Good")

Buggy submission (verdict: Runtime Error):
N = int(input())
l = [list(map(int, input().split())) for i in range(n)]
l.sort(key= x:x[1])
t=0
for i in l:
    a,b=i
    t+=a
    if(t>b):
        print("No")
        break
    else:
        print("Yes")
Problem p02996 (python)

Fixed submission:
N = int(input())
l = [list(map(int, input().split())) for i in range(N)]
l.sort(key= lambda x:x[1])
t=0
cnt=0
for i in l:
    cnt+=1
    a,b=i
    t+=a
    if(t>b):
        print("No")
        break
    elif cnt==N:
        print("Yes");

Buggy submission (verdict: Runtime Error):
N = int(input())
l = [list(map(int, input().split())) for i in range(n)]
l.sort(key= lambda x:x[1])
t=0
for i in l:
    a,b=i
    t+=a
    if(t>b):
        print("No")
        break
    else:
        print("Yes");

Buggy submission (verdict: Runtime Error):
N = int(input())
l = [list(map(int, input().split())) for i in range(n)]
l.sort(key= x:x[1])
t=0
for i in l:
    a,b=i
    t+=a
    if(t>b):
        print("No")
        break
    else:
        print("Yes")
Problem p03000 (python)

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

L = [int(i) for i in input().split()]

d=0
for i in range(N):
    d += L[i]
    if d>X :
        print(i+1)
        break
    if i == N-1 :
        print(N+1)

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

L = [int(i) for i in input().split()]

d=0
for i in range(N+1):
    if d>X :
        print(i)
        break
    if i == N :
        print(i+1)
    d += L[i]
Problem p03860 (python)

Fixed submission:
s = input()[8]
print('A' + s + 'C')

Buggy submission (verdict: Runtime Error):
    s = input()[8]
    print('A' + s + 'C')
Problem p03962 (python)

Fixed submission:
# coding: utf-8
 
 
def main():
 
    penki_list = input().split(' ')

    # setは重複する要素を持たない→複数のデータをまとめる
    # lenは要素の数
    print(len(set(penki_list)))
 
    return 0
 
 
if __name__ == '__main__':
    main()

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


def main(argv=sys.argv):
  N, K = map(int, input().split())
  print(K * ((K - 1) ** (N - 1)))

  
  
  return 0
  
  
if __name__ == '__main__':
  sys.exit(main())
Problem p02747 (python)

Fixed submission:
input = input()

if len(input) % 2:
    print("No")
    exit(0)

result = "Yes"
isHi = False
for i in range(len(input)-1):
    if isHi:
        isHi = False
        continue;

    str = input[i] + input[i+1]
    if str != "hi":
        result = "No"
        break

    isHi = True

print(result)

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

x = [0] * M
y = [0] * M
c = [0] * M

min = 99999999

for i in range(M):
    x[i], y[i], c[i] = map(int, input().split())
    cost = a[x[i] - 1] + b[y[i] - 1] - c[i]
    if cost < min:
        min = cost

for i in range(A):
    if a[i] > cost:
        continue
    for j in range(B):
        if b[j] > cost:
            break
        cost = a[i] + b[j]
        if cost < min:
            min = cost

print(min)
Problem p02747 (python)

Fixed submission:
import re
index = re.fullmatch(r'(hi)+', input())
if index:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import re
index = re.search(r'.*(hi)+.*, input())
if index:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import re
index = re.match(r'*(hi)+*', input())
if index:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import re
index = re.search(input(),(hi)+)
if index:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import re
index = re.search(input(),'hi')
if index != -1:
    print("Yes")
else if :
    print("No")

Buggy submission (verdict: Runtime Error):
if ("hi" in str(S)):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
if ("hi" in S):
  print("Yes")
else:
  print("No")
Problem p02983 (python)

Fixed submission:
L,R=map(int,input().split())
min=2019
for i in range(L,R+1):
    for k in range(i+1,R+1):
        mod=(i*k)%2019
        if mod<min:
            min=mod
        if mod==0:
            min=0
            break
    else:
        continue
    break
print(min)

Buggy submission (verdict: Runtime Error):
L,R=map(int,input().split())
min=2019
for i in range(L,R+1):
    for k in range(i+1,R+1):
        mod=(i*k)%2019
        if mod==0:
            min=0
            break
        if mod<min:
            min=mod
        else:
            continue
    	break
print(min)
Problem p02747 (python)

Fixed submission:
input = input()
if len(input.replace("hi", "")) == 0:
  
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
 input = input()
 if len(input.replace("hi", "")) == 0:
  
    print("Yes")
 else
    print("No")
Problem p03473 (python)

Fixed submission:
import fileinput
for line in fileinput.input():
    print(48 - int(line))

Buggy submission (verdict: Runtime Error):
a = int(raw_input())
print(48 - a)
Problem p02747 (python)

Fixed submission:
n = raw_input()

length = len(n)
if length % 2 == 0:
  if n.count('hi')==length/2:
    print("Yes")
  else:
    print("No")
else:
  print("No")

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

if 'hi' in n:
  print("Yes")
else:
  print("No")
Problem p02999 (python)

Fixed submission:
xa = input().split(" ")
x = int(xa[0])
a = int(xa[1])

if x<a:
  print("0")
elif a<=x:
  print("10")
else:
  print("error")

Buggy submission (verdict: Runtime Error):
nk = input().split(' ')
n = int(nk[0])
k = int(nk[1])
a = input().split(' ')
count = 0
sum = 0
for i in range(n):
#  print(i)
  sum = int(a[i])
  j = i+1
  if k<=sum :
    count = count + 1
  while j<n:
    sum = sum + int(a[j])
  #  print("sum:{} j:{} a[j]:{}".format(sum,j,a[j]))
    if k<=sum :
      count = count + 1
  #    print("sum:{} count:{}".format(sum,count))
    j += 1

print("{}".format(count))
Problem p03494 (python)

Fixed submission:
import copy
n=int(input())
a=input().split(" ")
count = 0
t=True
while t:
  b=[]
  for j in a:
    if int(j)%2 == 0:
      b.append(int(j)/2)
    elif int(j)<2:
      t=False
    else:
      t=False
  if t==False:
    break
  count = count+1
  a=copy.deepcopy(b)
print(count)

Buggy submission (verdict: Runtime Error):
import copy
n=int(input())
a=[]
for i in range(n):
  item = int(input())
  a.append(item)
count = 0
t = True
while t:
  b=[]
  for j in a:
    if j%2==0:
      b.append(j/2)
    elif j<2:
      t=False
    else:
      t=False
  if t== False:
    break
  count = coutn +1
  a=copy.deepcopy(b)
print(count)
Problem p02767 (python)

Fixed submission:
# coding: utf-8


def main():
    n = int(input())
    numbers = list(map(int, input().split(' ')))    

    max_number = max(numbers)
    min_number = min(numbers)
    min_sums = []
    for p in range(min_number, max_number + 1):
        sum_ = 0
        for x in numbers:
            sum_ += (x - p) ** 2
        min_sums.append(sum_)

    print(min(min_sums))

    return 0


if __name__ == '__main__':
    main()

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


def main():
    n = int(input())
    point = list(map(int, input().split(' ')))    

    max_point = max(point)
    min_point = min(point)
    min_sums = []
    for p in range(min_point, max_point + 1):
        sum_ = 0
        for x in numbers:
            sum_ += (x - p) ** 2
        min_sums.append(sum_)

    print(min(min_sums))

    return 0


if __name__ == '__main__':
    main()
Problem p03433 (python)

Fixed submission:
# coding: utf-8
import sys


def main():
  n = int(input())
  a = int(input())
  
  if n % 500 != 0 and a == 0:
    print('No')
  
  elif (n - (n // 500) * 500) <= a:
    print('Yes')
    
  else:
    print('No')
  
  return 0


if __name__ == '__main__':
  main()

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


def main():
  n = int(input())
  a = int(input())
  b = n // a
  

  if (n - b * 500) <= a:
    print('Yes')
  
  else:
    print('No')
  
  return 0


if __name__ == '__main__':
  main()
Problem p03962 (python)

Fixed submission:
# coding: utf-8
import sys
 
def main(argv=sys.argv):
  
  set1 = set(input().split())
  print(len(set1))
  
  return 0
 
 
if __name__ == '__main__':
  sys.exit(main())

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

def main(argv=sys.argv):
  
  dict = {input().split()}
  print(dict)
  
  return 0


if __name__ == '__main__':
  sys.exit(main())
Problem p02778 (python)

Fixed submission:
import re
s = input()
print(re.sub(r"[a-z]", "x", s))

Buggy submission (verdict: Runtime Error):
import re
S = int(input())
print(re.sub(r"[a-z]", "x", S))