Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
ac = [0]*m
wa = [0]*m
for i in range(m):
    p,s = input().split()
    p = int(p)
    if ac[p-1]:
        continue
    if s == 'AC':
        ac[p-1] = 1
    else:
        wa[p-1] += 1
count_ac = 0
count_wa = 0
for i in range(n):
    count_ac += ac[i]
    if ac[i]:
        count_wa += wa[i]
print(str(count_ac) + " " + str(count_wa))

Fixed submission:
n,m = map(int,input().split())
ac = [0]*n
wa = [0]*n
for i in range(m):
    p,s = input().split()
    p = int(p)
    if ac[p-1]:
        continue
    if s == 'AC':
        ac[p-1] = 1
    else:
        wa[p-1] += 1
count_ac = 0
count_wa = 0
for i in range(n):
    count_ac += ac[i]
    if ac[i]:
        count_wa += wa[i]
print(str(count_ac) + " " + str(count_wa))

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
count_ac = 0
count_wa = 0
l = [('','')]*m
memo_n = []
import collections
idx = 0
for i in range(m):
    t = tuple(input().split())
    l[i] = t
    if t[1] == 'AC' and t[0] not in memo_n:
        memo_n.append(t[0])
        count_ac += 1
        c = collections.Counter(l[idx:i])
        # count_wa += l.count((t[0],'WA'))
        count_wa += c[(t[0],'WA')]

print(str(count_ac) + " " + str(count_wa))

Fixed submission:
n,m = map(int,input().split())
ac = [0]*n
wa = [0]*n
for i in range(m):
    p,s = input().split()
    p = int(p)
    if ac[p-1]:
        continue
    if s == 'AC':
        ac[p-1] = 1
    else:
        wa[p-1] += 1
count_ac = 0
count_wa = 0
for i in range(n):
    count_ac += ac[i]
    if ac[i]:
        count_wa += wa[i]
print(str(count_ac) + " " + str(count_wa))

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
count_ac = 0
count_wa = 0
l = [('','')]*m
memo_n = []
import collections
for i in range(m):
    t = tuple(input().split())
    l[i] = t
    if t[1] == 'AC' and t[0] not in memo_n:
        memo_n.append(t[0])
        count_ac += 1
        c = collections.Counter(l)
        # count_wa += l.count((t[0],'WA'))
        count_wa += c[(t[0],'WA')]

print(str(count_ac) + " " + str(count_wa))

Fixed submission:
n,m = map(int,input().split())
ac = [0]*n
wa = [0]*n
for i in range(m):
    p,s = input().split()
    p = int(p)
    if ac[p-1]:
        continue
    if s == 'AC':
        ac[p-1] = 1
    else:
        wa[p-1] += 1
count_ac = 0
count_wa = 0
for i in range(n):
    count_ac += ac[i]
    if ac[i]:
        count_wa += wa[i]
print(str(count_ac) + " " + str(count_wa))

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
count_ac = 0
count_wa = 0
l = []
memo_n = []
for i in range(m):
    t = tuple(input().split())
    l.append(t)
    if t[1] == 'AC' and t[0] not in memo_n:
        memo_n.append(t[0])
        count_ac += 1
        count_wa += l.count((t[0],'WA'))

print(str(count_ac) + " " + str(count_wa))

Fixed submission:
n,m = map(int,input().split())
ac = [0]*n
wa = [0]*n
for i in range(m):
    p,s = input().split()
    p = int(p)
    if ac[p-1]:
        continue
    if s == 'AC':
        ac[p-1] = 1
    else:
        wa[p-1] += 1
count_ac = 0
count_wa = 0
for i in range(n):
    count_ac += ac[i]
    if ac[i]:
        count_wa += wa[i]
print(str(count_ac) + " " + str(count_wa))

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
count_ac = 0
count_wa = 0
l = []
for i in range(m):
    t = tuple(input().split())
    l.append(t)
for i in range(1,n+1):
    if (str(i), 'AC') in l:
        idx = l.index((str(i), 'AC'))
        count_ac += 1
        count_wa += l[:idx].count((str(i),'WA'))

print(str(count_ac) + " " + str(count_wa))

Fixed submission:
n,m = map(int,input().split())
ac = [0]*n
wa = [0]*n
for i in range(m):
    p,s = input().split()
    p = int(p)
    if ac[p-1]:
        continue
    if s == 'AC':
        ac[p-1] = 1
    else:
        wa[p-1] += 1
count_ac = 0
count_wa = 0
for i in range(n):
    count_ac += ac[i]
    if ac[i]:
        count_wa += wa[i]
print(str(count_ac) + " " + str(count_wa))

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
count_ac = 0
count_wa = 0
l = []
for i in range(m):
    t = tuple(input().split())
    l.append(t)
set_l = list(set(l))
for i in range(len(set_l)):
    if set_l[i][1] == 'AC':
        count_ac += 1
for i in range(1,n+1):
    if (str(i), 'AC') in l:
        idx = l.index((str(i), 'AC'))
        count_wa += l[:idx].count((str(i),'WA'))

print(str(count_ac) + " " + str(count_wa))

Fixed submission:
n,m = map(int,input().split())
ac = [0]*n
wa = [0]*n
for i in range(m):
    p,s = input().split()
    p = int(p)
    if ac[p-1]:
        continue
    if s == 'AC':
        ac[p-1] = 1
    else:
        wa[p-1] += 1
count_ac = 0
count_wa = 0
for i in range(n):
    count_ac += ac[i]
    if ac[i]:
        count_wa += wa[i]
print(str(count_ac) + " " + str(count_wa))