Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
x=int(input())
import math

sum=0
y=100
for i in range(200000):
  y=math.floor(y*1.01)
  if y<=x:
    sum+=1
  else:
    sum=sum
print(sum+1)


Fixed submission:
x=int(input())

sum=0
y=100
for i in range(10000):
  y=int(y*1.01)
  if y<x:
    sum+=1
  else:
    sum=sum
print(sum+1)
Buggy python submission (verdict: Runtime Error):
from math import factorial
N, a, b = map(int, input().split())
m=0
for i in range(N):
    if i==a, or i==b
        k=0
        m=m+k
    if not i== a-1 or i==b-1:
        k= factorial(N) // ((factorial(N - (i+1)) * factorial(i+1)))
        m=m+k
    print(m)


Fixed submission:
N,R=map(int, input().split()) 
if N>=10:
    print(R)
if 0<=N<10:
    print(R+100*(10-N))

Buggy python submission (verdict: Runtime Error):
from math import factorial
N, a, b = map(int, input().split())
m=0
for i in range(N):
    if not i== a-1 or i==b-1:
        k=factorial(N) // (factorial(N - (i+1)) * factorial(i+1))
        m=m+k
    print(m)


Fixed submission:
N,R=map(int, input().split()) 
if N>=10:
    print(R)
if 0<=N<10:
    print(R+100*(10-N))

Buggy python submission (verdict: Runtime Error):
N = int(stdin.readline().rstrip())
A = int[stdin.readline().rstrip().split() for _ in range(n)]
P=round(sum(A)/N)
B=0
for i in range(N):
    B=B+(A[i]-P)**2
print(B)



Fixed submission:
N,R=map(int, input().split()) 
if N>=10:
    print(R)
if 0<=N<10:
    print(R+100*(10-N))

Buggy python submission (verdict: Runtime Error):
n = int(stdin.readline().rstrip())
data = int[stdin.readline().rstrip().split() for _ in range(n)]
P=round(sum(A)/N)
B=0
for i in range(N):
  B=B+(A[i]-P)**2
print(B)


Fixed submission:
N,R=map(int, input().split()) 
if N>=10:
    print(R)
if 0<=N<10:
    print(R+100*(10-N))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
P=round(sum(A)/N)
B=0
for i in range(N):
  B=B+(A[i]-P)**2
print(B)


Fixed submission:
N,R=map(int, input().split()) 
if N>=10:
    print(R)
if 0<=N<10:
    print(R+100*(10-N))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [input() for i in range(N)]
P=round(sum(A)/N)
B=0
for i in range(N):
  B=B+(A[i]-P)**2
print(B)


Fixed submission:
N,R=map(int, input().split()) 
if N>=10:
    print(R)
if 0<=N<10:
    print(R+100*(10-N))

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = [input() for i in range(N)]
P=round(sum(A)/N)
B=0
for i in range(N):
  B=B+(A[i]-P)**2
print(B)


Fixed submission:
N,R=map(int, input().split()) 
if N>=10:
    print(R)
if 0<=N<10:
    print(R+100*(10-N))

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = [input() for i in range(N)]
P=round(sum(A)/N)
B=0
for i in range(N):
	B=B+(A[i]-P)**2
print(B)

Fixed submission:
N,R=map(int, input().split()) 
if N>=10:
    print(R)
if 0<=N<10:
    print(R+100*(10-N))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split())) 
P=round(sum(A)/N)
B=0
for i in range(N):
	B=B+(A[i]-P)**2
print(B)

Fixed submission:
N,R=map(int, input().split()) 
if N>=10:
    print(R)
if 0<=N<10:
    print(R+100*(10-N))

Buggy python submission (verdict: Runtime Error):
N = input()
for i in range(N):
	A = [int(i) for i in input().split()]
P=round(sum(A)/N)
B=0
for i in range(N):
	B=B+(A[i]-P)**2
print(B)


Fixed submission:
N,R=map(int, input().split()) 
if N>=10:
    print(R)
