Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))
t = []
c = 0
for i in p:
    t += [i]
    if i <= min(t):
        c += 1
print(c)


Fixed submission:
n = int(input())
p = list(map(int, input().split()))
t = n
c = 0
for i in range(n):
    t = min(t, p[i])
    if p[i] <= t:
        c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
N = int(input())
print(N // 10 + sum[N // (50 ** i) for i in range(100)])


Fixed submission:
N = int(input())  
if N%2==0: 
  r = 0 
  for i in range(99): 
    r += N // 10 // 5 ** i 
  print(r) 
else: 
  print(0)

Buggy python submission (verdict: Runtime Error):
N = int(input())
print(N // 10 + sum[N // (50 ** i) for i in range(100)])


Fixed submission:
N = int(input())  
if N%2==0: 
  r = 0 
  for i in range(99): 
    r += N // 10 // 5 ** i 
  print(r) 
else: 
  print(0)
Buggy python submission (verdict: Runtime Error):
n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
p = k - q
s = [[i, p] for i in range(n)]
for i in a:
    s[i][1] += 1

for i in s:
    if i[1] < 1:
        print("No")
    else:
        print("Yes")


Fixed submission:
n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
p = k - q
s = [p]*n
for i in a:
    s[i-1] += 1

for i in s:
    if i < 1:
        print("No")
    else:
        print("Yes")
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())

s = []

for i in range(1, max(a, b)):
    if a % i == 0 and b % i == 0:
        s.append(i)

sorted(s)

s = s[::-1]

print(s[k-1])


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

s = []

for i in range(1, max(a, b)+1):
    if a % i == 0 and b % i == 0:
        s.append(i)

sorted(s)

s = s[::-1]

print(s[k-1])

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

s = []

for i in range(1, max(a, b)):
    if a % i == 0 and b % i == 0:
        s.append(i)

sorted(s)

print(s[len(s) - k])


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

s = []

for i in range(1, max(a, b)+1):
    if a % i == 0 and b % i == 0:
        s.append(i)

sorted(s)

s = s[::-1]

print(s[k-1])

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

s = []

for i in range(1, max(a, b)):
    if a % i == 0 and b % i == 0:
        s.append(i)

sorted(s, reverse=True)

print(s[len(s) - k])


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

s = []

for i in range(1, max(a, b)+1):
    if a % i == 0 and b % i == 0:
        s.append(i)

sorted(s)

s = s[::-1]

print(s[k-1])
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
h = list(map(int, input().split()))
dp = [float("inf") for _ in range(N)]
dp[0] = 0
for i in range(N):
    for j in range(1, K + 1):
        if i + j < N:
            dp[i + j] = min(dp[i + j], dp[i] + abs(h[i] - h[i + j]))
print(dp[N - 1])


Fixed submission:
N, K = map(int, input().split())
h = list(map(int, input().split()))
dp = [float("inf") for _ in range(N)]
dp[0] = 0
for i in range(N):
    for j in range(1, K + 1):
        if i + j < N:
            dp[i + j] = min(dp[i + j], dp[i] + abs(h[i] - h[i + j]))
print(dp[N - 1])
Buggy python submission (verdict: Runtime Error):
import itertools
S = input()
S = list(S)
l = max(list(sum(c) for c  in itertools.combinations(l, 3)))
print(adb(753-l))

Fixed submission:
s = input()
t = 100000000000
for i in range(len(s)-2):
    t = min(abs(753 - int(s[i]+s[i+1]+s[i+2])), t)
print(t)
Buggy python submission (verdict: Runtime Error):
n = int(input())


def dfs(s):
    if int(s) > n:
        return 0
    ret = 1 if all(s.count > 0 for c in '753') else 0
    for c in '753':
        ret += dfs(s + c)
    return ret


print(dfs('0'))


Fixed submission:
n = int(input())


def dfs(s):
    if int(s) > n:
        return 0
    ret = 1 if all(s.count(c) > 0 for c in '753') else 0
    for c in '753':
        ret += dfs(s + c)
    return ret


print(dfs('0'))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
X = 0
for i in range(356, N+1):
	A = str(i)
	if A.count('3') > 0 and A.count('5') > 0 and A.count('7') > 0 and A.count('1')== 0 and A.count('2')== 0 and A.count('4')== 0 and A.count('6')== 0 and A.count('8')== 0 and A.count('9')== 0 and A.count('0')== 0:
		X = X+1
print(X)

Fixed submission:
n = int(input())


def dfs(s):
    if int(s) > n:
        return 0
    ret = 1 if all(s.count(c) > 0 for c in '753') else 0
    for c in '753':
        ret += dfs(s + c)
    return ret


print(dfs('0'))
Buggy python submission (verdict: Runtime Error):
from collections import Counter

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

if len(set(v)) != 1:
    a = Counter(v[0::2]).most_common()
    b = Counter(v[1::2]).most_common()

    if a[0] != b[0]:
        q = ((len(v[0::2]) - a[0][1]) + (len(v[1::2]) - b[0][1]))
        w = ((len(v[0::2]) - a[0][1]) + (len(v[1::2]) - b[1][1]))
        e = ((len(v[0::2]) - a[1][1]) + (len(v[1::2]) - b[0][1]))
        print(min(q, w, e))
else:
    print(len(v[1::2]))


Fixed submission:
from collections import Counter

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

if len(set(v)) != 1:
    a = Counter(v[0::2]).most_common()
    b = Counter(v[1::2]).most_common()
    if a[0][0] != b[0][0]:
        print((len(v[0::2]) - a[0][1]) + (len(v[1::2]) - b[0][1]))
    else:
        if a[0][1] < b[0][1]:
            print((len(v[0::2]) - a[0][1]) + (len(v[1::2]) - b[1][1]))
        elif a[0][1] > b[0][1]:
            print((len(v[0::2]) - a[1][1]) + (len(v[1::2]) - b[0][1]))
        elif a[0][1] == b[0][1]:
            if len(a) != 1 and len(b) != 1:
                if a[1][1] > b[1][1]:
                    print((len(v[0::2]) - a[1][1]) + (len(v[1::2]) - b[0][1]))
                elif a[1][1] < b[1][1]:
                    print((len(v[0::2]) - a[0][1]) + (len(v[1::2]) - b[1][1]))
                elif a[1][1] == b[1][1]:
                    print((len(v[0::2]) - a[0][1]) + (len(v[1::2]) - b[1][1]))
            elif len(a) != 1:
                print((len(v[0::2]) - a[1][1]) + (len(v[1::2]) - b[0][1]))
            elif len(b) != 1:
                print((len(v[0::2]) - a[0][1]) + (len(v[1::2]) - b[1][1]))
else:
    print(len(v[1::2]))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(a%(a//b))

Fixed submission:
a,b=map(int,input().split())
print(int(a%b!=0))
Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split()))
l = [[0,1],[1,2],[0,3]
ll = []
for i,j in l:
	ll.append(abs(A[i]-A[j]))
print(min(ll))

Fixed submission:
A = list(map(int, input().split()))
b = [[0, 1], [2, 1], [2, 0]]
l = 0
n = []
for i, j in b:
	l = l + abs(A[j]-A[i])
	n.append(abs(A[j]-A[i]))
l = l - max(n)
print(l)

Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split()))
l = [[0,1],[1,2],[0,3]
ll
for i,j in l:
	ll.append(abs(A[i]-A[j]))
print(min(ll))

Fixed submission:
A = list(map(int, input().split()))
b = [[0, 1], [2, 1], [2, 0]]
l = 0
n = []
for i, j in b:
	l = l + abs(A[j]-A[i])
	n.append(abs(A[j]-A[i]))
l = l - max(n)
print(l)
Buggy python submission (verdict: Runtime Error):
D, N = map(int, input().split())
l = []
for i in range(1, 100):
	if 100/i == D:
		l.append(i)
print(l[N-1])

Fixed submission:
a,b=map(int,input().split())
if a<9 and b<9:
  print("Yay!")
else:
  print(":(")
Buggy python submission (verdict: Runtime Error):
a=input().split()[0]
b=input().split()[1]
c=input().split()[2]
print(a+b+c)

Fixed submission:
i=input;print(i()[0]+i()[1]+i()[2])
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=int(input())
if n%500 - a < 0:
  print("No")
else:
  prnt("Yes")

Fixed submission:
n=int(input())
a=int(input())
if n%500 - a < 1:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
from collections import Counter
w=input()
c=Counter(c).values()
s="Yes"
for i in c:
  if i%2==1:
    s="No"
print(s)

Fixed submission:
from collections import Counter
w=input()
c=Counter(w).values()
s="Yes"
for i in c:
  if i%2==1:
    s="No"
print(s)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = map(int,input().split())

for p in range(k):
  if a >= 1:
    a -= 1
  else:
    if b >= 1:
      b -= 1
    
print(str(a) + ' ' + str(b))

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

a -= k
if a <= -1:
  p = abs(a)
  a = 0
  b -= p
  if b <= -1:
    b = 0
    
print(str(a) + ' ' + str(b))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())

