Buggy python submission (verdict: Runtime Error):
n,m=map(int, input().split())
h = [list(map(str,input().split())) for _ in range(m)]
# print(h)
for i in range(m):
    h[i][0] = int(h[i][0])
l=set()
penalty = 0
import numpy as np
p = np.zeros(n)
for i in range(m):
    if h[i][0] not in l:
        if h[i][1] == 'AC':
            l.add(h[i][0])
            penalty += p[h[i][0]-1]
        else:
            p[h[i][0]-1] += 1
ansnum = len(l)

# for i in l:
#     penalty += p[i-1]

print(ansnum,int(penalty))

Fixed submission:
n,m=map(int, input().split())
h = [list(map(str,input().split())) for _ in range(m)]
# print(h)
for i in range(m):
    h[i][0] = int(h[i][0])
l=set()
penalty = 0
import numpy as np
p = np.zeros(n)
for i in range(m):
    if h[i][0] not in l:
        if h[i][1] == 'AC':
            l.add(h[i][0])
            penalty += p[h[i][0]-1]
        else:
            p[h[i][0]-1] += 1
ansnum = len(l)

# for i in l:
#     penalty += p[i-1]

print(ansnum,int(penalty))

Buggy python submission (verdict: Runtime Error):
n,m=map(int, input().split())
h = [list(map(str,input().split())) for _ in range(m)]
# print(h)
for i in range(m):
    h[i][0] = int(h[i][0])
l=[]
penalty = 0
import numpy as np
p = np.zeros(n)
for i in range(m):
    if h[i][0] not in l:
        if h[i][1] == 'AC':
            l.append(h[i][0])
            penalty += p[i-1]
        else:
            p[h[i][0]-1] += 1
ansnum = len(l)

# for i in l:
#     penalty += p[i-1]

print(ansnum,int(penalty))

Fixed submission:
n,m=map(int, input().split())
h = [list(map(str,input().split())) for _ in range(m)]
# print(h)
for i in range(m):
    h[i][0] = int(h[i][0])
l=set()
penalty = 0
import numpy as np
p = np.zeros(n)
for i in range(m):
    if h[i][0] not in l:
        if h[i][1] == 'AC':
            l.add(h[i][0])
            penalty += p[h[i][0]-1]
        else:
            p[h[i][0]-1] += 1
ansnum = len(l)

# for i in l:
#     penalty += p[i-1]

print(ansnum,int(penalty))

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int, input().split())
h = [list(map(str,input().split())) for _ in range(m)]
# print(h)
for i in range(m):
    h[i][0] = int(h[i][0])
l=[]
penalty = 0
import numpy as np
p = np.zeros(n)
for i in range(m):
    if h[i][0] not in l:
        if h[i][1] == 'AC':
            l.append(h[i][0])
            penalty += p[h[i][0]-1]
        else:
            p[h[i][0]-1] += 1
ansnum = len(l)

# for i in l:
#     penalty += p[i-1]

print(ansnum,int(penalty))

Fixed submission:
n,m=map(int, input().split())
h = [list(map(str,input().split())) for _ in range(m)]
# print(h)
for i in range(m):
    h[i][0] = int(h[i][0])
l=set()
penalty = 0
import numpy as np
p = np.zeros(n)
for i in range(m):
    if h[i][0] not in l:
        if h[i][1] == 'AC':
            l.add(h[i][0])
            penalty += p[h[i][0]-1]
        else:
            p[h[i][0]-1] += 1
ansnum = len(l)

# for i in l:
#     penalty += p[i-1]

print(ansnum,int(penalty))

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int, input().split())
h = [list(map(str,input().split())) for _ in range(m)]
# print(h)
for i in range(m):
    h[i][0] = int(h[i][0])
l=[]
import numpy as np
p = np.zeros(n)
for i in range(m):
    if h[i][0] not in l:
        if h[i][1] == 'AC':
            l.append(h[i][0])
        else:
            p[h[i][0]-1] += 1
ansnum = len(l)
penalty = 0
for i in l:
    penalty += p[i-1]

print(ansnum,int(penalty))

Fixed submission:
n,m=map(int, input().split())
h = [list(map(str,input().split())) for _ in range(m)]
# print(h)
for i in range(m):
    h[i][0] = int(h[i][0])
l=set()
penalty = 0
import numpy as np
p = np.zeros(n)
for i in range(m):
    if h[i][0] not in l:
        if h[i][1] == 'AC':
            l.add(h[i][0])
            penalty += p[h[i][0]-1]
        else:
            p[h[i][0]-1] += 1
ansnum = len(l)

# for i in l:
#     penalty += p[i-1]

print(ansnum,int(penalty))