if 0<=N<10:
    print(R+100*(10-N))
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int, input().split()) 
for i in range(100000):
    if K**i<=N<=K**(i+1):
        print(i+1)

Fixed submission:
N,K=map(int, input().split()) 
for i in range(8000):
    if K**i<=N<K**(i+1):
        print(i+1)

Buggy python submission (verdict: Runtime Error):
N,K=map(int, input().split()) 
for i in　range(10)
	if K**i<=N<=K**(i+1):
    	print(i+1)


Fixed submission:
N,K=map(int, input().split()) 
for i in range(8000):
    if K**i<=N<K**(i+1):
        print(i+1)
Buggy python submission (verdict: Runtime Error):
N = input()
for i in N:
	A = [int(i) for i in input().split()]
P=round(sum(A)/N)
B=0
for i in N:
	B=B+(A[i]-P)**2
print(B)


Fixed submission:
N = int(input())
A = list(map(int, input().split())) 
P=round(sum(A)/N)
B=0
for i in range(N):
    B=B+(A[i]-P)**2
print(B)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N, K, Q = map(int, input().split())
S = []
for _ in range(Q):
    S.append(int(input())) 
P=np.array([K]*N)
for i in range(Q):
  P[S[i]-1]+=1
P -= Q
for i in range(N):
  if P[i] <= 0:
    print("No")
  else:
    print("Yes")

Fixed submission:
S=input()
if S=="Sunny" :
	print("Cloudy")
elif S=="Cloudy" :
	print("Rainy")
else :
	print("Sunny")
Buggy python submission (verdict: Runtime Error):
S=input()
a = 0
for i in range(len(S)):
  if i%2==1 :
    if S[i] != "L":
    a += 1
  else:
    if S[i] != "R":
    a += 1
if a == len(S):
  print("Yes")
else:
  print("No")

Fixed submission:
S=input()
a = 0
for i in range(len(S)):
  if i%2==0 :
    if S[i] != "L":
    	a += 1
  else:
    if S[i] != "R":
    	a += 1
if a == len(S):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
S=input()
a = 0
for i in renge(len(S)):
  if i%2==1 :
    S[i] != "L"
    a += 1
  else:
    S[i] != "R"
    a += 1
if a == len(S):
  print("Yes")
else:
  print("No")

Fixed submission:
S=input()
a = 0
for i in range(len(S)):
  if i%2==0 :
    if S[i] != "L":
    	a += 1
  else:
    if S[i] != "R":
    	a += 1
if a == len(S):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, K, Q = map(int, input().split())
S = []
for _ in range(Q):
    S.append(int(input())) 
P=np.array([K]*N)
b=np.array([0]*N)
for i in range(Q):
  a=np.array([-1]*N)
  a[S[i]-1]=0
  b +=a
P +=b
for i in range(N):
  if P[i] <= 0:
    print("No")
  else:
    print("Yes")

Fixed submission:
import numpy as np
N, K, Q = map(int, input().split())
S = []
for _ in range(Q):
    S.append(int(input())) 
P=[K]*N
for i in range(Q):
  P[S[i]-1]+=1
P = np.array(P)
P -= Q
for i in range(N):
  if P[i] <= 0:
    print("No")
  else:
    print("Yes")

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, K, Q = map(int, input().split())
S = []
for _ in range(Q):
    S.append(int(input())) 
P=np.array([K]*N)
for i in range(Q):
  a=np.array([-1]*N)
  a[S[i]-1]=0
  P +=a
for i in range(N):
  if P[i] <= 0:
    print("No")
  else:
    print("Yes")

Fixed submission:
import numpy as np
N, K, Q = map(int, input().split())
S = []
for _ in range(Q):
    S.append(int(input())) 
P=[K]*N
for i in range(Q):
  P[S[i]-1]+=1
P = np.array(P)
P -= Q
for i in range(N):
  if P[i] <= 0:
    print("No")
  else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
import numpy as np
N, K, Q = map(int, input().split())
S = []
for _ in range(H):
    S.append(int(input())) 
