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

Fixed submission:
n = int(input())

print(n**3)

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

print(n**3)
Problem p02933 (python)

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

if a>=3200:
  print(s)
else:
  print("red")

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

if a>=3200:
  print(s)
else:
  print("red")
Problem p03250 (python)

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

print(9*max(a,b,c)+a+b+c)

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

print(9*max(a+b+c)+a+b+c)
Problem p02622 (python)

Fixed submission:
S = str(input())
T = str(input())
length =len(S)
listS=list(S)
listT=list(T)
num = len(T)
res = 0
for i in range(length):
    if (listS[num-1] != listT[num-1]):
        res +=1
    num -=1
print(res)

Buggy submission (verdict: Runtime Error):
a= int(input())
print(a+a**2+a**3)
Problem p02711 (python)

Fixed submission:
N = input()
if N[0] == '7' or N[1] == '7' or N[2] == '7':
   print("Yes")
else:
   print("No")

Buggy submission (verdict: Runtime Error):
N = input()
    if N[0] == '7' or N[1] == '7' or N[2] == '7':
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
N = input()
    if N[0] == '7' or N[1] == '7' or N[2] == '7':
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
N = input()
    if N[0] == '7' or N[1] == '7' or N[2] == '7':
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
n=input()
if n[0]=='7' or n[1] == '7' or n[2] == '7':
	print("yes")
