Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]
ans=len(s)

for i in range(n):
  for j in range(m):
    if s[i] == s[j]:
      ans-=1
if ans < 0:
  print("0")
else:
  print(ans)

Fixed submission:
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]
ans = 0
for i in range(n):
  tmp=0
  for j in range(n):
    if s[i] == s[j]:
      tmp+=1
  for j in range(m):
    if s[i] == t[j]:
      tmp-=1
  ans=max(ans,tmp)
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=0
for i in range(a,b+1):
  if str(i)[::0] == str(i):
    c += 1
print(c)


Fixed submission:
a,b=map(int,input().split())
c=0
for i in range(a,b+1):
  if str(i)[::-1] == str(i):
    c += 1
print(c)

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=0
for i range(a,b+1):
  if str(i)[::0] == str(i):
    c += 1
print(c)

Fixed submission:
a,b=map(int,input().split())
c=0
for i in range(a,b+1):
  if str(i)[::-1] == str(i):
    c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

a.sort(reverse=True)
print(sun(a[::2])-sun(a[1::2]))

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

a.sort(reverse=True)
print(sum(a[::2])-sum(a[1::2]))
Buggy python submission (verdict: Runtime Error):
X = int(input())
A = int(input())
B = int(input())

tmp=X-A

while tmp => B:
  tmp=tmp-B
print(tmp)


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

tmp=X-A

while tmp >= B:
  tmp=tmp-B
print(tmp)
Buggy python submission (verdict: Runtime Error):
a = input()
a = int(a)

b = input()
b = int(b)

c = input()
c = int(c)

d = input()
d = int(d)

ans = 0

for i in range(0, a+1):
  for j in range(0, b+1):
    for k in range(0, c+1):
      if x == i*500 + j*100 + k*50:
        ans = ans + 1

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
ans = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if d == 500*i + 100*j + 50*k:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input())
if a*b%2==0:
  print("Even")
else:
  print("Odd")

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

if(a*b)%2 == 0:
  print("Even")
else:
  print("Odd")
Buggy python submission (verdict: Runtime Error):
N,Y = map(int,input().split())
ans = "-1 -1 -1"
for i in range(1,N+1):
  for j in range(1,N+1):
    k = N-i-j
    if i*10000 + j*5000 + k*1000 == Y:
      ans=(i + " " + j + " " + k)
      break
    else:
      continue
print(ans)


Fixed submission:
N,Y = map(int,input().split())
for i in range(N+1):
  for j in range(N-i+1):
    k = N-i-j
    if i*10000 + j*5000 + k*1000 == Y:
      print(i,j,k)
      exit()
print("-1 -1 -1")

Buggy python submission (verdict: Runtime Error):
N,Y = map(int,input().split())
ans = "-1 -1 -1"
for i in range(N):
  for j in range(N):
    k = N-i-j
    if i*10000 + j*5000 + k*1000 == Y:
      ans=(i + " " + j + " " + k)
      break
print(ans)


Fixed submission:
N,Y = map(int,input().split())
for i in range(N+1):
  for j in range(N-i+1):
    k = N-i-j
    if i*10000 + j*5000 + k*1000 == Y:
      print(i,j,k)
      exit()
print("-1 -1 -1")

Buggy python submission (verdict: Runtime Error):
N,Y = map(int,input().split())
for i in range(N):
  for j in range(N):
    for k in range(N):
      if i*10000 + j*5000 + k*1000 == Y:
        print(i + " " + j + " " + k)
        break
else:
  print("-1 -1 -1")

Fixed submission:
N,Y = map(int,input().split())
for i in range(N+1):
  for j in range(N-i+1):
    k = N-i-j
    if i*10000 + j*5000 + k*1000 == Y:
      print(i,j,k)
      exit()
print("-1 -1 -1")
Buggy python submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
ans = 0
for i in range(1,N+1):
  sum = 0
  while j !=0:
    sum += j % 10
    j = j//10
  if A <= sum <= B:
    ans += i
print(ans)

Fixed submission:
n,a,b=map(int,input().split())
cnt = 0
for i in range(1,n+1):
  s= i%10 + i//10%10 + i//100%10 + i//1000%10 + i//10000%10
  if a<=s<=b:
    cnt+=i
print(cnt)
Buggy python submission (verdict: Runtime Error):
S=input()
T=input()

