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

Fixed submission:
coin = int(input())
fivet_yen = 0
five_yen = 0
if coin == 0:
    print(0)
else:
   while(coin > 0):
    if coin >= 500:
        coin = coin - 500
        fivet_yen = fivet_yen + 1000
    else:
        if coin >= 5:
            coin = coin - 5
            five_yen   = five_yen + 5
        else:  
            coin = coin - 1
   print(fivet_yen + five_yen)

Buggy submission (verdict: Runtime Error):
    coin = int(input())
    fivet_yen = 0
    five_yen = 0
    if coin == 0:
        print(0)
    else:
    while(coin > 0):
        if coin >= 500:
            coin = coin - 500
            fivet_yen = fivet_yen + 1000
        else:
            if coin >= 5:
                coin = coin - 5
                five_yen   = five_yen + 5
            else:    
                coin = coin - 1


    print(fivet_yen + five_yen)
Problem p02811 (python)

Fixed submission:
k,x = [int(x) for x in input().split()]

k = k * 500 

if k >= x:
  print("Yes")
else:
	print("No")

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

k = k * 500 

if k >= x:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
k,x= int(raw_input()), int(raw_input())

k = k * 500 

if k >= x:
  print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
k,x= int(raw_input()), int(raw_input())

k = k * 500 

if k >= x:
  print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
k = int(input())
x = int(input())

k = k * 500 

if k > x:
   	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
k = int(input())
x = int(input())

k = k * 500 

if k > x:
   	print("Yes")
else:
	print("No")
Problem p02742 (python)

Fixed submission:
i=0
H, W=map(int,input().split())
if H==1 or W==1:
  i=1