P=np.array([K]*N)
for i in range(Q):
  a=[-1]*N
  a[S[i]]=0
  P +=a
for i in range(N):
  if P[i] <= 0:
    print("No")
  else:
    print("Yes")

Fixed submission:
import numpy as np
N, K, Q = map(int, input().split())
S = []
for _ in range(Q):
    S.append(int(input())) 
P=[K]*N
for i in range(Q):
  P[S[i]-1]+=1
P = np.array(P)
P -= Q
for i in range(N):
  if P[i] <= 0:
    print("No")
  else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
def main():
  import sys
  input = sys.stdin.readline
  n, m = map(int, input().split())
  h = list(map(int, input().split()))
  ab = [list(map(int, input().split())) for _ in range(m)]
  L = [0] * n

  for i in range(m):
      A =ab[i][0]-1
      B =ab[i][1]-1
      M = max(h[A],h[B])
      if M == h[A]:
          L[A] += 0.33
          L[B] -= 100
      else: 
          L[B] += 0.33
          L[A] -= 100
      
  L= list(filter(lambda x: x >= 0, L))
  print(len(L))

if __name__ == '__main__':
    main()


Fixed submission:
s = input()
if s == 'ABC':
    print('ARC')
else:
    print('ABC')

Buggy python submission (verdict: Runtime Error):
s = input()
if s == "ABC":
  print("ARC")
else:
  print("ABC"

Fixed submission:
s = input()
if s == "ABC":
  print("ARC")
else:
  print("ABC")
Buggy python submission (verdict: Runtime Error):
def function(n, list1):
  ans = [0] * n
  for i in list1:
    ans[i - 1] += 1
  string = ""
  for i in range(len(ans)):
    if i < len(ans) - 1:
      string += ans[i] + "\n"
    else:
      string += ans[i]
  return string

n = int(input())
list1 = input().split()
list1 = [int(i) for i in list1]
print(function(n, list1))
    

Fixed submission:
def function(n, list1):
  ans = [0] * n
  for i in list1:
    ans[i - 1] += 1
  string = ""
  for i in range(len(ans)):
    if i < len(ans) - 1:
      string += str(ans[i]) + "\n"
    else:
      string += str(ans[i])
  return string
 
n = int(input())
list1 = input().split()
list1 = [int(i) for i in list1]
print(function(n, list1))
Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a, b):
  if b > a:
    temp = b
    b = a
    a = temp
  if a % b == 0:
    return b
  else:
    return gcd(b, a % b)

def sum_of_gcd(k):
  ans = 0
  for i in range(1, k + 1):
    for j in range(1, k + 1):
      for k in range(1, k + 1):
        ans += gcd(i, gcd(j, k))
  return ans

n = int(input())
print(sum_of_gcd(n))

Fixed submission:
def gcd(a, b):
  if b > a:
    temp = b
    b = a
    a = temp
  if a % b == 0:
    return b
  else:
    return gcd(b, a % b)
def sum_of_gcd(k):
  ans = 0
  for i in range(1, k + 1):
    for j in range(1, k + 1):
      for k in range(1, k + 1):
        if i < j and j < k:
          ans += gcd(i, gcd(j, k)) * 6
        elif i < j and j == k:
          ans += gcd(i, gcd(j, k)) * 3
        elif i == j and j < k:
          ans += gcd(i, gcd(j, k)) * 3
        elif i == j and j == k:
          ans += gcd(i, gcd(j, k))
  return ans
 
n = int(input())
print(sum_of_gcd(n))

Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a, b):
  if b > a:
    temp = b
    b = a
    a = temp
  if a % b == 0:
    return b
  else:
    return gcd(b, a % b)

def sum_of_gcd(k):
  ans = 0
  for i in range(1, k + 1):
    for j in range(1, k + 1):
      for k in range(1, k + 1):
        ans += gcd(i, gcd(j, k))
  return ans

n = int(input())
print(sum_of_gcd(n))
        

