Buggy python submission (verdict: Runtime Error):
# C - Welcome to AtCoder
# https://atcoder.jp/contests/abc151/tasks/abc151_c

n,m = map(int,input().split())

# 問題数分配列を作成 -> 正解判定用の関数
ac = [False] * n
wa = [0] * n

# まずはテーブルを作成する
for i in range(m):
    p, s = input().split()
    p = int(p)

    if p == "AC":
        # 正解したことのある問題か確認
        ac[i] = True
    else:
        if ac[i] == False:
            wa[i] += 1

ac_cnt = 0
wa_cnt = 0

for i in range(n):
    if ac[i] == True:
        ac_cnt += 1
        wa_cnt += wa[i]

print(ac_cnt,wa_cnt)

Fixed submission:
N, M = map(int, input().split())

ac = [False] * N
wa = [0] * N
for _ in range(M):
    p, S = input().split()
    p = int(p) - 1
    if S == 'AC':
        ac[p] = True
    else:
        if not ac[p]:
            wa[p] += 1

a = 0
b = 0
for i in range(N):
    if ac[i]:
        a += 1
        b += wa[i]
print(*[a, b])

Buggy python submission (verdict: Runtime Error):
# C - Welcome to AtCoder
# https://atcoder.jp/contests/abc151/tasks/abc151_c

n,m = map(int,input().split())

# 問題数分配列を作成 -> 正解判定用の関数
ac = [False] * N
wa = [0] * N

# まずはテーブルを作成する
for i in range(m):
    p, s = input().split()
    p = int(p)

    if p == "AC":
        # 正解したことのある問題か確認
        ac[i] = True
    else:
        if ac[i] == False:
            wa[i] += 1

ac_cnt = 0
wa_cnt = 0

for i in range(n):
    if ac[i] == True:
        ac_cnt += 1
        wa_cnt += wa[i]

print(ac_cnt,wa_cnt)






Fixed submission:
N, M = map(int, input().split())

ac = [False] * N
wa = [0] * N
for _ in range(M):
    p, S = input().split()
    p = int(p) - 1
    if S == 'AC':
        ac[p] = True
    else:
        if not ac[p]:
            wa[p] += 1

a = 0
b = 0
for i in range(N):
    if ac[i]:
        a += 1
        b += wa[i]
print(*[a, b])

Buggy python submission (verdict: Time Limit Exceeded):
# C - Welcome to AtCoder
# https://atcoder.jp/contests/abc151/tasks/abc151_c

n,m = map(int,input().split())
ps = [input().split() for i in range(m)]

# 問題数分配列を作成 -> 正解判定用の関数
tmp=[0]*m
ac = 0
wa = 0

tmp_wa = 0

for i in range(m):
    if ps[i][1] == "AC":
        # 正解したことのある問題か確認
        if ps[i][0] not in list(set(tmp)):
            ac += 1          
            wa = tmp_wa
            # tmp_wa = 0
            tmp[i] = ps[i][0]


    else:
        if ps[i][0] not in tmp:
            tmp_wa += 1


print(ac,wa)


# ACのカウントを数える
# ACが出るまでにでたWAをカウントする

# すでに正解済みの問題であれば、ACはカウントアップしない。

# すでに正解済みの問題であれば、ACはカウントアップしない。

# おそらく辞書を使う




Fixed submission:
N, M = map(int, input().split())

ac = [False] * N
wa = [0] * N
for _ in range(M):
    p, S = input().split()
    p = int(p) - 1
    if S == 'AC':
        ac[p] = True
    else:
        if not ac[p]:
            wa[p] += 1

a = 0
b = 0
for i in range(N):
    if ac[i]:
        a += 1
        b += wa[i]
print(*[a, b])

Buggy python submission (verdict: Time Limit Exceeded):
# C - Welcome to AtCoder
# https://atcoder.jp/contests/abc151/tasks/abc151_c

n,m = map(int,input().split())
ps = [input().split() for i in range(m)]

# 問題数分配列を作成 -> 正解判定用の関数
tmp=[0]*m
ac = 0
wa = 0

tmp_wa = 0

for i in range(m):
    if ps[i][1] == "AC":
        # 正解したことのある問題か確認
        if ps[i][0] not in tmp:
            ac += 1          
            wa = tmp_wa
            # tmp_wa = 0
            tmp[i] = ps[i][0]


    else:
        if ps[i][0] not in tmp:
            tmp_wa += 1