elif H%2==1:
  if W%2==1:
    i+=((W+1)//2)*((H+1)//2)+(W//2)*(H//2)
  elif W%2==0:
    i+=(W//2)*((H+1)//2)+(W//2)*(H//2)
elif H%2==0:
  if W%2==1:
    i+=((W+1)//2)*(H//2)+(W//2)*(H//2)
  elif W%2==0:
    i+=(W//2)*(H//2)+(W//2)*(H//2)
print(i)

Buggy submission (verdict: Runtime Error):
i=0
H, W=map(int,input().split())
if H%2==1:
  if W%2==1:
    i+=((W+1)//2)*((H+1)//2)+(W//2)*(H//2)
  else:
    i+=(W//2)*((H+1)//2)+((W//2)*(H//2)
else:
  if W%2==1:
    i+=((W+1)//2)*(H//2)+(W//2)*(H//2)
  else:
    i+=(W//2)*(H//2)+(W//2)*(H//2)
print(i)
Problem p03997 (python)

Fixed submission:
input = open(0).readline

x = [0]*3
for i in range(3):
    x[i] = int(input().strip())
a, b, h = x[0], x[1], x[2]
ans = int(((a + b) * h)/2)
print(ans)

Buggy submission (verdict: Runtime Error):
input = open(0).readline
s = {}
s['A'] = list(input().strip())
s['B'] = list(input().strip())
s['C'] = list(input().strip())

play_order = {'A':'B', 'B':'C', 'C':'A'}

def play(player):
    
    if  len(s[player]) == []:
        play(play_order[player])
    
    next_play = s[player].pop()
    if len(s[player]) == 0:
        print(player)
        return player
    #print(next_play)
    play(next_play.upper())
        
print(play('A'))

Buggy submission (verdict: Runtime Error):
input = open(0).readline
s = {}
s['A'] = list(input().strip())
s['B'] = list(input().strip())
s['C'] = list(input().strip())

play_order = {'A':'B', 'B':'C', 'C':'A'}

def play(player):
    

    
    next_play = s[player].pop()
    if len(s[player]) == 0:
        
        return player
    #print(next_play)
    play(next_play.upper())
        
print(play('A'))

Buggy submission (verdict: Runtime Error):
input = open(0).readline
s = {}
s['A'] = list(input().strip())
s['B'] = list(input().strip())
s['C'] = list(input().strip())

play_order = {'A':'B', 'B':'C', 'C':'A'}

def play(player):
    
    if  len(s[player]) == 0:
        play(play_order[player])
    
    next_play = s[player].pop()
    if len(s[player]) == 0:
        
        return player
    #print(next_play)
    play(next_play.upper())
        
print(play('A'))

Buggy submission (verdict: Runtime Error):
input = open(0).readline
s = {}
s['A'] = list(input().strip())
s['B'] = list(input().strip())
s['C'] = list(input().strip())

play_order = {'A':'B', 'B':'C', 'C':'A'}

def play(player):
    
    if  len(s[player]) == 0:
        play(play_order[player])
    
    next_play = s[player].pop()
    if len(s[player]) == 0:
        print(player)
        return player
    #print(next_play)
    play(next_play.upper())
        
play('A')

Buggy submission (verdict: Runtime Error):
input = open(0).readline
s = {}
s['A'] = list(input().strip())
s['B'] = list(input().strip())
s['C'] = list(input().strip())

play_order = {'A':'B', 'B':'C', 'C':'A'}

def play(player):
    
    if  len(s[player]) == 0:
        play(play_order['A'])
    
    next_play = s[player].pop()
    if len(s[player]) == 0:
        print(player)
        return player
    #print(next_play)
    play(next_play.upper())
        
play('A')
Problem p02731 (python)

Fixed submission:
if __name__ == "__main__":
    l = int(input())
    m = (l/3)**3
    print(m)

Buggy submission (verdict: Runtime Error):
    l = int(input())
    m = (l/3)**3
    print(m)
Problem p02742 (python)

Fixed submission:
def b():
    h, w = map(int, input().split())
    if (h == 1) or (w == 1):
        print("1")
    else:
        ki = int(h / 2) + h % 2
        gu = int(h / 2)

        sum_ki = ki * (int(w / 2) + w % 2)
        sum_gu = gu * (int(w / 2))
        print(sum_ki + sum_gu)


def c():
    a, b, c = map(int, input().split())
    ab = 4 * a * b
    a_b_c = c - (a + b)
    a_b_c_2 = a_b_c ** 2
    if a_b_c <= 0:
        print("No")
    else:
        if ab < a_b_c_2:
            print("Yes")
        else:
            print("No")


if __name__ == "__main__":
    b()

Buggy submission (verdict: Runtime Error):
    h, w = map(int, input().split())
    ki = int(h/2) + h%2
    gu = int(h/2)

    sum_ki = ki *(int(w/2) + w%2)
    sum_gu = gu * (int(w / 2) )
    print(sum_ki+sum_gu)

Buggy submission (verdict: Runtime Error):
    h, w = map(int, input().split())
    # h,w=1000000000, 1000000000
    ki = int(h/2) + h%2
    gu = int(h/2)

    sum_ki = ki *(int(w/2) + w%2)
    sum_gu = gu * (int(w / 2) )
    print(sum_ki+sum_gu)
Problem p03048 (python)

Fixed submission:
a, b, c, n = map(int, input().split())
aa =[a,b,c]
aa.sort()
r = aa[2]
g = aa[1]
b = aa[0]
 
count = 0
for i_r in range(0,int(n/r)+1):
    if (n - r*i_r)<0:continue
    for i_g in range(0,int((n-r*i_r)/g)+1):
        if (n - r*i_r - g*i_g)<0:continue
        if 0==((n - r*i_r - g*i_g)%b):
 
            count = count + 1
 
print(count)

Buggy submission (verdict: Runtime Error):
import numpy as np
a, b, c, n = map(int, input().split())
aa =[a,b,c]
r = max(aa)
b = min(aa)
g = int(np.median(aa))
count = 0
for i_r in range(0,int(n/r)+1):
    if (n - r*i_r)<0:continue
    for i_g in range(0,int(n/g)+1):
        if (n - r*i_r - g*i_g)<0:continue
        if 0==((n - r*i_r - g*i_g)%b):

            count +=1

print(count)
Problem p03361 (python)

Fixed submission:
h, w = map(int, input().split())
S = [input() for i in range(h)]


picture = []
diff = [-1, 1]

for i_h in range(h):
    row = ''
    for i_w in range(w):
        can_draw = False
        if S[i_h][i_w] == '.': row = row + '.';continue
        else:
            for dh in diff:
                if (i_h+dh<0) or (i_h+dh>h-1):continue
                if S[i_h+dh][i_w] == '#':
                    can_draw = True
            for dw in diff:
                if (i_w+dw<0) or (i_w+dw>w-1):continue
                if S[i_h][i_w+dw] == '#':
                    can_draw = True
                    
        if can_draw:
            row = row + '#'
        else:
            row = row + '.'
    picture.append(row)
    
if picture == S:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
S = [input() for i in range(h)]


picture = []
diff = [-1, 1]

for i_h in range(h):
    row = '...'
    for i_w in range(w):
        if S[i_h][i_w] == '.':continue
        else:
            for dh in diff:
                if (i_h+dh<0) or (i_h+dh>h-1):continue
                if S[i_h+dh][i_w] == '#':
                    row[i_w] = '#'
            for dw in diff:
                if (i_w+dw<0) or (i_w+dw<w-1):continue
                if S[i_h][i_w+dw] == '#':
                    row[i_w] = '#'
    picture.append(row)
    
if picture == S:
    print('Yes')
else:
    print('No')
Problem p03632 (python)

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

print(max(0, min(d,b)-max(c,a)))

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


if b<=c:
    print ('0')
    exit()
elif:
    if b>=d:
        print(d-c)
        exit()
    elif b<d:
        print(b-c)
        exit()
Problem p02783 (python)

Fixed submission:
s = list(map(int,input().split()))
a = s[0] // s[1]
b = s[0] % s[1]
if b != 0:
  a +=1
print(a)

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

a=s[0]
for i in range(s[1]):
  a -= m[i]

if a <= 0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = [list(map(int,input().split())) for i in range(2)]

a=s[0][0]
for i in range(s[0][1]):
  a -= s[1][i]

if a <= 0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = [list(map(int,input().split())) for i in range(2)]

a=s[0][0]
for i in range(s[0][1]):
  a -= s[1][i]

if a <= 0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = [list(map(int,input().split())) for i in range(2)]

a=0
for i in range(s[0][1]):
  a += s[1][i]

r = "Yes"
if a < s[0][0]:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
s = [list(map(int,input().split())) for i in range(2)]

p = s[0][0]
a = 0
for i in range(s[0][1]):
  a += s[1][i]

r = "Yes"
if p > a:
  r = "No"

print(r)

Buggy submission (verdict: Runtime Error):
s = [list(map(int,input().split())) for i in range(2)]

p = s[0][0]
a = 0
for i in range(s[0][1]):
  a += s[1][i]

r = "Yes"
if p > a:
  r = "No"

print(r)
Problem p02741 (python)

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

Buggy submission (verdict: Runtime Error):
K = int(input())
W = [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]
K = k + 1
print(W[K])

Buggy submission (verdict: Runtime Error):
K = int(input())
R = [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(R[K])
Problem p02778 (python)

Fixed submission:
S = input()

print("x" * len(S))

Buggy submission (verdict: Runtime Error):
S ＝ input()
print("x" * len(S))
Problem p02795 (python)

Fixed submission:
H = int(input())
W = int(input())
M = int(input())

if H <= W:
    for i in range(1, H + 1):
        if W * i >= M:
            print(i)
            break
            
else:
    for k in range(1, W + 1):
        if H * k >= M:
            print(k)
            break

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

if H <= W:
    for i in range(1, H + 1):
        if W * i >= M:
            print(i)

elif:
    for k in range(1, W + 1):
        if H * k >= M:
            print(k)

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

if H <= W:
    for i in range(1, H + 1):
    if W * i => M:
        print(i)

elif:
    for k in range(1, W + 1):
    if H * k => M:
        print(k)

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

if H <= W:
    for i in range(1, H + 1):
        if W * i => M:
            print(i)

elif:
    for k in range(1, W + 1):
        if H * k => M:
            print(k)
Problem p02885 (python)

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

s = A - 2 * B 

if s <= 0:
    print(0)
else:
    print(s)

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

s = A - 2B

if s <= 0:
    print(0)
else:
    print(s)
Problem p02886 (python)

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

import itertools

boxes = []
data = []

for i in itertools.combinations(box, 2): 
    boxes.append(i)

for k in boxes:
    data.append(k[0] * k[1])

i = 0 

for r in data:
    i = r + i 

print(i)

Buggy submission (verdict: Runtime Error):
Last login: Fri Oct 18 22:40:34 on ttys000

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
nakamurashuntaMacBook-Pro:~ n.shunta$ vim a.py
nakamurashuntaMacBook-Pro:~ n.shunta$ python a.py
  File "a.py", line 3
    s = A - 2B
             ^
SyntaxError: invalid syntax
nakamurashuntaMacBook-Pro:~ n.shunta$ vim a.py
nakamurashuntaMacBook-Pro:~ n.shunta$ python a.py
12 4
Traceback (most recent call last):
  File "a.py", line 1, in <module>
    A, B = map(int, input().split)
TypeError: 'builtin_function_or_method' object is not iterable
nakamurashuntaMacBook-Pro:~ n.shunta$ vim a.py
nakamurashuntaMacBook-Pro:~ n.shunta$ python a.py
12 4
4
nakamurashuntaMacBook-Pro:~ n.shunta$ vim a.py
nakamurashuntaMacBook-Pro:~ n.shunta$ vim k.py
nakamurashuntaMacBook-Pro:~ n.shunta$ python k.py
(2, 3, 4)
nakamurashuntaMacBook-Pro:~ n.shunta$ vi k.py
nakamurashuntaMacBook-Pro:~ n.shunta$ python k.py
4
nakamurashuntaMacBook-Pro:~ n.shunta$ rm k.py
nakamurashuntaMacBook-Pro:~ n.shunta$ vim a.py
nakamurashuntaMacBook-Pro:~ n.shunta$ python a.py
  File "a.py", line 17
    for r in data
                ^
SyntaxError: invalid syntax
nakamurashuntaMacBook-Pro:~ n.shunta$ vim a.py
nakamurashuntaMacBook-Pro:~ n.shunta$ python a.py
3
3 1 2
22
nakamurashuntaMacBook-Pro:~ n.shunta$ vim a.py
nakamurashuntaMacBook-Pro:~ n.shunta$ python a.py
3
3 1 2
(3, 1)
(3, 2)
(1, 3)
(1, 2)
(2, 3)
(2, 1)
22
nakamurashuntaMacBook-Pro:~ n.shunta$ vim a.py
nakamurashuntaMacBook-Pro:~ n.shunta$ python a.py
  File "a.py", line 9
    for i in itertools.combinations(box, 2)
                                          ^
SyntaxError: invalid syntax
nakamurashuntaMacBook-Pro:~ n.shunta$ vim a.py
nakamurashuntaMacBook-Pro:~ n.shunta$ python a.py
3
3 1 2
(3, 1)
(3, 2)
(1, 2)
11
nakamurashuntaMacBook-Pro:~ n.shunta$ vim a.py
nakamurashuntaMacBook-Pro:~ n.shunta$ vim a.py

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

import itertools

boxes = []
data = []

for i in itertools.combinations(box, 2): 
    boxes.append(i)

for k in boxes:
    data.append(k[0] * k[1])

i = 0 

for r in data:
    i = r + i 

print(i)
Problem p02921 (python)

Fixed submission:
s = input()
t = input()
ans = 0
for i in range(3):
	if s[i] == t[i]:
		ans += 1
	else:
		continue
print(str(ans))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a>=b:
	print(1)
else:
	print(str(b//a+1))
Problem p02971 (python)

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]
m1 = max(a)
c = a.count(m1)
if len(set(a)) == 1:
	for i in range(n):
		print(m1)
else:
	m2 = sorted(set(a))[-2]
	for i in range(n):
		if a[i] < m1:
			print(m1)
		elif a[i] == m1:
			if c > 1:
				print(m1)
			else:
				print(m2)
		else:
			print(m2)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]
m1 = max(a)
m2 = sorted(set(a))[-2]
for j in range(n):
	if a[j] < m1:
		print(m1)
	elif a[j] == m1:
		if a.count(m1) > 1:
			print(m1)
		else:
			print(m2)
	else:
		print(m2)
Problem p02975 (python)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
a_uni = list(set(a))
if len(a_uni) == 1:
	if a[0] == 0:
		print("Yes")
	else:
		print("No")
elif n%3 != 0:
	print("No")
elif len(a_uni) == 2:
	if a.count(0) == n/3:
		print("Yes")	
	else:
		print("No")	
elif len(a_uni) == 3:
	if a_uni[0]^a_uni[1]!=a_uni[2]:
		print("No")
	elif a.count(a_uni[0])==n/3 and a.count(a_uni[1])==n/3:
		print("Yes")
	else:
		print("No")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
a_uni = list(set(a))
if len(a_uni) == 1:
	if a[0] == 0:
		print("Yes")
	else
		print("No")
elif n%3 != 0:
	print("No")
elif len(a_uni) == 2:
	if a.count(0) == n/3:
		print("Yes")	
	else:
		print("No")	
elif len(a_uni) == 3:
	if a_uni[0]^a_uni[1]!=a_uni[2]:
		print("No")
	elif a.count(a_uni[0])==n/3 and a.count(a_uni[1])==n/3:
		print("Yes")
	else:
		print("No")
else:
	print("No")
Problem p02981 (python)

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

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
if n*a < b
	print (n*a)
else: 
	print (b)

Buggy submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
if n*a < b
	print n*a
else: 
	print b
Problem p02982 (python)

Fixed submission:
#入力
n, d = map(int, input().split())
point = [[int(i) for i in input().split()] for j in range(n)]
#点1から計算する
m = 0
for i in range(n):
	for j in range(i+1,n):
		a = 0
		for k in range(d):
			a += (point[i][k]-point[j][k])**2
		b = a**(1/2)
		if b.is_integer():
			m += 1
print(m)

Buggy submission (verdict: Runtime Error):
#入力
n, d = map(int, input().split())
point = [[int(i) for i in input().split()] for j in range(n)]
#点1から計算する
m = 0
for i in range(n):
	for j in range(i+1,n):
		a = 0
		for k in range(d):
			a += (point[i][k]-pont[j][k])**2
		if isinstance(a**0.5, int) 
		m += 1
print(m)

Buggy submission (verdict: Runtime Error):
#入力
n, d = map(int, input().split())
point = [[int(i) for i in input().split()] for n in range(n)]
#点1から計算する
m = 0
for i in range(n):
	for j in range(i+1,n):
		a = 0
		for k in range(d):
			a += (point[i][k]-pont[j][k])**2
		if isinstance(a ** 0.5, int) 
		m += 1
print(m)

Buggy submission (verdict: Runtime Error):
#入力
n, d = map(int, input().split())
point = [int(input()) for i in range(n)]
#点1から計算する
m = 0
for i in range(n):
	for j in range(i+1,n):
		a = 0
		for k in range(d):
			a += (point[i][k]-pont[j][k])**2
		if isinstance(a ** 0.5, int) 
		m += 0
print(m)
Problem p02909 (python)

Fixed submission:
today = input()
weather = ["Sunny", "Cloudy", "Rainy"]
i = 0
for v in weather:
  if today == v:
    print(weather[(i+1)%3])
  i += 1

Buggy submission (verdict: Runtime Error):
today = input()
weather = ["Sunny", "Cloudy", "Rainy"]
i = 0
for v in weather:
  if today == v:
    print(weather[(i+1)%3+1])
  i += 1
Problem p03110 (python)

Fixed submission:
N = int(input())
EBTC = 380000.0
R = 0
for i in range(N):
    t = [x for x in input().split()]
    R = R + float(t[0]) if t[1]=="JPY" else R + float(t[0])*EBTC
print(R)

Buggy submission (verdict: Runtime Error):
N = float(input())
EBTC = 380000.0
R = 0
for i in range(N):
    t = [x for x in input().split()]
    R = R + float(t[0]) if t[1]=="JPY" else R + float(t[0])*EBTC
print(int(R))
Problem p02969 (python)

Fixed submission:
r = int(input())
print(3 * r * r)

Buggy submission (verdict: Runtime Error):
r = input()
print(3 * r * r)

Buggy submission (verdict: Runtime Error):
r = input()
print(2 * r * r)
Problem p03047 (python)

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

print(N-K+1)

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

print(N-K+1)
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 = 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 = input()
S_lr = []
for i in range(Q):
    l, r = map(int, input().split())
    s = S[l-1:r]
    S_lr.append(s)

import re

for s in S_lr:
    count = len(re.findall('AC', s))
    print(count)

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
S = input()
S_lr = []
for i in range(Q):
    l, r = map(int, input().split())
    s = S[l-1:r]
    S_lr.append(s)

for s in S_lr:
    count = 0
    A_flag = False
    for i in range(len(s)):
        if s[i] == 'C' and i-1 > -1 and s[i-1] == 'A':
            count += 1

    print(count)
Problem p03214 (python)

Fixed submission:
import numpy as np

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

mean = np.mean(a)

idx = np.abs(np.asarray(a) - mean).argmin()

print(idx)

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

N = int(input())
a = []
for i in range(N):
    a.append(int(input()))

mean = np.mean(a)

idx = np.abs(np.asarray(a) - mean).argmin()

print(idx)
Problem p02761 (python)

Fixed submission:
n, m = map(int, input().split())
t = [-1] * n
for _ in range(m):
    s, c = map(int, input().split())
    s -= 1
    if t[s] != -1 and t[s] != c:
        print(-1)
        exit()
    t[s] = c

if n != 1:
    if t[0] == 0:
        print(-1)
        exit()
    if t[0] == -1:
        t[0] = 1
    for i in range(n):
        if t[i] == -1:
            t[i] = 0
else:
    if t[0] == -1:
        t[0] = 0
    
print(''.join(map(str, t)))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
t = [-1] * n
for _ in range(m):
    s, c = map(int, input().split())
    s -= 1
    if t[s] != c and t[s] != -1:
        print(-1)
        exit()
    t[s] = c

if n != 1:
    if t[0] == 0:
        print(-1)
        exit()
    for i in range(m):
        if t[i] == -1:
            t[i] = 0
    else:
        if t[0] == -1:
            t[0] = 0

print(''.join(map(str, t)))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
t = [-1] * n
for _ in range(m):
    s, c = map(int, input().split())
    s -= 1
    if t[s] != c and t[s] != -1:
        print(-1)
        exit()
    t[s] = c

if n != 1:
    if t[0] == 0:
        print(-1)
        exit()
    for i in range(m):
        if t[i] == -1:
            t[i] = 0
    else:
        if t[0] == -1:
            t[0] = 0

print(''.join(map(str, t)))
Problem p02791 (python)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
count = 0
min = p[0]

for i in range(n):
    if min >= p[i]:
        count += 1
        min = p[i]

print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))
j = 1
count = 0

for i in range(0,n):
    if p[j] >= p[i]:
        print(p[j-1])
        count += 1

print(count)
Problem p02812 (python)

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

print(s.count('ABC'))

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


for i in range(n-2):
    if s[i:i+3] == "ABC":
        res += 1

print(ans)

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


for i in range(n-2):
    if s[i:i+3] == "ABC":
        res += 1

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
 s = input()
 ans = 0
 for i in range(n - 2):
     if s[i:i+3] == 'ABC':
         ans += 1 
 print(ans)

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


for i in range(n):
    if s[i:i+3] == 'ABC':
        res += 1

print(ans)

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

while i < n:
    if s[i] == 'A':
        if s[i+1] == 'B':
            if s[i+2] == 'C':
                count += 1
                i += 2
    i += 1

print(count)
Problem p03951 (python)

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

r = n
for i in range(0, n):
    if s[i:] == t[:(n-i)]:
            break
    r += 1

print(r)

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

if s == t:
    print(n)
    return

r = 0
for i in range(0, n):
    if s[-(i + 1)] != t[i]:
        break
    r += 1

print((n * 2) - r)