if n == 1:
  print("Hello World")
if n == 2:
  print(a + b)

Fixed submission:
n = int(input())

if n == 1:
  print("Hello World")
if n == 2:
  a = int(input())
  b = int(input())
  print(a + b)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())

if n == 1:
  print("Hello World")
if n == 2:
  print(a + b)

Fixed submission:
n = int(input())

if n == 1:
  print("Hello World")
if n == 2:
  a = int(input())
  b = int(input())
  print(a + b)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
somme=sum(A)

D={x:A.count(x) for x in set(A)}

for step in range(Q):
    b,c=map(int,input().split())
    if b not in D:
        print(somme)
        continue

    somme=somme+(c-b)*D[b]
    if c in D:
        D[c]=D[c]+D[b]
    else:
        D[c]=D[b]
    del D[b]    
    print(somme)

Fixed submission:
N=int(input())
A=[int(x) for x in input().split()]
Q=int(input())
somme=sum(A)

from collections import Counter
D=Counter()

for l in A:
    D[l]+=1
    
for step in range(Q):
    b,c=map(int,input().split())

    if b not in D:
        print(somme)
        continue

    somme=somme+(c-b)*D[b]

    D[c]=D[c]+D[b]
    del D[b]    
    print(somme)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
somme=sum(A)

D={x:A.count(x) for x in set(A)}