s = ''.join(sorted(list(S))
t = ''.join(sorted(list(T), reverse=True))

if s < t:
  print('Yes')
else:
  print('No')

Fixed submission:
S=input()
T=input()

s = ''.join(sorted(list(S)))
t = ''.join(sorted(list(T), reverse=True))

if s < t:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(int,input().split())
cnt=0

while all(i%2 == 0 for i in A):
  A = [i/2 for i in A]
  cnt+=1
print(cnt)


Fixed submission:
input()

A = list(map(int, input().split(" ")))
B = 0

while all(a%2 == 0 for a in A):
  A = [a/2 for a in A]
  B += 1

print(B)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[input() for i in range(N)]
cnt=0

while all(i%2 == 0 for i in A):
  A = [i/2 for i in A]
  cnt+=1
print(cnt)


Fixed submission:
input()

A = list(map(int, input().split(" ")))
B = 0

while all(a%2 == 0 for a in A):
  A = [a/2 for a in A]
  B += 1

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

if B > C and C < D: # normal
  print(B-C)
elif B > C and B > D:
  print(D-C)
elif:
  print(0)
  
#elif B < C:
#  print(0)


Fixed submission:
A,B,C,D=map(int,input().split())
ans = min(B,D) - max(A,C)
if ans < 0:
  print(0)
else:
  print(ans)
Buggy python submission (verdict: Runtime Error):
a = input()
print([:1]+str(len(a)-2)+[-1:])


Fixed submission:
a = input()
print(a[:1]+str(len(a)-2)+a[-1:])

Buggy python submission (verdict: Runtime Error):
a = input()
print([:1]+(len(a)-2)+[-1:])

Fixed submission:
a = input()
print(a[:1]+str(len(a)-2)+a[-1:])
Buggy python submission (verdict: Runtime Error):
s = input()
head = s.fine("A")
tail = s.rfind("Z")
print(tail - head +1)

Fixed submission:
s = input()
head = s.find("A")
tail = s.rfind("Z")
print(tail - head +1)
Buggy python submission (verdict: Time Limit Exceeded):
K,S = map(int,input().split())
cnt = 0

for i in range(K+1):
  for j in range(K+1):
    for k in range(K+1):
      if i + j + k == S:
        cnt+=1

print(cnt)

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

for i in range(K+1):
  for j in range(K+1):
      if (S - i - j) <= K:
        if S - i - j >= 0:
          cnt+=1
          
print(cnt)

Buggy python submission (verdict: Runtime Error):
K,S=map(int,input())
cnt = 0
for x in range(K+1):
  for y in range(K+1):
    if 0 <= S-x-y <= K:
      cnt += 1
print(cnt)

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

for i in range(K+1):
  for j in range(K+1):
      if (S - i - j) <= K:
        if S - i - j >= 0:
          cnt+=1
          
print(cnt)
Buggy python submission (verdict: Runtime Error):
H,W=map(int,input().split())
for i in range(a):
  x = input()
  print(x)
  print(x)

Fixed submission:
H,W=map(int,input().split())
for i in range(H):
  x = input()
  print(x)
  print(x)
Buggy python submission (verdict: Runtime Error):
N,L=map(int,input())
S=[input() for i in range(N)]
S.sort()
print(*S,sep="")


Fixed submission:
N,L=map(int,input().split())
S=[input() for i in range(N)]
S.sort()
print(*S,sep="")

Buggy python submission (verdict: Runtime Error):
N,L=map(int,input())
S=sorted(list(map(int,input())))
ans = ""
for x in S:
  ans += x
print(ans)

Fixed submission:
N,L=map(int,input().split())
S=[input() for i in range(N)]
S.sort()
print(*S,sep="")
Buggy python submission (verdict: Runtime Error):
N,M=list(map(int,input().split()))

g=[[] for i in range(M+1)]

for i in range(M):
	a,b=list(map(int,input().split()))
	g[a].append(b)
	g[b].append(a)

from collections import deque

queue = deque([1])
d = [None] * (N+1)
d[1] = 0
while queue:
	v = queue.popleft()
	for i in g[v]:
		if d[i] is None:
			d[i] = v
			queue.append(i)

print("Yes")
for i in range(2,N+1):
	print(d[i])

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

g=[[] for i in range(N+1)]

for i in range(M):
	a,b=list(map(int,input().split()))
	g[a].append(b)
	g[b].append(a)

from collections import deque

queue = deque([1])
d = [None] * (N+1)
while queue:
	v = queue.popleft()
	for i in g[v]:
		if d[i] is None:
			d[i] = v
			queue.append(i)

print("Yes")
for i in range(2,N+1):
	print(d[i])
Buggy python submission (verdict: Time Limit Exceeded):
N,M=list(map(int,input().split()))
H=list(map(int,input().split()))

bad=[]
for i in range(M):
	A,B=list(map(int,input().split()))
	if (H[A-1]<=H[B-1])and(A-1 not in bad): bad.append(A-1)
	if (H[A-1]>=H[B-1])and(B-1 not in bad): bad.append(B-1)

print(N-len(bad))

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

bad=set()
c=0
for i in range(M):
	A,B=list(map(int,input().split()))
	if (H[A-1]<=H[B-1])and(A-1 not in bad):
		bad.add(A-1)
	if (H[A-1]>=H[B-1])and(B-1 not in bad):
		bad.add(B-1)

print(N-len(bad))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())

