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

Fixed submission:
input()
ip = input().split()
data = []
for i in ip:
    data.append(int(i))

buf = -1
enc = 0
for i in data:
    if buf == i:
        enc += 1
        buf = -1
    else:
        buf = i

print(enc)

Buggy submission (verdict: Runtime Error):
#A = 初期値　B = 一日の購入　C = 乳化のボーダー　D =在庫の増やす数

#A > B
#D % B >= B - C

size = int(input())
data = []
flag = 0

for i in range(size):
    ip = input().split()
    data = []
    for j in ip:
        data.append(int(j))
    #定義
    buf = []
#    print(store,buy,bord,charge,buf)
    #最初の処理
    data[0] = data[0] % data[1]
    if data[0] > data[3]:
        flag = 1
    #定常処理
    while data[0] not in buf:
        buf.append(data[0])
        data[0] = (data[0] + data[3]) % data[1]
        if data[0] > data[3]:
            flag = 1
            break
 #   print(buf)
    if flag == 1:
        print("No")
        flag = 0
    else:
        print("Yes")
Problem p03106 (python)

Fixed submission:
x,y,z = map(int,input().split())
n = (y if x < y else x) 
n += 1
array = [1]
for i in range(1,n):
	if (x%i==0 and y%i==0):
		array.append(i)
array.reverse()
print(array[z-1])

Buggy submission (verdict: Runtime Error):
x,y,z = map(int,input().split())
n = (y if x < y else x) 
array = []
for i in range(1,n):
	if (x%i==0 and y%i==0):
		array.append(i)
array.reverse()
print(array[z-1])

Buggy submission (verdict: Runtime Error):
x,y,z = map(int,input().split())
n = (y if x < y else x) 
array = []
for i in range(1,n):
	if (x%i==0 and y%i==0):
		array.append(i)
print(array[z-1])
Problem p02945 (python)

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

X = K+N
Y = K-N
Z = K*N

print(max(X,Y,Z))

Buggy submission (verdict: Runtime Error):
let test a b =
  max (max (a+b) (a-b)) (a*b);;

Scanf.sscanf (read_line ()) "%d %d" (fun a b -> test a b);;
Problem p03160 (python)

Fixed submission:
n=int(input())
arr=[]
arr=[0]+[int(i) for i in input().split(" ")]
dp=[0]*(n+1)
dp[n]=0
dp[n-1]=abs(arr[n-1]-arr[n])
for i in range(n-2,0,-1):
    dp[i]=min( dp[i+1]+abs(arr[i]-arr[i+1]) , dp[i+2]+abs(arr[i]-arr[i+2]) )
print(dp[1])

Buggy submission (verdict: Runtime Error):
n,k=input().split(" ")
n=int(n)
k=int(k)
arr=[0]+[int(i) for i in input().split(" ")]
dp=[0]*(n+1)
for i in range(n-1,0,-1):
    min1=1000000007;
    for j in range(i+1,min(n+1,i+k+1)):
        x=dp[j]+abs(arr[i]-arr[j])
        if(x<min1):
            min1=x
    dp[i]=min1
print(dp[1])

Buggy submission (verdict: Runtime Error):
n=int(input())
arr=[]
arr=[int(i) for i in input().split(" ")]
arr=[0]+arr

def dp(x):
    if (x==n):
        return 0
    if(x==n-1):
        return (abs(arr[n]-arr[x]))
    return (min(  dp(x+1)+abs(arr[x]-arr[x+1]), dp(x+2)+abs(arr[x]-arr[x+2]) ))

print(dp(1))
Problem p02772 (python)

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

count = 0
for i in A:
    if i%2 == 0 and i%3 != 0 and i%5 != 0:
        print("DENIED")
        break
    count += 1

if count == len(A):
    print("APPROVED")

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

count = 0
if len([i for i in A if i%2 == 0 ]) ==0:
    print("APPROVED")
else:
    a = [i for i in A if i%2 == 0 ]
    for j in a:
        if j%3 == 0 or j%5 == 0:
            count += 1
    
if count == len(a):
    print("APPROVED")

else:
    print("DENIED")
Problem p03323 (python)

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

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
A,B=map(int,input().split())
print("Yay!" if a <= 8 and b <= 8 else ":(")

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
print("Yay!" if a <= 8 and b <= 8 else ":(")
Problem p03737 (python)

Fixed submission:
S = input().split()
str = S[0][0] + S[1][0] + S[2][0]
print(str.upper())

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

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