for step in range(Q):
    b,c=map(int,input().split())
    if b not in D.keys():
        print(somme)
        continue

    somme=somme+(c-b)*D[b]
    if c in D.keys():
        D[c]=D[c]+D[b]
    else:
        D[c]=D[b]
    del D[b]    
    print(somme)

Fixed submission:
N=int(input())
A=[int(x) for x in input().split()]
Q=int(input())
somme=sum(A)

from collections import Counter
D=Counter()

for l in A:
    D[l]+=1
    
for step in range(Q):
    b,c=map(int,input().split())

    if b not in D:
        print(somme)
        continue

    somme=somme+(c-b)*D[b]

    D[c]=D[c]+D[b]
    del D[b]    
    print(somme)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N=int(input())
A=np.array(list(map(int,input().split())))
Q=int(input())
somme=sum(A)
L=np.zeros(10**5+1)
for i in range(1,N+1):
    L[i]=sum(A==i)

for step in range(Q):
    b,c=map(int,input().split())
    somme=somme+(c-b)*L[b]
    L[c]=L[c]+L[b]
    print(int(somme))    

Fixed submission:
N=int(input())
A=[int(x) for x in input().split()]
Q=int(input())
somme=sum(A)

from collections import Counter
D=Counter()

for l in A:
    D[l]+=1
    
for step in range(Q):
    b,c=map(int,input().split())

    if b not in D:
        print(somme)
        continue

    somme=somme+(c-b)*D[b]

    D[c]=D[c]+D[b]
    del D[b]    
    print(somme)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N=int(input())
A=np.array(list(map(int,input().split())))
Q=int(input())

for step in range(Q):
    b,c=map(int,input().split())
    A[A==b]=c
    print(sum(A))