S=[]
for i in range(N):
	x=input()
	if x not in S:
		S.append(x)

print(len(S))

Fixed submission:
import collections

N=int(input())

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

print(len(collections.Counter(S)))
Buggy python submission (verdict: Time Limit Exceeded):
s=input()


i=0
c=0
flag=0
while True:
	if i>len(s)-2: break
	if s[i]=="A":
		flag+=1
		i+=1
	elif flag and s[i:i+2]=="BC":
		s=s[:i-flag]+"BC"+"A"*flag+s[i+2:]
		c+=flag
		i+=2
	else:
		flag=0
		i+=1

print(c)



Fixed submission:
s=input()


i=0
c=0
flag=0
while True:
	if i>len(s)-2: break
	if s[i]=="A":
		flag+=1
		i+=1
	elif flag and s[i:i+2]=="BC":
		c+=flag
		i+=2
	else:
		flag=0
		i+=1

print(c)

Buggy python submission (verdict: Time Limit Exceeded):
s=input()


i=0
c=0
flag=0
while True:
	if i>len(s)-3: break
	if s[i:i+3]=="ABC":
		j=i
		d=0
		while True:
			if j<0: break
			if s[j]=="A":
				d+=1
				j-=1
			else: break
		s=s[:i-d+1]+"BC"+"A"*d+s[i+3:]
		c+=d
		i+=1
		continue
	else: i+=1

print(c)


Fixed submission:
s=input()


i=0
c=0
flag=0
while True:
	if i>len(s)-2: break
	if s[i]=="A":
		flag+=1
		i+=1
	elif flag and s[i:i+2]=="BC":
		c+=flag
		i+=2
	else:
		flag=0
		i+=1

print(c)

Buggy python submission (verdict: Time Limit Exceeded):
s=input()


i=0
c=0
flag=0
while True:
	if i>len(s)-3: break
	if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
		s=s[:i]+"B"+s[i+1:]
		s=s[:i+1]+"C"+s[i+2:]
		s=s[:i+2]+"A"+s[i+3:]
		c+=1
		if i>0:
			i-=1
			flag+=1
		continue
	else:
		if flag:
			i+=2+flag
			flag=0
		else: i+=1

print(c)

Fixed submission:
s=input()


i=0
c=0
flag=0
while True:
	if i>len(s)-2: break
	if s[i]=="A":
		flag+=1
		i+=1
	elif flag and s[i:i+2]=="BC":
		c+=flag
		i+=2
	else:
		flag=0
		i+=1

print(c)

Buggy python submission (verdict: Time Limit Exceeded):
s=input()


i=0
c=0
flag=0
while True:
	if i>len(s)-3: break
	if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
		s=s[:i]+"B"+s[i+1:]
		s=s[:i+1]+"C"+s[i+2:]
		s=s[:i+2]+"A"+s[i+3:]
		c+=1
		if i>0:
			i-=1
			flag=1
		continue
	else:
		if flag:
			i+=3
			flag=0
		else: i+=1

print(c)

Fixed submission:
s=input()


i=0
c=0
flag=0
while True:
	if i>len(s)-2: break
	if s[i]=="A":
		flag+=1
		i+=1
	elif flag and s[i:i+2]=="BC":
		c+=flag
		i+=2
	else:
		flag=0
		i+=1

print(c)

Buggy python submission (verdict: Time Limit Exceeded):
s=input()


i=0
c=0
while True:
	if i>len(s)-3: break
	if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
		s=s[:i]+"B"+s[i+1:]
		s=s[:i+1]+"C"+s[i+2:]
		s=s[:i+2]+"A"+s[i+3:]
		c+=1
		if i>0: i-=1
		continue
	else: i+=1

print(c)

Fixed submission:
s=input()


