Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

n, m = map(int, input().split())
p = ["" for _ in range(m)]
s = ["" for _ in range(m)]
for i in range(m):
    tmp = input().split()
    p[i] = int(tmp[0])
    s[i] = tmp[1]

isACed = [0 for _ in range(m)]

n_correct = 0
n_penalty = 0

for i in range(m):
    if isACed[p[i]-1] != 1:
        if s[i] == "AC":
            n_correct += 1

            #正解ラベルを付ける
            isACed[p[i]-1] = 1
        else: #"WA"の時
            n_penalty += 1
print(n_correct, n_penalty)


Fixed submission:
# -*- coding: utf-8 -*-

n, m = map(int, input().split())
p = ["" for _ in range(m)]
s = ["" for _ in range(m)]
for i in range(m):
    tmp = input().split()
    p[i] = int(tmp[0])
    s[i] = tmp[1]

isACed = [[0,0] for _ in range(n)]

n_correct = 0
n_penalty = 0
for i in range(m):
    if isACed[p[i]-1][1] != 1:
        if s[i] == "WA": #"WA"の時
            isACed[p[i]-1][0] += 1
        else: #"AC"の時
            n_correct += 1
            isACed[p[i]-1][1] = 1
            n_penalty += isACed[p[i]-1][0]

print(n_correct, n_penalty)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import logging
logging.basicConfig(level = logging.DEBUG,
                    format = " %(levelname)s - %(message)s")
logging.disable()

n, m = map(int, input().split())
p = ["" for _ in range(m)]
s = ["" for _ in range(m)]
for i in range(m):
    tmp = input().split()
    p[i] = int(tmp[0])
    s[i] = tmp[1]

isACed = [0 for _ in range(m)]

logging.debug("p: {}".format(p))
logging.debug("s: {}".format(s))
logging.debug("isACed: {}".format(isACed))

n_correct = 0
n_penalty = 0

for i in range(m):
    logging.debug("range({})開始".format(i))
    if isACed[p[i]-1] != 1:
        logging.debug("isACed[{}] != 1".format(p[i]-1))
        if s[i] == "AC":
            n_correct += 1

            #正解ラベルを付ける
            isACed[p[i]-1] = 1
        else: #"WA"の時
            n_penalty += 1
print(n_correct, n_penalty)


Fixed submission:
# -*- coding: utf-8 -*-

n, m = map(int, input().split())
p = ["" for _ in range(m)]
s = ["" for _ in range(m)]
for i in range(m):
    tmp = input().split()
    p[i] = int(tmp[0])
    s[i] = tmp[1]

isACed = [[0,0] for _ in range(n)]

n_correct = 0
n_penalty = 0
for i in range(m):
    if isACed[p[i]-1][1] != 1:
        if s[i] == "WA": #"WA"の時
            isACed[p[i]-1][0] += 1
        else: #"AC"の時
            n_correct += 1
            isACed[p[i]-1][1] = 1
            n_penalty += isACed[p[i]-1][0]

print(n_correct, n_penalty)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import logging
logging.basicConfig(level = logging.DEBUG,
                    format = " %(levelname)s - %(message)s")
logging.disable()

n, m = map(int, input().split())
p = ["" for _ in range(m)]
s = ["" for _ in range(m)]
for i in range(m):
    tmp = input().split()
    p[i] = int(tmp[0])
    s[i] = tmp[1]

isACed = [0 for _ in range(n)]

logging.debug("p: {}".format(p))
logging.debug("s: {}".format(s))
logging.debug("isACed: {}".format(isACed))

n_correct = 0
n_penalty = 0

for i in range(m):
    logging.debug("range({})開始".format(i))
    if isACed[p[i]-1] != 1:
        logging.debug("isACed[{}] != 1".format(p[i]-1))
        if s[i] == "AC":
            n_correct += 1

            #正解ラベルを付ける
            isACed[p[i]-1] = 1
        else: #"WA"の時
            n_penalty += 1
print(n_correct, n_penalty)


Fixed submission:
# -*- coding: utf-8 -*-

n, m = map(int, input().split())
p = ["" for _ in range(m)]
s = ["" for _ in range(m)]
for i in range(m):
    tmp = input().split()
    p[i] = int(tmp[0])
    s[i] = tmp[1]

isACed = [[0,0] for _ in range(n)]

n_correct = 0
n_penalty = 0
for i in range(m):
    if isACed[p[i]-1][1] != 1:
        if s[i] == "WA": #"WA"の時
            isACed[p[i]-1][0] += 1
        else: #"AC"の時
            n_correct += 1
            isACed[p[i]-1][1] = 1
            n_penalty += isACed[p[i]-1][0]

print(n_correct, n_penalty)