Fixed submission:
N=int(input())
A=[int(x) for x in input().split()]
Q=int(input())
somme=sum(A)

from collections import Counter
D=Counter()

for l in A:
    D[l]+=1
    
for step in range(Q):
    b,c=map(int,input().split())

    if b not in D:
        print(somme)
        continue

    somme=somme+(c-b)*D[b]

    D[c]=D[c]+D[b]
    del D[b]    
    print(somme)
Buggy python submission (verdict: Runtime Error):
S='ABC'
if S='ABC':
  print('ARC')
else:
  print('ABC')

Fixed submission:
S=input()
if 'B' in S:
  print('ARC')
else:
  print('ABC')

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

Fixed submission:
S=input()
if 'B' in S:
  print('ARC')
else:
  print('ABC')
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
while True:
  c-=b
  if c<=0:
    print('Yes')
    break
  a-=d
  if a<=0:
    print('No')
    break

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

if S>W:
  print('safe')
else:
  print('unsafe')

Buggy python submission (verdict: Time Limit Exceeded):
S,W=map(int,input().split())
while 1<=S<=100:
  while 1<=W<=100:
    if S>W:
      print('safe')
    else:
      print('unsafe')

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

if S>W:
  print('safe')
else:
  print('unsafe')
Buggy python submission (verdict: Runtime Error):
R=int,input()
import math
def circleround(s):
  s=R*math.pi*2
s=R*math.pi*2
print(s)

Fixed submission:
import math
R=int(input())
print(math.pi*2*R)
Buggy python submission (verdict: Runtime Error):
N=input()
if '7' in N:
  print('Yes')
else:
  print(No)

Fixed submission:
N=input()
if '7' in N:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
print(chr(ord(input())+1)

Fixed submission:
print(chr(ord(input())+1))
Buggy python submission (verdict: Runtime Error):
def function(ar):
  print((ar.index(0))+1)

if __name__==__"main"__:
  ar=list(map(int, input().rstrip().split()))
  function(ar)

Fixed submission:
def function(ar):
    print(ar.index(0)+1)

if __name__ == '__main__':
    ar = list(map(int, input().rstrip().split()))
    function(ar)
Buggy python submission (verdict: Runtime Error):
k,n = map(int, input().split())
prices = list(int, input().split()).sort()
total = sum(prices[:n])
print(total)


Fixed submission:
k, n = map(int, input().split())
prices = list(map(int, input().split()))
prices.sort()
total = sum(prices[:n])
print(total)

Buggy python submission (verdict: Runtime Error):
k = input()
n = input()
price = list(input().split()).sort

total = sum(prices[:n])
print(total)

Fixed submission:
k, n = map(int, input().split())
prices = list(map(int, input().split()))
prices.sort()
total = sum(prices[:n])
print(total)
Buggy python submission (verdict: Runtime Error):
i1=input().split()

if i[0] > i[1]:
    print('>')
elif i[0] < i[1]:
    print('<')
else:
    print('=')

Fixed submission:
i=input().split()
x=ord(i[0])
y=ord(i[1])
 
if x > y:
    print('>')
elif x < y:
    print('<')
else:
    print('=')
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())

data = list(map(int, input().split() ))
data.sort()
print(sum(data[0:k]))

Fixed submission:
x = input()

if x.isupper():
	print("A")
else:
  	print("a")
Buggy python submission (verdict: Runtime Error):
n = int(input())

if (n % 10)==2 or 4 or 5 or 7 or 9:
	print ("hon")
elif (n % 10) == 0 or 1 or 6 or 8:
    print (n+"pon")