Fixed submission:
def gcd(a, b):
  if b > a:
    temp = b
    b = a
    a = temp
  if a % b == 0:
    return b
  else:
    return gcd(b, a % b)
def sum_of_gcd(k):
  ans = 0
  for i in range(1, k + 1):
    for j in range(1, k + 1):
      for k in range(1, k + 1):
        if i < j and j < k:
          ans += gcd(i, gcd(j, k)) * 6
        elif i < j and j == k:
          ans += gcd(i, gcd(j, k)) * 3
        elif i == j and j < k:
          ans += gcd(i, gcd(j, k)) * 3
        elif i == j and j == k:
          ans += gcd(i, gcd(j, k))
  return ans
 
n = int(input())
print(sum_of_gcd(n))
Buggy python submission (verdict: Runtime Error):
line1 = input().split()
n = int(line1[0])
k = int(line1[1])

print(min(n % k, abs(n % k - k))

Fixed submission:
line1 = input().split()
n = int(line1[0])
k = int(line1[1])
 
print(min(n % k, abs(n % k - k)))
Buggy python submission (verdict: Time Limit Exceeded):
def function(n):
  string = str(n)
  for i in range(len(string) - 1):
    if int(string[i]) - int(string[i + 1]) > 1:
      return i + 1
    elif int(string[i + 1]) - int(string[i]) > 1:
      return i
  return -1
 
k = int(input())
ans = []
n = 1
while len(ans) < k:
  m = function(n)
  if m == -1:
    ans.append(n)
    n += 1
  else:
    n = n + 10 ** (len(str(n)) - m - 1) - n % (10 ** (len(str(n)) - m - 1))
print(ans[-1])

Fixed submission:
def function(n):
  string = str(n)
  for i in range(len(string) - 1):
    error = int(string[i]) - int(string[i + 1])
    if error > 1:
      return i + 1, error
    elif error < -1:
      return i, abs(error)
  return -1, 0
 
k = int(input())
ans = []
n = 1
while len(ans) < k:
  m, error = function(n)
  if m == -1:
    ans.append(n)
    n += 1
  else:
    n = n + (error - 1) * (10 ** (len(str(n)) - m - 1)) - n % (10 ** (len(str(n)) - m - 1))
print(ans[-1])

Buggy python submission (verdict: Time Limit Exceeded):
def function(n):
  string = str(n)
  for i in range(len(string) - 1):
    if abs(int(string[i]) - int(string[i + 1])) > 1:
      return False
  return True

k = int(input())
ans = []
n = 1
while len(ans) < k:
  if function(n):
    ans.append(n)
  n += 1

print(ans[-1])

Fixed submission:
def function(n):
  string = str(n)
  for i in range(len(string) - 1):
    error = int(string[i]) - int(string[i + 1])
    if error > 1:
      return i + 1, error
    elif error < -1:
      return i, abs(error)
  return -1, 0
 
k = int(input())
ans = []
n = 1
while len(ans) < k:
  m, error = function(n)
  if m == -1:
    ans.append(n)
    n += 1
  else:
    n = n + (error - 1) * (10 ** (len(str(n)) - m - 1)) - n % (10 ** (len(str(n)) - m - 1))
print(ans[-1])
Buggy python submission (verdict: Runtime Error):
line1 = input().split()
n = int(line1[0])
k = int(line1[1])
c = int(line1[2])
s = list(input())
t = s[::-1]
l = [s.index("o") + 1]
r = [len(s) - t.index("o")]
for i in range(1, k):
  j = l[i - 1]
  m = r[i - 1]
  while j - l[i - 1] <= c or s[j] != "o":
    j += 1
  while r[i - 1] - m <= c or t[m] != "o":
    m -= 1
  r.append(m + 1)
  l.append(j + 1)
d = set(r) & set(l)
for i in d:
  print(i)

Fixed submission:
line1 = input().split()
n = int(line1[0])
k = int(line1[1])
c = int(line1[2])
s = list(input())
l = [s.index("o") + 1]
r = [len(s) - s[::-1].index("o")]
for i in range(1, k):
  j = l[i - 1]
  m = r[i - 1]
  while j - l[i - 1] <= c or s[j - 1] != "o":
    j += 1
  while r[i - 1] - m <= c or s[m - 1] != "o":
    m -= 1
  r.append(m)
  l.append(j)
r = r[::-1]
for i in range(len(r)):
  if r[i] == l[i]:
    print(r[i])
Buggy python submission (verdict: Runtime Error):
def ispossible(list1):
  if list1.count("5") == 2 and list1.count("7") == 1:
    return "YES"
  else:
    return "NO"

list1 = input().split()
print(isposible(list1))


Fixed submission:
def ispossible(list1):
  if list1.count("5") == 2 and list1.count("7") == 1:
    return "YES"
  else:
    return "NO"

list1 = input().split()
print(ispossible(list1))

Buggy python submission (verdict: Runtime Error):
def ispossible(list1):
  if list1.count("5") == 2 and list1.count("7") == 1:
    return "YES"
  else:
    return "NO"

list1 = input().split()
print(ispposible(list1))

Fixed submission:
def ispossible(list1):
  if list1.count("5") == 2 and list1.count("7") == 1:
    return "YES"
  else:
    return "NO"

list1 = input().split()
print(ispossible(list1))
Buggy python submission (verdict: Runtime Error):
def function(m, set1):
  set2 = set(str(m))
  if len(set1 & set2) > 0:
    return False
  else:
    return True
def function(n, set1):
  m = n
  while not function(m, set1):
    m += 1
  return m

line1 = input().split()
n = int(line1[0])
k = int(line1[1])
list1 = []
for i in range(k):
  list1.append(int(input()))
set1 = set(list1)

print(function(n, set1))
  

Fixed submission:
def function1(m, set1):
  set2 = set(str(m))
  if len(set1 & set2) > 0:
    return False
  else:
    return True
def function(n, set1):
  m = n
  while not function1(m, set1):
    m += 1
  return m

line1 = input().split()
n = int(line1[0])
k = int(line1[1])
list1 = input().split()
set1 = set(list1)

print(function(n, set1))
Buggy python submission (verdict: Time Limit Exceeded):

n = int(input())
a = list(map(int,input().split()))
t = [0]*(len(a)+1)

for i in range(len(a)+1):
    t[i] = a.count(i+1)

for i in range(len(t)):
    print(t[i])


Fixed submission:

n = int(input())
a = list(map(int,input().split()))
t = [0]*(len(a)+1)

for i in range(len(a)):
    t[a[i]-1] += 1

for i in range(len(t)):
    print(t[i])
Buggy python submission (verdict: Time Limit Exceeded):

n,k = map(int,input().split())

if abs(n - abs(n-k)) == 1:
    print(0)
else:
    while n > abs(n-k):
        if n > abs(n-k):
            n = abs(n-k)
    print(n)


Fixed submission:
n,k = map(int,input().split())
a = n % k
if a < abs(a-k):
    print(a)
else:
    print(abs(a-k))

Buggy python submission (verdict: Time Limit Exceeded):

n,k = map(int,input().split())

if abs(n - abs(n-k)) == 1:
    print(0)

else:
    while n > abs(n-k):
        if n > abs(n-k):
            n = abs(n-k)
    print(n)


Fixed submission:
n,k = map(int,input().split())
a = n % k
if a < abs(a-k):
    print(a)
else:
    print(abs(a-k))
Buggy python submission (verdict: Runtime Error):

n = int(input())
a = list(map(int,input().split()))
b = a.copy()
b = set(b)
b = list(b)
c = []
ans = []

for i in range(len(b)):
    c.append(a.count(b[i]))
print(b)
print(c)
d = []
for i in range(len(b)):
    num = 0
    for j in range(len(b)):
        if i == j:
            num += int(((c[j]-1)*(c[j]-2))/2)
        else:
            num += int(((c[j])*(c[j]-1))/2)
    d.append(num)
print(d)

for i in range(n):
    for j in range(len(b)):
        if a[i] == b[j]:
            print(d[j])


Fixed submission:

n,m = map(int,input().split())

a = int(n*(n-1)/2)
b = int(m*(m-1)/2)

print(a+b)
Buggy python submission (verdict: Runtime Error):

n = int(input())
x = list(map(int,input().split()))
x.sort()
cnt = 0
min = 0

for i in range(x[0], x[-1] + 1):
    for j in range(n):
        cnt += (x[j] - i) ** 2

    if i == x[0]:
        minimum = cnt

    minimum = min([minimum, cnt])
    cnt = 0

print(minimum)


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

x.sort()
cnt = 0
minimum = 0
for i in range(x[0], x[-1] + 1):
    for j in range(n):
        cnt += (x[j] - i) ** 2

    if i == x[0]:
        minimum = cnt

    minimum = min([minimum, cnt])
    cnt = 0

print(minimum)
Buggy python submission (verdict: Time Limit Exceeded):

n = int(input())
s = []
a = []
mx = 0
b = []
c = []
d = []

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

a = set(s)
a = list(a)

for j in range(len(a)):
    b.append(s.count(a[j]))

mx = max(b)
#print(b)

for k in range(len(b)):
    if b[k] == mx:
        c.append(k)
for l in range(len(c)):
    d.append(a[c[l]])
d.sort()

for i in range(len(d)):
    print(d[i])


Fixed submission:

n = int(input())
s = [input() for i in range(n)]

d = {}
for st in s:
    d[st] = d.get(st, 0) + 1
#print(d)

t = max(d.values())
ans = []
for p in d:
    if d[p] == t:
        ans.append(p)
#print(ans)

ans.sort()
print("\n".join(ans))

Buggy python submission (verdict: Time Limit Exceeded):

n = int(input())
s = []
a = []
mx = 0
b = []
c = []
d = []

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

a = set(s)
a = list(a)

for j in range(len(a)):
    b.append(s.count(a[j]))

mx = max(b)
#print(b)

for k in range(len(b)):
    if b[k] == mx:
        c.append(k)
for l in range(len(c)):
    d.append(a[c[l]])
d.sort()

for i in range(len(d)):
    print(d[i])


Fixed submission:

n = int(input())
s = [input() for i in range(n)]

d = {}
for st in s:
    d[st] = d.get(st, 0) + 1
#print(d)

t = max(d.values())
ans = []
for p in d:
    if d[p] == t:
        ans.append(p)
#print(ans)

ans.sort()
print("\n".join(ans))
Buggy python submission (verdict: Time Limit Exceeded):

n = int(input())
a = list(map(int,input().split()))
status = 0

for i in range(n):
    if a.count(a[i]) != 1:
        status = 1
        break
    else:
        pass

if status == 0:
    print("YES")
else:
    print("NO")


Fixed submission:

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

b = set(a)

if len(a) == len(b):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):

