Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
Counted = [0 for _ in range(N)]
num1 = 0
num2 = 0
subnum2 = [0 for l in range(N)]
for j in range(M):
  p, S = input().split()
  p_ = int(p)
  if S == "AC" and Counted[p_] == 0:
    num1 += 1
    num2 += subnum2[p_ - 1]
    Counted[p_] = 1
  elif S == "WA" and Counted[p_] == 0:
    subnum2[p_ - 1] += 1
print("{} {}".format(num1, num2))

Fixed submission:
N, M = map(int, input().split())
Counted = [0 for _ in range(N)]
num1 = 0
num2 = 0
subnum2 = [0 for l in range(N)]
for j in range(M):
  p, S = input().split()
  p_ = int(p)
  if S == "AC" and Counted[p_ -1] == 0:
    num1 += 1
    num2 += subnum2[p_ - 1]
    Counted[p_ -1] = 1
  elif S == "WA" and Counted[p_-1] == 0:
    subnum2[p_ - 1] += 1
print("{} {}".format(num1, num2))

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
Counted = [0 for _ in range(M)]
num1 = 0
num2 = 0
subnum2 = [0 for l in range(N)]
for j in range(M):
  p, S = input().split()
  p_ = int(p)
  if S == "AC" and Counted[p_] == 0:
    num1 += 1
    num2 += subnum2[p_ - 1]
    Counted[p_] = 1
  elif S == "WA" and Counted[p_] == 0:
    subnum2[p_ - 1] += 1
print("{} {}".format(num1, num2))


Fixed submission:
N, M = map(int, input().split())
Counted = [0 for _ in range(N)]
num1 = 0
num2 = 0
subnum2 = [0 for l in range(N)]
for j in range(M):
  p, S = input().split()
  p_ = int(p)
  if S == "AC" and Counted[p_ -1] == 0:
    num1 += 1
    num2 += subnum2[p_ - 1]
    Counted[p_ -1] = 1
  elif S == "WA" and Counted[p_-1] == 0:
    subnum2[p_ - 1] += 1
print("{} {}".format(num1, num2))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
Counted = []
num1 = 0
num2 = 0
subnum2 = [0 for l in range(N)]
for j in range(M):
  p, S = input().split()
  p_ = int(p)
  if S == "AC" and not p_ in Counted:
    num1 += 1
    num2 += subnum2[p_ - 1]
    Counted.append(p_)
  elif S == "WA" and not p_ in Counted:
    subnum2[p_ - 1] += 1
print("{} {}".format(num1, num2))

Fixed submission:
N, M = map(int, input().split())
Counted = [0 for _ in range(N)]
num1 = 0
num2 = 0
subnum2 = [0 for l in range(N)]
for j in range(M):
  p, S = input().split()
  p_ = int(p)
  if S == "AC" and Counted[p_ -1] == 0:
    num1 += 1
    num2 += subnum2[p_ - 1]
    Counted[p_ -1] = 1
  elif S == "WA" and Counted[p_-1] == 0:
    subnum2[p_ - 1] += 1
print("{} {}".format(num1, num2))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
Counted = []
num1 = 0
num2 = 0
subnum2 = [0 for l in range(N)]
for j in range(M):
  p, S = input().split()
  p_ = int(p)
  if S == "AC" and not p_ in Counted:
    num1 += 1
    num2 += subnum2[p_ - 1]
    Counted.append(p_)
  elif S == "WA" and not p_ in Counted:
    subnum2[p_ - 1] += 1
print("{} {}".format(num1, num2))

Fixed submission:
N, M = map(int, input().split())
Counted = [0 for _ in range(N)]
num1 = 0
num2 = 0
subnum2 = [0 for l in range(N)]
for j in range(M):
  p, S = input().split()
  p_ = int(p)
  if S == "AC" and Counted[p_ -1] == 0:
    num1 += 1
    num2 += subnum2[p_ - 1]
    Counted[p_ -1] = 1
  elif S == "WA" and Counted[p_-1] == 0:
    subnum2[p_ - 1] += 1
print("{} {}".format(num1, num2))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
p = []
S = []
for i in range(M):
  n, a = input().split()
  p.append(int(n))
  S.append(a)

Counted = []
num1 = 0
num2 = 0
subnum2 = [0 for l in range(N)]
for j in range(M):
  if S[j] == "AC" and not p[j] in Counted:
    num1 += 1
    num2 += subnum2[p[j] - 1]
    Counted.append(p[j])
  elif S[j] == "WA" and not p[j] in Counted:
    subnum2[p[j] - 1] += 1
print("{} {}".format(num1, num2))

Fixed submission:
N, M = map(int, input().split())
Counted = [0 for _ in range(N)]
num1 = 0
num2 = 0
subnum2 = [0 for l in range(N)]
for j in range(M):
  p, S = input().split()
  p_ = int(p)
  if S == "AC" and Counted[p_ -1] == 0:
    num1 += 1
    num2 += subnum2[p_ - 1]
    Counted[p_ -1] = 1
  elif S == "WA" and Counted[p_-1] == 0:
    subnum2[p_ - 1] += 1
print("{} {}".format(num1, num2))