else
    prnt(n+"bon):

Fixed submission:
n = int(input())
# print(n % 10)
if (n % 10) in [2 , 4 , 5 , 7 , 9]:
	print ("hon")
elif (n % 10) in [ 0 , 1 , 6 , 8]:
    print ("pon")
else:
    print("bon")
Buggy python submission (verdict: Runtime Error):
na,nb,nm =  map(int, (input().split()))

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

mina = a[0]
minb = b[0]
for i in range(na):
    if a[i] < mina :
        mina = a[i]
for j in range(nb):
    if b[j] < minb :
        minb = b[j]
min = mina + minb

#  m入力
for k in range(nm):
    i,j,disc = map(int, input().split())
    if min > a[i-1]+b[j-1]-disc:
        min = a[i-1]+b[j-1]-disc

print(min)


Fixed submission:
s = input()

flag = 0

while flag==0 and len(s)!=0 :
    if s.endswith('hi'):
        s = s[0:len(s)-2]
    else:
        flag = 1
#    print(s)
#    print(len(s))

if flag == 1:
    print('No')
else:
    print('Yes')

Buggy python submission (verdict: Runtime Error):
na,nb,nm =  map(int, (input().split()))

# m 初期化
# m = [[0] * 3 for i in range(nm)]
d = [[0] * nb for i in range(na)]
#print(d)

a = list(map(int, input().split()))
b = list(map(int, input().split()))
#  print (a,b)

#  m入力
for k in range(nm):
    i,j,disc = map(int, input().split())
    if d[i][j] < disc:
        d[i][j] = disc
#print(d)

best = a[0] + b[0]

for i in range(na):
    for j in range(nb):
        price = a[i] + b[j] - d[i][j]
        if best > price:
            best = price

print(best)


Fixed submission:
s = input()

flag = 0

while flag==0 and len(s)!=0 :
    if s.endswith('hi'):
        s = s[0:len(s)-2]
    else:
        flag = 1
#    print(s)
#    print(len(s))

if flag == 1:
    print('No')
else:
    print('Yes')

Buggy python submission (verdict: Runtime Error):
na,nb,nm =  map(int, (input().split()))

# m 初期化
m = [[0] * 3 for i in range(nm)]
d = [[0] * nb for i in range(na)]
#print(d)

a = list(map(int, input().split()))
b = list(map(int, input().split()))
#  print (a,b)

#  m入力
for k in range(nm):
    i,j,disc = map(int, input().split())
    d[i][j]=disc

best = a[0] + b[0]

for i in range(na):
    for j in range(nb):
        price = a[i] + b[j] - d[i][j]
        if best > price:
            best = price

print(best)


Fixed submission:
s = input()

flag = 0

while flag==0 and len(s)!=0 :
    if s.endswith('hi'):
        s = s[0:len(s)-2]
    else:
        flag = 1
#    print(s)
#    print(len(s))

if flag == 1:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
s=input()
if s[0]=s[1] and s[1]=s[2]:
  print("Yes"
else:
  print("No"

Fixed submission:
s = input()
if s[0]==s[1] and s[1]==s[2]:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
s = input()
if s = "AAA" or "BBB":
	print("No")
else:
	print("Yer")
 

Fixed submission:
s = input()
if s[0]==s[1] and s[1]==s[2]:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
a,b,n = input().split()
set = n//(a+b)
rem = n % (a+b)
if rem <= a:
	return set * (a+b) + a
else:
	return set * (a+b) + rem


Fixed submission:
n,a,b = map(int, input().split())
if a==0 and b==0:
  	print(0)
else:
	set = n//(a+b)
	rem = n % (a+b)
	if rem >= a:
		print( set * a + a)
	else:
		print( set * a + rem)
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
flag = 0
for i in range(10*b, 11*b):
	if int(i * 0.08) == a:
		if flag==0:
			ans　=　i
			flag = 1
if flag == 1:
	print(ans)
else:
	print(-1)

Fixed submission:
a,b = map(int, input().split())
flag = 0
for i in range(10*b, 10*b+10):
	if int(i * 0.08) == a:
		if flag == 0:
			ans=i
			flag = 1
if flag == 1:
	print(ans)
else:
	print(-1)

Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
flag = 0
for i in range(10*b, 11*b):
	if int(i * 0.08) == a:
		if flag==0:
			ans=i
			flag = 1
if flag == 1:
	print(ans)
else:
	print(”-1”)

Fixed submission:
a,b = map(int, input().split())
flag = 0
for i in range(10*b, 10*b+10):
	if int(i * 0.08) == a:
		if flag == 0:
			ans=i
			flag = 1
if flag == 1:
	print(ans)
else:
	print(-1)

Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
flag=0
for i in range(10*b+1):
	if int(i * 0.08) == a and int(i * 0.1) == b:
		if flag==0:
			ans=i
            flag=1
if flag == 1:
	print(ans)
else:
	print(-1)

Fixed submission:
a,b = map(int, input().split())
flag = 0
for i in range(10*b, 10*b+10):
	if int(i * 0.08) == a:
		if flag == 0:
			ans=i
			flag = 1
if flag == 1:
	print(ans)
else:
	print(-1)
Buggy python submission (verdict: Runtime Error):
n, h = map(int, input().split())
a = list(map(int, input().split()))

sum = 0
for i in range(n):
	sum = sum + a[i]
if sum >= h :
	print("Yes")
else:
	print("No")


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

sum = 0
for i in range(n):
	sum = sum + a[i]
if sum >= h :
	print("Yes")
else:
	print("No")

Buggy python submission (verdict: Runtime Error):
n, h = map(int, input().split())
a = list(map(int, input().split()))

sum = 0
for i in range(n):
	sum = sum + a[i]
if sum >= h :
	print("Yes")
else:
	print("No")


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

sum = 0
for i in range(n):
	sum = sum + a[i]
if sum >= h :
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
 
arS = [False] * (n+1)
arP = [False] * (n+1)
 
score = 0
penalty = 0

for i in range(m):
	id, res = input().split()
	id = int(id)
	if (res == "AC") and (arS[id]==False):
		arS[id] = True
		score = score+1
        penalty = penalty * arP[id]
	if (res == "WA"): 
		arP[id] = arP[id] + 1
        
print(score, penalty)

Fixed submission:
n,m = map(int, input().split())
 
arS = [False] * (n+1)
arP = [False] * (n+1)
 
score = 0
penalty = 0

for i in range(m):
	id, res = input().split()
	id = int(id)
	if (res == "AC") and (arS[id]==False):
		arS[id] = True
		score = score+1
		penalty = penalty + arP[id]
	if (res == "WA"): 
		arP[id] = arP[id] + 1
        
print(score, penalty)

Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
 
arS = [False] * (n+1)
 
score = 0
penalty = 0
for i in range(m):
	id, res = input().split()
	id = int(id)
#	print(type(id),type(res))
	if (res == "AC") and (arS[id]==False):
		arS[id] = True
		score = score+1
	if (res == "WA")  # and (arS[id]==False): 
		penalty = penalty + 1
        
print(score, penalty)

Fixed submission:
n,m = map(int, input().split())
 
arS = [False] * (n+1)
arP = [False] * (n+1)
 
score = 0
penalty = 0

for i in range(m):
	id, res = input().split()
	id = int(id)
	if (res == "AC") and (arS[id]==False):
		arS[id] = True
		score = score+1
		penalty = penalty + arP[id]
	if (res == "WA"): 
		arP[id] = arP[id] + 1
        
print(score, penalty)

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

arS = [False] * n

score = 0
penalty = 0
for i in range(m):
	id, res = input().split()
	id = int(id)
#	print(type(id),type(res))
	if (res == "AC") and (arS[id]==False):
		arS[id] = True
		score = score+1
	if (res == "WA") and (arS[id]==False): 
		penalty = penalty + 1
        
print(score, penalty)

Fixed submission:
n,m = map(int, input().split())
 
arS = [False] * (n+1)
arP = [False] * (n+1)
 
score = 0
penalty = 0

for i in range(m):
	id, res = input().split()
	id = int(id)
	if (res == "AC") and (arS[id]==False):
		arS[id] = True
		score = score+1
		penalty = penalty + arP[id]
	if (res == "WA"): 
		arP[id] = arP[id] + 1
        
print(score, penalty)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()

count = 0
for i in range(n-3)
	if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
		count = count + 1
print(count)

Fixed submission:
n=int(input())
s=input()
 
count = 0
for i in range(n-3+1):
#	print(s[i],s[i+1],s[i+2])
	if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
		count = count + 1
print(count)