n = int(input())
p = list(map(int,input().split()))
ans = 1
l = []

for i in range(1,n+1):
    l = p[0:i]
    if p[i] <= min(l):
        ans += 1
    else:
        pass

print(ans)


Fixed submission:

n = int(input())
p = list(map(int,input().split()))
ans = 0
currentMin = 10 ** 9
s = []

for i in range(n):
    if currentMin > min(currentMin,p[i]):
        currentMin = min(currentMin,p[i])
        s.append(currentMin)
    else:
        s.append(currentMin)

for i in range(len(p)):
    if p[i] == s[i]:
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):

n = int(input())
p = list(map(int,input().split()))
ans = 1
l = []

for i in range(1,n):
    l = p[0:i]
    if p[i] <= min(l):
        ans += 1
    else:
        pass

print(ans)


Fixed submission:

n = int(input())
p = list(map(int,input().split()))
ans = 0
currentMin = 10 ** 9
s = []

for i in range(n):
    if currentMin > min(currentMin,p[i]):
        currentMin = min(currentMin,p[i])
        s.append(currentMin)
    else:
        s.append(currentMin)

for i in range(len(p)):
    if p[i] == s[i]:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):

n,m = map(int,input().split())
ans = [0]*n
miss = [0]*n

for _ in range(m+1):
    p,s = map(str,input().split())
    p = int(p)