print(ac,wa)


# ACのカウントを数える
# ACが出るまでにでたWAをカウントする

# すでに正解済みの問題であれば、ACはカウントアップしない。

# すでに正解済みの問題であれば、ACはカウントアップしない。

# おそらく辞書を使う




Fixed submission:
N, M = map(int, input().split())

ac = [False] * N
wa = [0] * N
for _ in range(M):
    p, S = input().split()
    p = int(p) - 1
    if S == 'AC':
        ac[p] = True
    else:
        if not ac[p]:
            wa[p] += 1

a = 0
b = 0
for i in range(N):
    if ac[i]:
        a += 1
        b += wa[i]
print(*[a, b])

Buggy python submission (verdict: Runtime Error):
# C - Welcome to AtCoder
# https://atcoder.jp/contests/abc151/tasks/abc151_c

n,m = map(int,input().split())
submits = [list(input().split()) for i in range(0,m)]

ac = 0
wa = 0

AC = "AC"
WA = "WA"

tmp_wa = 0
tmp_ac = 0


for i in range(len(submits)):
    # ACなら正解数をカウントアップ
    if submits[i][1] == AC:
        # 同じ問題に正解してないかチェック
        if submits[i][0] == tmp_ac:
            continue
        ac += 1
        # WAの数をカウント
        wa += tmp_wa
        # WAを初期化
        tmp_wa = 0
        tmp_ac = submits[i][0]
    else:
        # WAならwa+1
        tmp_wa += 1

print(ac + " " + wa)

Fixed submission:
N, M = map(int, input().split())

ac = [False] * N
wa = [0] * N
for _ in range(M):
    p, S = input().split()
    p = int(p) - 1
    if S == 'AC':
        ac[p] = True
    else:
        if not ac[p]:
            wa[p] += 1

a = 0
b = 0
for i in range(N):
    if ac[i]:
        a += 1
        b += wa[i]
print(*[a, b])

Buggy python submission (verdict: Runtime Error):
# C - Welcome to AtCoder
# https://atcoder.jp/contests/abc151/tasks/abc151_c

n,m = map(int,input().split())
submits = [list(input().split()) for i in range(0,m)]

ac = 0
wa = 0

AC = "AC"
WA = "WA"

tmp_wa = 0
tmp_ac = 0


for i in range(len(submits)):
    # ACなら正解数をカウントアップ
    if submits[i][1] == AC:
        # 同じ問題に正解してないかチェック
        if submits[i][0] == tmp_ac:
            continue
        ac += 1
        # WAの数をカウント
        wa += tmp_wa
        # WAを初期化
        tmp_wa = 0
        tmp_ac = submits[i][0]
    else:
        # WAならwa+1
        tmp_wa += 1

print(f"{ac} {wa}")

Fixed submission:
N, M = map(int, input().split())

ac = [False] * N
wa = [0] * N
for _ in range(M):
    p, S = input().split()
    p = int(p) - 1
    if S == 'AC':
        ac[p] = True
    else:
        if not ac[p]:
            wa[p] += 1

a = 0
b = 0
for i in range(N):
    if ac[i]:
        a += 1
        b += wa[i]
print(*[a, b])

Buggy python submission (verdict: Runtime Error):
# C - Welcome to AtCoder
# https://atcoder.jp/contests/abc151/tasks/abc151_c

n,m = map(int,input().split())
submits = [list(input().split()) for i in range(0,m)]
print(submits)
ac = 0
wa = 0

AC = "AC"
WA = "WA"

tmp_wa = 0
tmp_ac = ""


for i in range(len(submits)):
    # ACなら正解数をカウントアップ
    if submits[i][1] == AC:
        # 同じ問題に正解してないかチェック
        if submits[i][0] == tmp_ac:
            continue
        ac += 1
        # WAの数をカウント
        wa += tmp_wa
        # WAを初期化
        tmp_wa = 0
        tmp_ac = submits[i][0]
    else:
        # WAならwa+1
        tmp_wa += 1

print(f"{ac} {wa}")

Fixed submission:
N, M = map(int, input().split())

ac = [False] * N
wa = [0] * N
for _ in range(M):
    p, S = input().split()
    p = int(p) - 1
    if S == 'AC':
        ac[p] = True
    else:
        if not ac[p]:
            wa[p] += 1

a = 0
b = 0
for i in range(N):
    if ac[i]:
        a += 1
        b += wa[i]
print(*[a, b])