else:
  	print("no)
Problem p02881 (python)

Fixed submission:
import math
n=int(input())
p=math.sqrt(n)
def x(g):
  a=g
  c=0
  while a>=0:
    a-=1
    c+=1
  return c-1

m=x(p)
for i in range(m):
  if n%(m-i)==0:
    print(m-2-i+(n//(m-i)))
    break

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
m=math.sqrt(n)//1
for i in range(m):
  if n%(m-i)==0:
    print(m-i+(n//(m-i)))
    break
Problem p02916 (python)

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

print(co)

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

print(co
Problem p02989 (python)

Fixed submission:
n=int(input())
d=list(map(int,input().split()))
d.sort()
e=d[n//2-1]
f=d[n//2]
print(f-e)

Buggy submission (verdict: Runtime Error):
n=int(input())
d=list(map(int,input().split()))
d.sort()
e=d[n//2]
f=d[n//2+1]
print(f-e)
Problem p02897 (python)

Fixed submission:
n = int(input())
w = -(-n // 2)
ans = w/n
print(ans)

Buggy submission (verdict: Runtime Error):
import bisect
n = int(input())
k = int(input())
array = list(map(int,input().strip().split()))
array.sort()
index = bisect.bisect_left(array,k)
print (index)

Buggy submission (verdict: Runtime Error):
import math
n = input()
print ( (n //2) + 1)
Problem p02627 (python)

Fixed submission:
n = input()
if n.isupper():
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
n=input()
if n.isuper() == true :
  print(n.lower())
else:
  print(n.upper())
Problem p02699 (python)

Fixed submission:
s,w = map(int,input().split())
if w >= s :
  print("unsafe")
else:
  print("safe")

Buggy submission (verdict: Runtime Error):
a , b = map(int,input().split())
if b>= a:
  print("safe")
elif :
  print("unsafe")
Problem p02859 (python)

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

Buggy submission (verdict: Runtime Error):
r = input()
suq = r * r
print(suq)
Problem p02623 (python)

Fixed submission:
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a, b = [0], [0]
for i in range(N):
  a.append(a[i] + A[i])
for i in range(M):
  b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
    j -= 1
  ans = max(ans, i + j)
print(ans)

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

a, b = [0], [0]
for i in range(N):
  a.append(a[i]+A[i])
for i in range(M):
  b.append(b[i]+B[i])

ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
  	j -= 1
  ans = max(ans, i + j)
print(ans))))

a, b = [0], [0]
for i in range(N):
  a.append(a[i]+A[i])
for i in range(M):
  b.append(b[i]+B[i])

ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
  	j -= 1
  ans = max(ans, i + j)
print(ans)

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

a, b = [0], [0]
for i in range(N):
  a.append(a[i]+A[i])
for i in range(M):
  b.append(b[i]+B[i])

ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[j]:
  	j -= 1
  ans = max(ans, i + j)
print(ans)N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a, b = [0], [0]
for i in range(N):
  a.append(a[i]+A[i])
for i in range(M):
  b.append(b[i]+B[i])

ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[j]:
  	j -= 1
  ans = max(ans, i + j)
print(ans)

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

a, b = [0], [0]
for i in range(N):
  a.append(a[i]+A[i])
for i in range(M):
  b.append(b[i]+B[i])

ans, j = 0, M
for i in range(N+1):
  if a[i] > K:
    break
  while b[j] > K - a[j]:
  	j -= 1
  ans = max(ans, i+j)
print(ans)N,M,K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a, b = [0], [0]
for i in range(N):
  a.append(a[i]+A[i])
for i in range(M):
  b.append(b[i]+B[i])

ans, j = 0, M
for i in range(N+1):
  if a[i] > K:
    break
  while b[j] > K - a[j]:
  	j -= 1
  ans = max(ans, i+j)
print(ans)

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

a, b = [0], [0]
for i in range(N):
	a.append(a[i]+A[i])
for i in range(M):
	b.append(b[i]+B[i])

ans, j = 0, M
for i in range(N+1):
  if a[i] > K:
    break
  while b[j] > K - a[j]:
  	j -= 1
  ans = max(ans, i+j)
print(ans)
Problem p02624 (python)

Fixed submission:
n = int(input())
ans = 0
for i in range(1, n + 1):
    y = n // i
    ans += y * (y + 1) * i // 2
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
sum = 0
for k in range(1,n+1):
  y = n // i
  sum += y*(y+1)*i//2
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
sum = 0
for k in range(n):
  for j in range(k):
  	if k % j == 0：
    	sum += k
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
sum = 0
for k in range(N):
  for j in range(int(k)):
  	if k % j == 0：
    	sum += k
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
sum = 0
for k in range(N):
  for j in range(k):
  	if k % j == 0：
    	sum += k
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
sum = 0
for k in range(N):
  for j in range(k):
  	if k % j == 0：
    	sum += k
print(f)

Buggy submission (verdict: Runtime Error):
N = int(input())
sum = 0
f = 0
for i in range(1,N):
  for j in range(1,N):
  	if k % j == 0：
    	sum += 1
print(f)

Buggy submission (verdict: Runtime Error):
N = input()
sum = 0
f = 0
for k in range(1,N):
  for j in range(1,k):
  	if k % j == 0：
    	sum += k
print(f)

Buggy submission (verdict: Runtime Error):
N = int(input())
sum = 0
f = 0
for k in range(1,N):
  for j in range(1,k):
  	if k % j == 0：
    	sum += k
print(f)

Buggy submission (verdict: Runtime Error):
N = int(input())
sum = 0
f = 0
for k in range(1,N):
  #define f
  #f = 0
  for j in range(1,k)
  	if k % j == 0：
    	f += k
  #sum = sum + k*f
print(f)

Buggy submission (verdict: Runtime Error):
N = int(input())
sum = 0
f = 0
for k in range(1,N):
  #define f
  #f = 0
  for j in range(1,k)
  	if k%j == 0：
    	f += k
  #sum = sum + k*f
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
sum = 0
for k in range(N):
  #define f
  f = 0
  for j in range(1,k)
  	if k%j == 0:
      f = f+1
  sum = sum + k*f
print(sum)
Problem p02693 (python)

Fixed submission:
import sys
K=int(input())
A,B=map(int,input().split())
for i in range(A,B+1):
  if i%K==0:
    print("OK")
    sys.exit()
print("NG")

Buggy submission (verdict: Runtime Error):
import sys
K=int(input())
A,B=map(int,input().split())
for i in range(A,B):
  if i%K==0:
    print("OK")
    sys.sxit()
print("NG")
Problem p02688 (python)

Fixed submission:
#!/usr/bin/env python3

from typing import Iterable


def main() -> None:
    N, K = rmi()
    D, A = [], []
    for k in range(K):
        d = ri()
        D.append(d)
        A.append(rmi())
    target = [False] * N
    for k in range(K):
        for a in A[k]:
            target[a - 1] = True
    w(target.count(False))


def r() -> str:
    return input().strip()


def ri() -> int:
    return int(r())


def rmi(delim: str = ' ') -> int:
    return tuple(map(int, input().split(delim)))


def w(data) -> None:
    print(data)


def wm(data: Iterable) -> None:
    print(' '.join(data))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

from typing import Iterable


def main() -> None:
    N, K = rmi()
    D, A = [], []
    for n in range(N):
        d = ri()
        D.append(d)
        A.append(rmi())
    target = [False] * N
    for k in range(K):
        for a in A[k]:
            target[a] = True
    w(target.count(False))


def r() -> str:
    return input().strip()


def ri() -> int:
    return int(input())


def rmi(delim: str = ' ') -> int:
    return tuple(map(int, input().split(delim)))


def w(data) -> None:
    print(data)


def wm(data: Iterable) -> None:
    print(' '.join(data))


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

Fixed submission:
#!/usr/bin/env python3


def main() -> None:
    H, W = rmi()
    s = []
    for h in range(H):
        line = list(map(lambda c: c == '.', list(r())))
        s.append(line)
    dp = []
    for _ in range(H):
        dp.append([H + W + 1] * W)
    dp[0][0] = 0 if s[0][0] else 1
    for h in range(1, H):
        dp[h][0] = dp[h - 1][0] + int(s[h - 1][0] != s[h][0] and not s[h][0])
    for w in range(1, W):
        dp[0][w] = dp[0][w - 1] + int(s[0][w - 1] != s[0][w] and not s[0][w])
    for h in range(1, H):
        for w in range(1, W):
            dp[h][w] = min(dp[h - 1][w] + int(s[h - 1][w] != s[h][w] and not s[h][w]),
                           dp[h][w - 1] + int(s[h][w - 1] != s[h][w] and not s[h][w]))
    print(dp[H - 1][W - 1])


def r() -> str:
    return input().strip()


def ri() -> int:
    return int(r())


def rmi(delim: str = ' ') -> tuple:
    return tuple(map(int, input().split(delim)))


def w(data) -> None:
    print(data)


def wm(*data, delim: str = ' ') -> None:
    print(delim.join(map(str, data)))


if __name__ == '__main__':
    import sys
    sys.setrecursionlimit(10 ** 9)
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3


def main() -> None:
    H, W = rmi()
    s = []
    for h in range(H):
        line = list(map(lambda c: c == '.', list(r())))
        s.append(line)
    dp = []
    for _ in range(H):
        dp.append([-1] * W)
    dp[0][0] = 0 if s[0][0] else 1
    for h in range(1, H):
        dp[h][0] = dp[h - 1][0] if s[h][0] else dp[h - 1][0] + 1
    for w in range(1, W):
        dp[0][w] = dp[0][w - 1] if s[0][w] else dp[0][w - 1] + 1
    for h in range(1, H):
        for w in range(1, W):
            minimum = min(dp[h - 1][w], dp[h][w - 1])
            dp[h][w] = minimum if s[h][w] else minimum + 1
    print(dp[H][W])


def r() -> str:
    return input().strip()


def ri() -> int:
    return int(r())


def rmi(delim: str = ' ') -> tuple:
    return tuple(map(int, input().split(delim)))


def w(data) -> None:
    print(data)


def wm(*data, delim: str = ' ') -> None:
    print(delim.join(map(str, data)))


if __name__ == '__main__':
    import sys
    sys.setrecursionlimit(10 ** 9)
    main()
Problem p02951 (python)

Fixed submission:
a,b,c,= [int(x) for x in input().split()]
n = c -(a-b)
if n > 0:
    print(n)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
a,b,c,= [int(x) for x in input()]
n = c -(a-b)
if n > 0:
    print(n)
else:
    print(0)
Problem p02753 (python)

Fixed submission:
S = input()

if len(S)==3 and S.count('A')==2 or S.count('B')==2:
    print('Yes')

else:
    print('No')

Buggy submission (verdict: Runtime Error):
S = str(input())
print('Yes' if S[2]==S[3] and S[4]==S[5] else 'No')
Problem p02712 (python)

Fixed submission:
cnt=0
n=int(input())
for i in range(1,n+1):
    if i%3!=0 and i%5!=0:
        cnt+=i
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
summ=0
for i in range(1,n):
    if i%3!=0 and i%5!=0:
        summ+=i
print(summ)n=int(input())
summ=0
for i in range(1,n):
    if i%3!=0 and i%5!=0:
        summ+=i
print(summ)
Problem p02623 (python)

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

S = [0]

Sum = 0


for i in range(N):
  K = K - A[i]
  if K >= 0:
    Sum += 1
  else:
    K = K + A[i]
    break
else:
  i = N
S.append(Sum)

for j in range(M):
  K = K - B[j]
  if K >= 0:
    Sum += 1
  else:
    if i == 0:
      break
    for k in range(i):
      K = K + A[i-k-1]
      
      Sum = Sum - 1
      if K >= 0:
        i = i-k-1
        break
    else:
      i = 0
      continue
    if K >= 0:
      Sum += 1
    
  S.append(Sum)
 
print(max(S))

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

S = [0]

Sum = 0


for i in range(N):
  K = K - A[i]
  if K >= 0:
    Sum += 1
  else:
    K = K + A[i]
    break
S.append(Sum)

for j in range(M):
  K = K - B[j]
  if K >= 0:
    Sum += 1
  else:
    if Sum == 0:
      break
    while(K<0):
      i = i - 1
      K = K + A[i]
      Sum = Sum - 1
    Sum += 1
  S.append(Sum)
print(max(S))

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

S = [0]

Sum = 0


for i in range(N):
  K = K - A[i]
  if K > 0:
    Sum += 1
  else:
    K = K + A[i]
    break
S.append(Sum)

for j in range(M):
  K = K - B[j]
  if K > 0:
    Sum += 1
  else:
    if Sum == 0:
      break
    while(K<0):
      i = i - 1
      K = K + A[i]
      Sum = Sum - 1
    Sum += 1
  S.append(Sum)
print(max(S))

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

S = [0]

Sum = 0


for i in range(len(A)):
  K = K - A[i]
  if K > 0:
    Sum += 1
  else:
    K = K + A[i]
    break
S.append(Sum)

for j in range(len(B)):
  K = K - B[j]
  if K > 0:
    Sum += 1
  else:
    if i == 0:
      break
    while(K<0):
      i = i - 1
      K = K + A[i]
      Sum = Sum - 1
    Sum += 1
  S.append(Sum)
print(max(S))

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

S = [0]

Sum = 0


for i in range(len(A)):
  K = K - A[i]
  if K > 0:
    Sum += 1
  else:
    K = K + A[i]
    break
S.append(Sum)

for j in range(len(B)):
  K = K - B[j]
  if K > 0:
    Sum += 1
  else:
    if i == 0:
      break
    while(K<0):
      i = i - 1
      K = K + A[i]
      Sum = Sum - 1
    Sum += 1
  S.append(Sum)
print(max(S))

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

S = []

Sum = 0


for i in range(len(A)):
  K = K - A[i]
  if K > 0:
    Sum += 1
  else:
    K = K + A[i]

    break
S.append(Sum)

for j in range(len(B)):
  K = K - B[j]
  if K > 0:
    Sum += 1
  else:
    while(K<0):
      i = i - 1
      K = K + A[i]
      Sum = Sum - 1
    Sum += 1
  S.append(Sum)
print(max(S))
Problem p02859 (python)

Fixed submission:

a=int(input())
print(a**2)

Buggy submission (verdict: Runtime Error):







a=input()
print(a**2)

Buggy submission (verdict: Runtime Error):




a=









a=input()
print(a**2)
Problem p02933 (python)

Fixed submission:
a = int(input())
s = input()
if a >= 3200:
    print(s)
else:
    print("red")

Buggy submission (verdict: Runtime Error):
n = int(input())
v = sorted(list(map(int, input().split())), reverse = False)
for i in range(1, n):
    v[0] = (v[0] + v[i]) / 2
print(v[0])
Problem p02935 (python)

Fixed submission:
n = int(input())
v = sorted(list(map(int, input().split())), reverse = False)
for i in range(1, n):
    v[0] = (v[0] + v[i]) / 2
print(v[0])

Buggy submission (verdict: Runtime Error):
n = int(input())
v = sorted(list(map(int, input().split())), reverse = False)
for i in range(1, n):
    v[0] = (v[0] + v[i]) / 2
print(v[0]
Problem p03209 (python)

Fixed submission:
n, x = map(int, (input().split()))
a, p = [1], [1]
for i in range(n):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)

def f(n, x):
    if n == 0:
        return 0 if x <= 0 else 1
    elif x <= 1+a[n-1]:
        return f(n-1, x-1)
    else:
        return p[n-1]+1 + f(n-1, x-2-a[n-1])
print(f(n, x))

Buggy submission (verdict: Runtime Error):
n, x = map(int, (input().split()))
a, p = [1], [1]
for i in range(n):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)
#print("a = {}".format(a))
#print("p = {}".format(p))

def f(n, x):
    if n == 0:
        return 0 if x <= 0 else 1
    elif x <= 1+a[n-1]:
        return f(n-1, x-1)
    elif x == a[n-1]+2:
        return p[n-1]+1
    elif x <= 2*a[n-1]+3:
        return p[n-1]+1 + f(n-1, x-2-a[n-1])
print(f(n, x))

Buggy submission (verdict: Runtime Error):
n, x = map(int, (input().split()))
a, p = [1], [1]
for i in range(n):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)
print("a = {}".format(a))
print("p = {}".format(p))

def f(n, x):
    if n == 0:
        return 0 if x <= 0 else 1
    elif x <= 1+a[n-1]:
        return f(n-1, x-1)
    elif x == a[n-1]+2:
        return p[n-1]+1
    elif x <= 2*a[n-1]+3
        return p[n-1]+1 + f(n-1, x-2-a[n-1])
print(f(n, x))
Problem p02622 (python)

Fixed submission:
def minchange(s,t):
  m=len(s)
  n=len(t)
  if n!=m:
    return -1
  cnt=[0]*256
  for i in range(n):
    cnt[ord(t[i])]+=1
  for i in range(n):
    cnt[ord(s[i])]-=1
  res=0
  i=n-1
  j=n-1
  while i>=0:
    while i>=0 and s[i]!=t[i]:
      i-=1
      res+=1
    if i>=0:
      i-=1
      j-=1
  return res
s=input()
t=input()
print(str(minchange(s,t)))

Buggy submission (verdict: Runtime Error):
def minchange(s,t):
  m=len(s)
  n=len(t)
  if n!=m:
    return -1
  cnt=[0]*256
  for i in range(n):
    cnt[ord(t[i])]+=1
  for i in range(n):
    cnt[ord(s[i])]-=1
  for i in range(256):
    if cnt[i]:
      return -1
  res=0
  i=n-1
  j=n-1
  while i>=0:
    while i>=0 and s[i]!=t[i]:
      i-=1
      res+=1
    if i>=0:
      i-=1
      j-=1
  return res
s=input()
t=input()
print(str(minchange(s,t))

Buggy submission (verdict: Runtime Error):
def minchange(s,t):
  m=len(s)
  n=len(t)
  if n!=m:
    return -1
  cnt=[0]*256
  for i in range(n):
    cnt[ord(t[i])]+=1
  for i in range(n):
    cnt[ord(s[i])]-=1
  for i in range(256):
    if cnt[i]:
      return -1
  res=0
  i=n-1
  j=n-1
  while i>=0:
    while i>=0 and s[i]!=t[i]:
      i-=1
      res+=1
    if i>=0:
      i-=1
      j-=1
  return res
s=input()
t=int(input())
print(str(minchange(s,t))
Problem p02689 (python)

Fixed submission:
n,m=map(int,input().split())
h=list(map(int,input().split()))
tall=[0]*n
for i in range(m):
  a,b=map(int,input().split())
  a-=1
  b-=1
  tall[a]=max(tall[a],h[b])
  tall[b]=max(tall[b],h[a])
res=0
for i in range(n):
  if h[i]>tall[i]:
    res+=1
print(res)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input())
h=list(map(int,input().split(" ")))
tall=[0]*n
for i in range(m):
  a,b=map(int,input().split())
  a-=1
  b-=1
  tall[a]=max(tall[a],h[b])
  tall[b]=max(tall[b],h[a])
res=0
for i in range(n):
  if h[i]>tall[i]:
    res+=1
print(res)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input())
h=list(map(int,input().split( )))
tall=[0]*n
for i in range(m):
  a,b=map(int,input().split())
  a-=1
  b-=1
  tall[a]=max(tall[a],h[b])
  tall[b]=max(tall[b],h[a])
res=0
for i in range(n):
  if h[i]>tall[i]:
    res+=1
print(res)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input())
h=list(map(int,input().split()))
tall=[0]*n
for i in range(m):
  a,b=map(int,input().split())
  a-=1
  b-=1
  tall[a]=max(tall[a],h[b])
  tall[b]=max(tall[b],h[a])
res=0
for i in range(n):
  if h[i]>tall[i]:
    res+=1
print(res)
Problem p02693 (python)

Fixed submission:
k=int(input())
a,b=map(int,input().split())
f=0
for i in range(a,b+1):
  if i%k==0:
    f=1
if f==1:
  print("OK")
else:
  print("NG")

Buggy submission (verdict: Runtime Error):
k=int(input())
a,b=map(int,input().split())
for i in range(a,b+1):
  if i%n==0:
    print("OK")
    exit()
print("NG")

Buggy submission (verdict: Runtime Error):
k=int(input())
a,b=map(int,input().split())
f=0
for i in range(a,b+1):
  if i%n==0:
    print("OK")
    f=1
if f==0:
  print("NG")

Buggy submission (verdict: Runtime Error):
k=int(input())
a,b=map(int,input().split())
for i in range(a,b+1):
  if i%n==0:
    print("OK")
print("NG")
Problem p02623 (python)

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

a, b = [0], [0]
for i in range(N):
    a.append(a[i] + A[i])
for i in range(M):
    b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
            j -= 1
    ans = max(ans, i + j)
print(ans)

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

N,M,K = map(int,input().split())
A = np.array(list(map(int,input().split())))
B = np.array(list(map(int,input().split())))

total = 0

for i in range(N + M):
    if len(A) > 0 and A[0] <= B[0] and K - A[0] >= 0:
        K = K - A[0]
        A = A[1:]
        total += 1
    elif len(B) > 0 and K - B[0] >= 0:
        K = K - B[0]
        B = B[1:]
        total += 1
    else:
        break

print(total)

Buggy submission (verdict: Runtime Error):
import numpy as np
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

A_np = np.array(A)
B_np = np.array(B)

C_np = np.append(A_np,B_np)
C_np = np.sort(C_np)
print(C_np)
x = 0
for i in range(len(C_np)):
    if K >= x + C_np[i]:
        x += C_np[i]
        y += 1
    else:
        break
print(y)

Buggy submission (verdict: Runtime Error):
import numpy as np
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

A_np = np.array(A)
B_np = np.array(B)

C_np = np.append(A_np,B_np)
C_np = np.sort(C_np)

x = 0
for i in range(len(C_np)):
    if K > x + C_np[i]:
        x += 1
    else:
        break
print(x)
Problem p02879 (python)

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

if A <10 and B < 10:
	print(A*B)
else:
	print('-1')

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

if A <10 and B < 10:
	print(A*B)
else:
	print('-1')

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

if A <10 and B < 10:
	print(A*B)
else:
	print(-1)