i=0
c=0
flag=0
while True:
	if i>len(s)-2: break
	if s[i]=="A":
		flag+=1
		i+=1
	elif flag and s[i:i+2]=="BC":
		c+=flag
		i+=2
	else:
		flag=0
		i+=1

print(c)
Buggy python submission (verdict: Time Limit Exceeded):
N,P=list(map(int,input().split()))


c=1
while P>1:
	for i in range(2,P+1):
		if P%i==0:
			if P%(i**N)==0:
				c*=i
				P=P//(i**N)
				break
			else:
				P=P//i
				break

print(c)

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

root=P**(1/N)
x=round(root)

for i in range(x):
	if P%((x-i)**N)==0:
		print(x-i)
		break
Buggy python submission (verdict: Time Limit Exceeded):
S=list(input())

while S[0]=="W":
	S.pop(0)

n=S.count("W")

c=0
for i in range(n):
	c+= S.index("W")-i
	S[S.index("W")]="X"

print(c)

Fixed submission:
S=list(input())

#while S[0]=="W":
#	S.pop(0)

#n=S.count("W")

c=0
x=0
for i in range(len(S)):
	if S[i]=="B": x+=1
	else: c+=x

print(c)

Buggy python submission (verdict: Time Limit Exceeded):
S=list(input())

while S[0]=="W":
	S.pop(0)


c=0
while "W" in S:
	c+=S.index("W")
	S.pop(S.index("W"))

print(c)

Fixed submission:
S=list(input())

#while S[0]=="W":
#	S.pop(0)

#n=S.count("W")

c=0
x=0
for i in range(len(S)):
	if S[i]=="B": x+=1
	else: c+=x

print(c)
Buggy python submission (verdict: Runtime Error):
N = int(input())
cards = []
for i in range(N):
	cards.append(list(map(int,input().split())))

points = []
for i in range(N):
	points.append(0)

for i in range(3):
	for j in range(N):
		flag = 0
		for k in range(j):
			if cards[j][i] == cards[k][i]:
				flag = 1
				break
		if j+1<N:
			for k in range(j+1,N):
				if cards[j][i] == cards[k][i]:
					flag = 1
					break
		if flag==0: points[j] += cards[j][i]

for i in range(N):
	print(points[i])


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

count = 0

if K>S: n=S
else: n=K
x=0
for i in range(n+1):
	if K>S-x: m=S-x
	else: m=K
	y=0
	for j in range(m+1):
		if S-x-y<=K: count +=1
		y+=1
	x+=1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K,S = list(map(int,input().split()))

x=0
count = 0

if S>K: n=K+1
else: n=S+1
for i in range(n):
	y=0
	while S-x>=0 and S-x<=2*K:
		if S-x-y>=0 and S-x-y<=K: count+=1
		y+=1
		if y>K: break
	x+=1
	if x>K: break

print(count)


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

count = 0

if K>S: n=S
else: n=K
x=0
for i in range(n+1):
	if K>S-x: m=S-x
	else: m=K
	y=0
	for j in range(m+1):
		if S-x-y<=K: count +=1
		y+=1
	x+=1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K,S = list(map(int,input().split()))

x=0
count = 0

if S>K: n=K+1
else: n=S+1
for i in range(n):
	y=0
	while S-x>=0 and S-x<=2*K:
		if S-x-y>=0 and x<=K and y<=K and S-x-y<=K: count+=1
		if y>K: break
		y+=1
	x+=1

print(count)


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

count = 0

if K>S: n=S
else: n=K
x=0
for i in range(n+1):
	if K>S-x: m=S-x
	else: m=K
	y=0
	for j in range(m+1):
		if S-x-y<=K: count +=1
		y+=1
	x+=1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K,S = list(map(int,input().split()))

x=0
count = 0

for i in range(S+1):
	y=0
	while S-x>=0:
		if S-x-y>=0 and x<=K and y<=K and S-x-y<=K: count+=1
		if y>K: break
		y+=1
	x+=1

print(count)


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

count = 0

if K>S: n=S
else: n=K
x=0
for i in range(n+1):
	if K>S-x: m=S-x
	else: m=K
	y=0
	for j in range(m+1):
		if S-x-y<=K: count +=1
		y+=1
	x+=1

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = [int(value) for value in input().split(" ")]
    result = 1
    for value in A:
        result *= value
        if 0 in A:
            print(0)
            exit()
        if result>10**18:
            print(-1)
            exit()
    
    print(result)


if __name__=="__main__":
    main()