Buggy submission (verdict: Runtime Error):
s = input().split()
str = s[0][0] + s[1][0] + s[2][0]
print(str.upper())
Problem p02719 (python)

Fixed submission:
n, k = map(int, input().split())
if n==0 or k==1:
    print(0)
    exit()
elif n<k:
    print(min(n, abs(n-k)))
    exit()
elif n % k == 0:
    print(0)
    exit()
else:
    mx = n%k
print(min(abs(mx-k), mx))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
N = abs(N - K)
while true:
  if N =< K:
    N = (N - K)
    break
    
print(abs(N))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
result = []
while N > 0
    M -= abs(N - M)
    result.append(M)
print(min(result))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
Print(abs((N-M))-N)
Problem p02730 (python)

Fixed submission:
def fin():
    print('No')
    quit()

input_line = input()
if not input_line == input_line[::-1]:
    fin()

N = len(input_line)
new_str = input_line[0:(N-1)//2]
if not new_str == new_str[::-1]:
    fin()

print('Yes')

Buggy submission (verdict: Runtime Error):
def kaibun(mojiretu):
    leg = len(mojiretu)
    mid = (leg-1) /2
    for i in range(mid):
        if mojiretu[i] != mojiretu[(mid+1)+i]:
            return False
    return True

input_line = input()
if not kaibun(input_line):
    print('No')
    quit()

mid = (leg-1) /2
if not kaibun(input_line[0:mid]):
    print('No')
    quit()

if not kaibun(input_line[mid+1:]):
    print('No')
    quit()
Problem p03799 (python)

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

if num_c <= num_s * 2:
  # Sが多いとき
  print(num_c // 2)
else:
  scc = num_s
  num_s = 0
  num_c -= 2 * scc
  scc += num_c // 4
  print(scc)

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

if num_c <= num_s * 2:
  print(num_c // c)
else:
  scc = num_s
  num_s = 0
  num_c -= 2 * scc
  scc += num_c // 4
  print(scc)
Problem p03998 (python)

Fixed submission:
def solve(a,b,c,turn):
	if turn == "a":
		if a == "":
			return "A"
		else:
			next_turn = a[0]
			a = a[1:]
	elif turn == "b":
		if b == "":
			return "B"
		else:
			next_turn = b[0]
			b = b[1:]
	else:
		if c == "":
			return "C"
		else:
			next_turn = c[0]
			c = c[1:]
	return solve(a,b,c, next_turn)
a=input().strip()
b=input().strip()
c=input().strip()
print(solve(a,b,c,"a"))

Buggy submission (verdict: Runtime Error):
    def solve(a,b,c,turn):
    	if turn == "a":
    		if a == "":
    			return "A"
    		else:
    			next_turn = a[0]
    			a = a[1:]
    	elif turn == "b":
    		if b == "":
    			return "B"
    		else:
    			next_turn = b[0]
    			b = b[1:]
    	else
    		if c == "":
    			return "C"
    		else:
    			next_turn = c[0]
    			c = c[1:]
    	return solve(a,b,c, next_turn)
    a=input().strip()
    b=input().strip()
    c=input().strip()
    print(solve(a,b,c,"a"))

Buggy submission (verdict: Runtime Error):
def solve(a,b,c,turn):
	if turn == "a":
		if a == "":
			return "A"
		else:
			next_turn = a[0]
			a = a[1:]
	elif turn == "b":
		if b == "":
			return "B"
		else:
			next_turn = b[0]
			b = b[1:]
	else
		if c == "":
			return "C"
		else:
			next_turn = c[0]
			c = c[1:]
	return solve(a,b,c, next_turn)
a=input().strip()
b=input().strip()
b=input().strip()
print(solve(a,b,c,"a"))
Problem p03999 (python)

Fixed submission:
def solve(s):
	if len(s) == 0:
		return 0, 1
	l = len(s)
	ans = 0
	cnt = 0
	for i in range(1, l+1):
		left = s[:i]
		right = s[i:]
		a, b = solve(right)
		ans += int(left) * b + a
		cnt += b
	return ans, cnt

s = input().strip()
ans, _ = solve(s)
print(ans)

Buggy submission (verdict: Runtime Error):
def sovle(s):
	if len(s) == 0:
		return 0
	l = len(s)
	ans = 0
	for i in range(1, l+1):
		left = s[:i]
		right = s[i:]
		ans += int(left) + solve(right)
	return ans

s = input().strip()
print(solve(s))
Problem p04000 (python)

Fixed submission:
from collections import Counter
h, w, n = [int(i) for i in input().split()]

vs = []
for i in range(-1, 2):
	for j in range(-1, 2):
		vs.append((i,j))
cnt = []
for _ in range(n):
	a, b = [int(i) for i in input().split()]
	for v in vs:
		aa = a + v[0]
		bb = b + v[1]
		if 2<=aa<=(h-1) and 2<=bb<=(w-1):
			cnt.append(aa*w+bb)

cnt = Counter(cnt)


cnt2 = [0] * 10
cnt2[0] = (h-2)*(w-2)
for k in cnt:
	c = cnt[k]
	cnt2[c] += 1
	cnt2[0] -= 1

for i in cnt2:
	print(i)

Buggy submission (verdict: Runtime Error):
from collections import Counter
h, w, n = [int(i) for i in input().split()]

vs = []
for i in range(-1, 2):
	for j in range(-1, 2):
		vs.append((i,j))
cnt = []
for _ in range(n):
	a, b = [int(i) for i in input().split()]
	for v in vs:
		aa = a + v[0]
		bb = b + v[1]
		if 2<=aa<=h-1 and 2<=bb<=w-1:
			cnt.append(aa*h+bb)

cnt = Counter(cnt)


cnt2 = [0] * 10
cnt2[0] = (h-2)*(w-2)
for k in cnt:
	c = cnt[k]
	cnt2[c] += 1
	cnt2[0] -= 1

for i in cnt2:
	print(i)
Problem p04019 (python)

Fixed submission:
n = w = s = e = 0
for c in input():
	if c == "N":
		n += 1
	if c == "W":
		w += 1
	if c == "S":
		s += 1
	if c == "E":
		e += 1
b = ((n >= 1 and s >= 1) or (n==s==0)) and ((w >= 1 and e >= 1) or (w==e==0))
print("Yes" if b else "No")

Buggy submission (verdict: Runtime Error):
n, w, s, e = 0
for c in input():
	if c == "N":
		n += 1
	if c == "W":
		w += 1
	if c == "S":
		s += 1
	if c == "E":
		e += 1
b = ((n >= 1 and s >= 1) or (n==s==0)) and ((w >= 1 and e >= 1) or (w==e==0))
print("Yes" if b else "No")
Problem p03355 (python)

Fixed submission:
import numpy as np

s = input()
K = int(input())
L = len(s)

candidate = []

for l in range(1, K + 1):
    for j in range(0, L - l + 1):
        candidate.append(s[j:j+l])

candidate = list(set(candidate))
print(np.sort(candidate)[K-1])

Buggy submission (verdict: Runtime Error):
import numpy as np
N, M = list(map(int, input().split()))
p = list(map(int, input().split()))
x = []
y = []
for _ in range(M):
    xi, yi = list(map(int, input().split()))
    x.append(xi - 1)
    y.append(yi - 1)

def count(l):
    out = 0
    for i, v in enumerate(l):
        if i + 1 == v:
            out += 1
    return out

def swap(l, a, b):
    va = l[a]
    vb = l[b]
    l1 = l.copy()
    l1[a] = vb
    l1[b] = va
    return l1

depth = 0
max_count = count(p)
max_d = M**5
children = [p]
next_children = []
while depth <= max_d:
    for child in children:
        for i in range(M):
            pi = swap(child, x[i], y[i])
            ci = count(pi)
            if ci > max_count:
                max_count = ci
	    if not pi in next_children:
                next_children.append(pi)
    depth += 1
    children = next_children
    next_chldren = []
    if max_count == len(p):
        break

print(max_count)
Problem p02823 (python)

Fixed submission:
#A - Table Tennis Training
N,A,B = list(map(int, input().split()))

Lab = B-A
La = A-1
Lb = N-B

if Lab%2==0:
    #case Lab is even
    ans = Lab//2
else:
    #case Lab is odd
    ans = min(La,Lb) + 1 + Lab//2

print(ans)

Buggy submission (verdict: Runtime Error):
#A - Table Tennis Training
N,A,B = list(map(int, input().split()))

if Lab%2==0:
    #case Lab is even
    ans = int(B-A/2)
else:
    #case Lab is odd
    ans = min(A-1,N-B) + 1 + int((B-A-1)/2)

print(ans)
Problem p02719 (python)

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

def okikae(t, k):
    if k==0:
        print(t)
    elif int(k/2)+1 > t:
        print(t)
    elif t%k==0:
        print(0)
    elif t>k and t%k > 0:
        t = k+(t%k)
        okikae(abs(t-k), k)
    else:
        okikae(abs(t-k), k)

okikae(N, K)

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

def okikae(t, k):
    if k==0:
        print(t)
    elif t%k==0:
        print("0")
    elif int(k/2) >= t:
        print(t)
    else:
        okikae(abs(t-k), k)

okikae(N, K)

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

def okikae(t):
    if K==0:
        print(N)
    elif N%K==0:
        print("0")
    elif K/2 >= t and t <= K:
        print(t)
    else:
        okikae(abs(t-K))

okikae(N)

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

def okikae(t):
    if N%K==0:
        print("0")
    elif K/2 >= t and t <= K:
        print(t)
    else:
        okikae(abs(t-K))

okikae(N)
Problem p03434 (python)

Fixed submission:
N = int(input())

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

data = sorted(L, reverse=True)
count_A = 0
count_B = 0

for i, d in enumerate(data):
    if i%2 == 0:
        count_A += d
    else:
        count_B += d
        
print(count_A - count_B)

Buggy submission (verdict: Runtime Error):
n = int(input())
a, b = map(int, input().split())
# print("a:{}, b:{}, c:{}".format(n, a, b))
data = sorted(list([n,a,b]), reverse=True)
count_A = 0
count_B = 0

for i, d in enumerate(data):
    if i%2 == 0:
        count_A += d
    else:
        count_B += d
        
print(count_A - count_B)

Buggy submission (verdict: Runtime Error):
N = int(input())
n, a, b = map(int, input().split())
# print("a:{}, b:{}, c:{}".format(n, a, b))
data = sorted(list([n,a,b]), reverse=True)
count_A = 0
count_B = 0

for i, d in enumerate(data):
    if i%2 == 0:
        count_A += d
    else:
        count_B += d
        
print(count_A - count_B)

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
# print("a:{}, b:{}, c:{}".format(n, a, b))
data = sorted(list([n,a,b]), reverse=True)
count_A = 0
count_B = 0

for i, d in enumerate(data):
    if i%2 == 0:
        count_A += d
    else:
        count_B += d
        
print(count_A - count_B)
Problem p03599 (python)

Fixed submission:
A, B, C, D, E, F = map(int, input().split())

density = 0
max_density = 0
ans = []
for a in range(31):
    if a*A*100> F:
        break
    for b in range(31):
        if a==0 and b==0:
            continue
        if a*A*100+b*B*100>F:
            break
        for c in range(101):
            for d in range(101):
                density = 100*(c*C+d*D)/(a*A*100 + b*B*100 + c*C + d*D)
#                 if c==0 and d==0 and max_density <= density:
#                     ans.append("{} {}".format(a*A*100+b*B*100+c*C+d*D, c*C+d*D))
                if a*A*100+b*B*100*c*C+d*D>F:
                    break
#                 print(a*A*100 + b*B*100 + c*C + d*D)
                if ( a*A*100 + b*B*100 + c*C + d*D <= F ) and ( 100*(c*C+d*D)/(a*A*100 + b*B*100 + c*C + d*D) <= 100*E/(100+E) ):
#                     print(density)
#                     print("{} {}".format(a*A*100+b*B*100, c*C+d*D))
                    if max_density <= density:
#                         print(max_density)
                        max_density = density
                        ans.append("{} {}".format(a*A*100+b*B*100+c*C+d*D, c*C+d*D))


print(ans[-1])

Buggy submission (verdict: Runtime Error):
A, B, C, D, E, F = map(int, input().split())

density = 0
max_density = 0
ans = []
for a in range(31):
    if a*A*100> F:
        break
    for b in range(31):
        if a==0 and b==0:
            break
        if a*A*100+b*B*100>F:
            break
        for c in range(101):
            for d in range(101):
                if a*A*100+b*B*100*c*C+d*D>F:
                    break
#                 print(a*A*100 + b*B*100 + c*C + d*D)
                if ( a*A*100 + b*B*100 + c*C + d*D <= F ) and ( 100*(c*C+d*D)/(a*A*100 + b*B*100 + c*C + d*D) <= 100*E/(100+E) ):
                    density = 100*(c*C+d*D)/(a*A*100 + b*B*100 + c*C + d*D)
#                     print(density)
#                     print("{} {}".format(a*A*100+b*B*100, c*C+d*D))
                    if max_density < density:
#                         print(max_density)
                        max_density = density
                        ans.append("{} {}".format(a*A*100+b*B*100+c*C+d*D, c*C+d*D))
print(ans[-1])
Problem p03944 (python)

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

right = W
left = 0
top = H
bottom = 0

for i in range(N):
    x, y, a = map(int, input().split())
    if a == 1 and left <= x:
        left = x
    elif a == 2 and right >= x:
        right = x
    elif a == 3 and bottom <= y:
        bottom = y
    elif a == 4 and top >= y:
        top = y

if (top-bottom)*(right-left) > 0 and (top-bottom)>0 and (right-left)>0:
    print((top-bottom)*(right-left))
else:
    print(0)

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

right = W
left = 0
top = H
bottom = 0

for i in range(N):
    x, y, a = map(int, input().split())
    if a == 1 and left <= x:
        left = x
    elif a == 2 and right >= x:
        right = x
    elif a == 3 and bottom <= y:
        bottom = y
    elif a == 4 and top >= y:
        top = y

if (top-bottom)*(right-left) > 0 and (top-bottom)>0 and (rightt-left)>0:
    print((top-bottom)*(right-left))
else:
    print(0)
Problem p02783 (python)

Fixed submission:
H, A = map(int, input().split())
 
if A > H:
  print(1)
  
else:
  if H % A == 0:
    answer = H // A
  else:
    answer = H // A + 1
  
  print(answer)

Buggy submission (verdict: Runtime Error):
H, A = map(int, input().split())
 
if A > H:
  print(1)
  
else:
  if H % A = 0:
    answer = H // A
  else:
    answer = H // A + 1
  
  print(answer)
Problem p02861 (python)

Fixed submission:
N = int(input())
 
xy = []
for _ in range (N):
  x, y = map(int, input().split())
  xy.append([x, y])
 
nu = 0
for i in range (N):
  for j in range (i,N):
    nu += ((xy[i][0] - xy[j][0])**2 + (xy[i][1] - xy[j][1])**2)**0.5
    
answer = nu * (2/N)
 
print(answer)

Buggy submission (verdict: Runtime Error):
N = int(input())
 
xy = []
for _ in range (N):
  x, y = map(int, input().split())
  xy = xy.append([x, y])
 
nu = 0
for i in range (N):
  for j in range (i,N):
    nu += ((xy[i][0] - xy[j][0])**2 + (xy[i][1] - xy[j][1])**2)**0.5
    
answer = nu * (2/N)
 
print(answer)

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

xy = []
for _ in range N:
  x, y = map(int, input().split())
  xy = xy.append([x, y])

nu = 0
for i in range (N):
  for j in range (i,N):
    nu += ((xy[i][0] - xy[j][0])**2 + (xy[i][1] - xy[j][1])**2)**0.5
    
answer = nu * (2/N)

print(answer)

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

xy = []
for _ in range N:
  x, y = map(int, input().split())
  xy = xy.append([x, y])

nu = 0
for i in range N:
  for j in range (i:N):
    nu += ((xy[i][0] - xy[j][0])**2 + (xy[i][1] - xy[j][1])**2)**0.5
    
answer = nu * (2/N)

print(answer)
Problem p02898 (python)

Fixed submission:
N, K = map(int, input().split())
H = list(map(int, input().split()))
num = 0
for i in H:
    if i >= K:
        num += 1

print(num)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = list(map(int, input().split()))
print(sum(1 if t >= K for t in h))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
H = list(map(int, input().split())
num = 0
for i in H:
    if i >= K:
        num += 1

print(num)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
H = list(map(int, input()split())
num = 0
for i in H:
    if i >= K:
        num += 1

print(num)
Problem p03434 (python)

Fixed submission:
N = int(input())
A = sorted(map(int, input().split()), reverse=True)
print(sum(A[::2])-sum(A[1::2]))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = sorted(map(int, input().split()))
print(A[::2]-A[1::2])
Problem p03448 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0
for a in range (A+1):
    for b in range (B+1):
        for c in range (C+1):
            if a*500 + b*100 + c*50 == X:
                count += 1
print(count)

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

count = 0
for a in range (A+1):
    for b in range (B+1):
        for c in range (C+1):
            if a*500 + b*100 + c*50 = X:
                count += 1
print(count)
Problem p04043 (python)

Fixed submission:
def main():
  a = list(input().split())
  a = [int(aa) for aa in a]
  a = sorted(a)
  if a==[5,5,7]:
    print('YES')
  else:
    print('NO')
  
  
if __name__ == "__main__":
  main()

Buggy submission (verdict: Runtime Error):
def main():
  print("aaa")
  a = list(input())
  a = [int(aa) for aa in a]
  a = sorted(a)
  if a==[5,7,7]:
    return "YES"
  else:
    return "NO"
  
  
if __name__ == "__main__":
  main()

Buggy submission (verdict: Runtime Error):
def main(a):
  print("aaa")
  
if __name__ == "__main__":
  main(a)
Problem p02772 (python)

Fixed submission:
n= input()
n = int(n)
nums= input().split()
#map(int,input().split())
state = 1
for i in range(n):
    if int(nums[i]) &1 == 0 :
        if int(nums[i])%3 ==0 or int(nums[i])%5 ==0:
            continue
        else:
            state= 0
            #print("DENIED")
            break
if state == 1:
    print("APPROVED")
else:
    print("DENIED")

Buggy submission (verdict: Runtime Error):
n= input().split()
n = int(n)
nums= input().split()
#map(int,input().split())
state = 1
for i in range(n):
    if nums[i] &1 == 0 :
        if nums[i]%3 ==0 or nums[i]%5 ==0:
            continue
        else:
            state= 0
            #print("DENIED")
            break
if state == 1:
    print("APPROVED")
else:
    print("DENIED")
Problem p02717 (python)

Fixed submission:
x,y,z = map(int,input().split())
print(str(z)+" " +str(x)+" "+str(y) )

Buggy submission (verdict: Runtime Error):
x,y,z = map(int(input()))
print(str(z)+" " +str(x)+" "+str(y) )
Problem p02801 (python)

Fixed submission:
a = input()


print(chr(ord(a) + 1))

Buggy submission (verdict: Runtime Error):
import sys
n, m = map(int, input().split())
wa, ac = 0, 0
memo = []
hi = n
if n < m:
    hi = m
b = [0] * hi
table = [sys.stdin.readline().split() for x in range(m)]
for x in range(m):
    if table[x][1] == 'AC' and not table[x][0] in memo:
        memo.append(table[x][0])
        ac += 1
        wa += b[int(table[x][0])]
    elif table[x][1] == 'WA':
        b[int(table[x][0])] += 1
print(ac, wa)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
cnt = 0
wa = 0
ac = 0
sumi = []
b = {}
for x in range(m):
    a = input().split()
    if a[1] == 'WA':
        try:
            b[a[0]] += 1
        except KeyError:
            b[a[0]] = 1
    if a[1] == 'AC' and not a[0] in sumi:
        sumi.append(a[0])
        ac += 1
        try:
            wa += b[a[0]]
        except KeyError:
            continue
print(ac, wa)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
cnt = 0
wa = 0
ac = 0
sumi = []
b = {}
for x in range(m):
    a = input().split()
    if a[1] == 'WA' and not a[0] in sumi:
        try:
            b[a[0]] += 1
        except KeyError:
            b[a[0]] = 1
    elif a[1] == 'AC' and not a[0] in sumi:

        sumi.append(a[0])
        ac += 1
        try:
            wa += b[a[0]]
        except KeyError:
            continue
print(ac, wa)
Problem p02812 (python)

Fixed submission:
n = int(input())
table = list(input())
cnt = 0
for x in range(n - 2):
    if table[x] == 'A' and table[x + 1] == 'B' and table[x + 2] == 'C':
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
table = list(input())
cnt = 0
for x in range(n):
    if table[x] == 'A' and table[x + 1] == 'B' and table[x + 2] == 'C':
        cnt += 1
print(cnt)
Problem p02755 (python)

Fixed submission:
import math
a = list(map(int,input().split()))

flag = False
for i in range(1001):
  if math.floor(i*0.08) == a[0]:
    if math.floor(i*0.1) == a[1]:
      flag = True
      break

if flag:
  print(i)
else:
  print("-1")

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

t = 0
for i in range(n):
  a = input().split()
  if int(a[0]) == 1:
    t += 1
    #s = s[::-1]
  else:
    if t % 2 == 1:
      s = s[::-1]
    t = 0
    if int(a[1]) == 1:
      s = a[2] + s
    if int(a[1]) == 2:
      s = s + a[2]
    
print(s)