#    print(p,s)
    if ans[p-1] == 0 and s == "WA":
        miss[p-1] += 1
    elif ans[p-1] == 0 and s == "AC":
        ans[p-1] += 1
    else:
        pass

#print(ans)
#print(miss)
a = sum(ans)
b = sum(miss)

print(a,b)


Fixed submission:

n, m = map(int, input().split())
bool_lst = [False] * n
ac_lst = [0] * n
wa_lst = [0] * n
for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if bool_lst[p] == False:
        if s == 'AC':
            bool_lst[p] = True
            ac_lst[p] += 1
        else:
            wa_lst[p] += 1

ac_cnt = 0
wa_cnt = 0
for i in range(n):
    if bool_lst[i] == True:
        ac_cnt += ac_lst[i]
        wa_cnt += wa_lst[i]

print(ac_cnt, wa_cnt)
Buggy python submission (verdict: Time Limit Exceeded):

a,b,k = map(int,input().split())

while k > 0:
    if a > 0:
        a -= 1
        k -= 1
    else:
        b -= 1
        k -= 1
print(a,b)


Fixed submission:

a,b,k = map(int,input().split())

if a + b <= k:
    print(0,0)
elif a >= k:
    print(a-k,b)
elif a < k:
    print(0,b-(k-a))


"""
while k > 0:
    if a > 0:
        a -= 1
        k -= 1
    else:
        b -= 1
        k -= 1
print(a,b)
"""
Buggy python submission (verdict: Runtime Error):