Fixed submission:
def main():
    N = int(input())
    A = sorted([int(value) for value in input().split(" ")], reverse=True)
    result = 1
    if 0 in A:
        print(0)
        exit()
    for value in A:
        result *= value
        if result>10**18:
            print(-1)
            exit()
    
    print(result)


if __name__=="__main__":
    main()
Buggy python submission (verdict: Runtime Error):
### import math
n,k = map(int, input().split())
a = list(map(int, input().split()))

for i in range(k):
    
    b = [0] * (n+1)
    #print(b)
    for j in range(n):
        l = max(0, j-a[j])
        r = min(j+a[j]+1, n)
        b[l] += 1
        b[r] -= 1
        print(b)
    for j in range(n):
        b[j+1] += b[j]
    b.pop()
    if(a == b):
        break
    a = b
        
ans = " ".join(map(str, a))
print(ans)

Fixed submission:
s = input()

nm = s[0:3]

print(nm)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

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

ans = 1

flag_0 = False

for a_i in a:
    
    if a_i == 0:
        flag_0 = True
        break

    ans *= a_i
    
    if ans > 10**18:
        ans = -1
        
if flag_0 == True:
    print(0)
elif ans <0:
    print(-1)
else:
    print(ans)

Fixed submission:
n = int(input())

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

ans = 1

flag_0 = False

if 0 in a:
    print(0)
else:
    for a_i in a:
        ans *= a_i
        if ans > 10**18:
            ans = -1
            break
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

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

ans = 0

for a_i in a:
    if ans == 0:
        ans = a_i
    else:
        ans *= a_i

        
if ans > 10**18:
    print(-1)
else:
    print(ans)

Fixed submission:
n = int(input())

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

ans = 1

flag_0 = False

if 0 in a:
    print(0)
else:
    for a_i in a:
        ans *= a_i
        if ans > 10**18:
            ans = -1
            break
    print(ans)
Buggy python submission (verdict: Runtime Error):
k = int(input())
s = input()

if len(s) <= k:
    print(S)
else:
    t_s = s[:k] + "..."
    print(t_s)

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

if len(s) <= k:
    print(s)
else:
    t_s = s[:k] + "..."
    print(t_s)
Buggy python submission (verdict: Runtime Error):
import math

a, b, h,m = map(int, input().split())

# 角度を求める
a_angle = (h/12 + m/(60*12)) *360
b_angle = m/60*360

#print(a_angle)
#print(b_angle)

line = 0

if a_angle > b_angle:
    angle = a_angle - b_angle
elif a_angle < n_angle:
    angle = b_angle - a_angle 
else:
    angle = 0


    
if angle >=180:
    angle = 360-angle

#print(angle)

c2 = pow(a,2) + pow(b,2) - 2 * a * b * math.cos(math.radians(angle))

c = pow(c2, 1/2)
print(c)

Fixed submission:
import math

a, b, h,m = map(int, input().split())

# 角度を求める
a_angle = (h/12 + m/(60*12)) *360
b_angle = m/60*360

#print(a_angle)
#print(b_angle)

line = 0

if a_angle > b_angle:
    angle = a_angle - b_angle
elif a_angle < b_angle:
    angle = b_angle - a_angle 
else:
    angle = 0


    
if angle >=180:
    angle = 360-angle

#print(angle)

c2 = pow(a,2) + pow(b,2) - 2 * a * b * math.cos(math.radians(angle))

c = pow(c2, 1/2)
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int, input().split())

H_t = input()

H = [0]*N
ma = []*N

good_count = 0

for i in range(N):
    
    H[i]= int(H_t.split()[i])
    ma.append(0)

#print(H_M)

for j in range(M):
    a, b = map(int, input().split())
    
    ma[a-1] = max(ma[a-1], H[b-1]) # つながった展望台の中で一番高い展望台を保持する
    ma[b-1] = max(ma[b-1], H[a-1]) 
    
    
for i in range(N):
    if H[i] > ma[i]:
        good_count +=1
print(good_count)

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

H_t = input().split()
H = [int(s) for s in H_t]
#print(H)

ma = [0]*N

good_count = 0

#print(H_M)

for j in range(M):
    a, b = map(int, input().split())
    
    ma[a-1] = max(ma[a-1], H[b-1]) # つながった展望台の中で一番高い展望台を保持する
    ma[b-1] = max(ma[b-1], H[a-1]) 
    
    
for i in range(N):
    if H[i] > ma[i]:
        good_count +=1
print(good_count)
Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())

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

