Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

args = input().split()
n = int(args[0])
m = int(args[1])
ok_list = [0] * 100000
ng_dict = {}
ok_cnt = 0
ng_cnt = 0
for _ in range(m):
    target, score = input().split()
    target = int(target)
    if target in ok_list:
        continue
    else:
        if score == 'AC':
            ok_list[ok_cnt] = target
            ok_cnt += 1
        else:
            if target in ng_dict:
                ng_dict[target] += 1
            else:
                ng_dict[target] = 1

for num in ok_list:
    if num in ng_dict:
        ng_cnt += ng_dict[num]

print(ok_cnt, ng_cnt)

Fixed submission:
import sys
input = sys.stdin.readline

args = input().split()
n = int(args[0])
m = int(args[1])
ok = [False] * n
ng = [0] * n
for _ in range(m):
    target, score = input().split()
    target = int(target) - 1
    if score == 'AC':
        ok[target] = True
    else:
        if not ok[target]:
            ng[target] += 1

ok_cnt = 0
ng_cnt = 0
for i in range(n):
    if ok[i]:
        ok_cnt += 1
        ng_cnt += ng[i]
print(ok_cnt, ng_cnt)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

args = input().split()
n = int(args[0])
m = int(args[1])
ok_list = [0] * 100000
ng_dict = {}
ok_cnt = 0
ng_cnt = 0
args_results = [input().split() for i in range(m)]
for args_result in args_results:
    target = int(args_result[0])
    score = args_result[1]
    if target in ok_list:
        continue
    else:
        if score == 'AC':
            ok_list[ok_cnt] = target
            ok_cnt += 1
        else:
            if target in ng_dict:
                ng_dict[target] += 1
            else:
                ng_dict[target] = 1

for num in ok_list:
    if num in ng_dict:
        ng_cnt += ng_dict[num]

print(ok_cnt, ng_cnt)

Fixed submission:
import sys
input = sys.stdin.readline

args = input().split()
n = int(args[0])
m = int(args[1])
ok = [False] * n
ng = [0] * n
for _ in range(m):
    target, score = input().split()
    target = int(target) - 1
    if score == 'AC':
        ok[target] = True
    else:
        if not ok[target]:
            ng[target] += 1

ok_cnt = 0
ng_cnt = 0
for i in range(n):
    if ok[i]:
        ok_cnt += 1
        ng_cnt += ng[i]
print(ok_cnt, ng_cnt)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

args = input().split()
n = int(args[0])
m = int(args[1])
ok_list = [0] * 100000
ng_dict = {}
ok_cnt = 0
ng_cnt = 0
args_results = [input().split() for i in range(m)]
for args_result in args_results:
    target = int(args_result[0])
    score = args_result[1]
    if target in ok_list:
        continue
    else:
        if score == 'AC':
            ok_list[ok_cnt] = target
            ok_cnt += 1
        else:
            if target in ng_dict:
                ng_dict[target] += 1
            else:
                ng_dict[target] = 1

for num in ok_list:
    if num in ng_dict:
        ng_cnt += ng_dict[num]

print ok_cnt, ng_cnt

Fixed submission:
import sys
input = sys.stdin.readline

args = input().split()
n = int(args[0])
m = int(args[1])
ok = [False] * n
ng = [0] * n
for _ in range(m):
    target, score = input().split()
    target = int(target) - 1
    if score == 'AC':
        ok[target] = True
    else:
        if not ok[target]:
            ng[target] += 1

ok_cnt = 0
ng_cnt = 0
for i in range(n):
    if ok[i]:
        ok_cnt += 1
        ng_cnt += ng[i]
print(ok_cnt, ng_cnt)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

args = input().split()
n = int(args[0])
m = int(args[1])
ok_list = [0] * 100000
ok_cnt = 0
ng_cnt = 0
args_results = [input().split() for i in range(m)]
for args_result in args_results:
    target = int(args_result[0])
    score = args_result[1]
    if target in ok_list:
        continue
    else:
        if score == 'AC':
            ok_list[ok_cnt] = target
            ok_cnt += 1
        else:
            ng_cnt += 1
print ok_cnt, ng_cnt

Fixed submission:
import sys
input = sys.stdin.readline

args = input().split()
n = int(args[0])
m = int(args[1])
ok = [False] * n
ng = [0] * n
for _ in range(m):
    target, score = input().split()
    target = int(target) - 1
    if score == 'AC':
        ok[target] = True
    else:
        if not ok[target]:
            ng[target] += 1

ok_cnt = 0
ng_cnt = 0
for i in range(n):
    if ok[i]:
        ok_cnt += 1
        ng_cnt += ng[i]
print(ok_cnt, ng_cnt)