s = input()
d = {"SUN":0,"MO":6,"TUE":5,"WED":4,"THU":3,"FRI":2,"SAT":1}

print(d[s])


Fixed submission:

s = input()
d = {"SUN":7,"MON":6,"TUE":5,"WED":4,"THU":3,"FRI":2,"SAT":1}

print(d[s])
Buggy python submission (verdict: Runtime Error):

n = int(input())
a = list(map(int,input().split()))
d = [0]

for i in range(n):
    d.append(d[i] ;a[i])

ans = d[-1]

for i in range(n):
    ans =min(ans,abs(d[-1] -2*d[i]))
print(ans)


Fixed submission:

n = int(input())
a = list(map(int,input().split()))
d = [0]

for i in range(n):
    d.append(d[i] + a[i])

ans = d[-1]

for i in range(n):
    ans =min(ans,abs(d[-1] -2*d[i]))
print(ans)
Buggy python submission (verdict: Runtime Error):

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


Fixed submission:

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

if a <= 2*b:
    print(0)
else:
    print(a - 2*b)
Buggy python submission (verdict: Runtime Error):

n = int(input())
s = input()

ans = 1
for i in range(n-1):
    if s[i] != a[i + 1]:
        ans += 1
print(ans)


Fixed submission:
n = int(input())
s = input()
ans = 1
for i in range(n-1):
    if s[i] != s[i+1]:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):

n = int(input())

count = 0

for i in range(n):
    if i / 0:
        count += 1
    else:
        pass

print(count/n)


Fixed submission:
n = int(input())
 
count = 0
 
for i in range(n):
    if i % 2 != 0:
        count += 1
    else:
        pass
 
print(1-float(count/n))
Buggy python submission (verdict: Runtime Error):
N,K = input().split()
N = int(N)
K = int(K)

h = input().split()

count = 0

for i in range(n):
    if h[i] >= K:
        count += 1
    else:
        pass

print(count)




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

count = 0

for i in a:
    if i>= k:
        count += 1
print(count)

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

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

count = 0

for i in range(n):
    if h[i] >= K:
        count += 1
    else:
        pass

print(count)




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

count = 0

for i in a:
    if i>= k:
        count += 1
print(count)