days = 0

for i in range(m):
    days += a[i]

remaining = n-days

if remaining < 0:
    print(-1)
else:
    print(remainig)

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

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

days = 0

for i in range(m):
    days += a[i]

remaining = n-days

if remaining < 0:
    print(-1)
else:
    print(remaining)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())

count = 0
flag = True

while(flag):
    tmp_a = []
    for i in a:
        if i % 2 !=0:
            flag = False
            break
        tmp_a.append(i/2)
    a = tmp_a
    if flag == True:
        count += 1

print(count)

Fixed submission:
str = input()
 
count = 0
if str[0] == "1":
  count+=1
if str[1] == "1":
  count+=1
if str[2] == "1":
  count+=1
 
print(count)

Buggy python submission (verdict: Runtime Error):
str = input()

count = 0
if str[0] == "1":
  count+=1
if str[1] == "1":
  count+=1
if str[2] == "1":
  count+=1

printt(count)

Fixed submission:
str = input()
 
count = 0
if str[0] == "1":
  count+=1
if str[1] == "1":
  count+=1
if str[2] == "1":
  count+=1
 
print(count)
Buggy python submission (verdict: Runtime Error):

import copy
n = int(input())
list_a = list(map(int, input().split()))  #リスト入力

list_a = list(set(list_a))
list_a.sort(reverse=True)
# print(list_a)

count = 0
if len(list_a) == 1:
    print(0)
else:
    for i in range(len(list_a)):
        ai = list_a[i] 
        new_list = list_a[i+1:]  #  全くの別物としてコピー
#         print(new_list)
        data2 = []
        booler = True
        for j in range(len(new_list)):
            aj = new_list[-j]
#             print(ai, aj, ai%aj)
            if ai % aj == 0:

                booler = False
                break
        if booler == True:
            count += 1


    print(count)

Fixed submission:
x, n =map(int, input().split())  #複数数値入力
list_p = list(map(int, input().split()))  #リスト入力


if n == 0:
    print(x)
else:
    i = 0
    while True:
        if x - i not in list_p:
            print(x-i)
            break
        elif x + i not in list_p:
            print(x+i)
            break
        else:
            i += 1
Buggy python submission (verdict: Runtime Error):
x = int(input())
for i in range(-118, 119):
    for j in range(-119, 118):
        if i**5 - j**5 == x:
            print(i,j)
            break
    else:
        continue
    break

Fixed submission:
import copy
n, m =map(int, input().split())  #複数数値入力
list_h=list(map(int, input().split()))  #リスト入力
# 繰り返しリスト入力
a = []
for i in range(m):
    ai = list(map(int, input().split()))  #リスト入力
    a.append(ai)

for i in a:
    i.sort()
a = list(map(list, set(map(tuple, a))))

booler = [True] * n
for j in a:
    if list_h[j[0]-1] < list_h[j[1]-1]:
        booler[j[0]-1] = False
    elif list_h[j[0]-1] > list_h[j[1]-1]:
        booler[j[1]-1] = False
    else :
        booler[j[0]-1] = False
        booler[j[1]-1] = False
print(booler.count(True))

Buggy python submission (verdict: Runtime Error):

n, m =map(int, input().split())  #複数数値入力
list_h=list(map(int, input().split()))  #リスト入力
# 繰り返しリスト入力
a = []
for i in range(m):
    ai = list(map(int, input().split()))  #リスト入力
    a.append(ai)

booler = [True] * n
for i in range(n):
    a_copy = copy.deepcopy(a)
    for j in range(m):
        if i in a_copy[j] :
            a_copy[j].remove(i)
#             print(a_copy)
            if list_h[i] > list_h[a_copy[j][0]-1]:
                continue
            else:
                booler[i] = False
        else:
            continue

print(booler.count(True))

Fixed submission:
import copy
n, m =map(int, input().split())  #複数数値入力
list_h=list(map(int, input().split()))  #リスト入力
# 繰り返しリスト入力
a = []
for i in range(m):
    ai = list(map(int, input().split()))  #リスト入力
    a.append(ai)

for i in a:
    i.sort()
a = list(map(list, set(map(tuple, a))))

booler = [True] * n
for j in a:
    if list_h[j[0]-1] < list_h[j[1]-1]:
        booler[j[0]-1] = False
    elif list_h[j[0]-1] > list_h[j[1]-1]:
        booler[j[1]-1] = False
    else :
        booler[j[0]-1] = False
        booler[j[1]-1] = False
print(booler.count(True))