Buggy python submission (verdict: Time Limit Exceeded):
n, m = input().split()
n = int(n)
m = int(m)

result_list = []

# 正解した問題を入れるlist
done_list = []
correct = 0
pn = 0
done_list = []
pn_list = [0] * n

for i in range(m):
    a,b=input().split()
    
    if a not in done_list and b == "AC":
        done_list.append(a)
        correct += 1
        pn += pn_list[int(a) - 1]
    elif b == "WA":
        pn_list[int(a) - 1] += 1

print(correct, pn)

Fixed submission:
n, m = input().split()
n = int(n)
m = int(m)

# 正解した問題を入れるlist

correct = 0
pn = 0
done_list = [0] * n
pn_list = [0] * n

for i in range(m):
    a,b=input().split()
    
    if done_list[int(a)-1] == 0 and b == "AC":
        done_list[int(a)-1] += 1
        correct += 1
        pn += pn_list[int(a) - 1]
    elif b == "WA":
        pn_list[int(a) - 1] += 1

print(correct, pn)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = input().split()
n = int(n)
m = int(m)

result_list = []

# 正解した問題を入れるlist
done_list = []
correct = 0
pn = 0
done_list = []
pn_list = [0] * n

for i in range(m):
    a,b=input().split()
    
    if a in done_list:
        pass
    elif b == "WA":
        pn_list[int(a) - 1] += 1
    elif b == "AC":
        done_list.append(a)
        correct += 1
        pn += pn_list[int(a) - 1]

print(correct, pn)

Fixed submission:
n, m = input().split()
n = int(n)
m = int(m)

# 正解した問題を入れるlist

correct = 0
pn = 0
done_list = [0] * n
pn_list = [0] * n

for i in range(m):
    a,b=input().split()
    
    if done_list[int(a)-1] == 0 and b == "AC":
        done_list[int(a)-1] += 1
        correct += 1
        pn += pn_list[int(a) - 1]
    elif b == "WA":
        pn_list[int(a) - 1] += 1

print(correct, pn)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = input().split()
n = int(n)
m = int(m)
 
result_list = []
true_flag = False
ac_list = []

for i in range(m):
    a,b=input().split()
    result_list.append((int(a), b))
    if b == "AC":
        true_flag = True
        if a in ac_list:
            pass
        else:
            ac_list.append(a)

# 正解した問題を入れるlist
done_list = []
pn_list = [0] * n
correct = 0
pn = 0
 
if true_flag == False:
    print(0, 0)
else: 
    for result in result_list:
        if result[0] in done_list:
            pass
        elif result[1] == "WA":
            pn_list[result[0] - 1] += 1

        elif result[1] == "AC":
            done_list.append(result[0])
            correct += 1
            pn += pn_list[result[0] - 1]
        if len(done_list) == len(ac_list):
            break
    
    print(correct, pn)

Fixed submission:
n, m = input().split()
n = int(n)
m = int(m)

# 正解した問題を入れるlist

correct = 0
pn = 0
done_list = [0] * n
pn_list = [0] * n

for i in range(m):
    a,b=input().split()
    
    if done_list[int(a)-1] == 0 and b == "AC":
        done_list[int(a)-1] += 1
        correct += 1
        pn += pn_list[int(a) - 1]
    elif b == "WA":
        pn_list[int(a) - 1] += 1

print(correct, pn)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = input().split()
n = int(n)
m = int(m)
 
result_list = []
true_flag = False
for i in range(m):
    a,b=input().split()
    result_list.append((int(a), b))
    if b == "AC":
        true_flag = True
 
# 正解した問題を入れるlist
done_list = []
pn_list = [0] * n
correct = 0
pn = 0
 
if true_flag == False:
    print(0, 0)
else: 
    for result in result_list:
        if result[0] in done_list:
            pass
        elif result[1] == "WA":
            pn_list[result[0] - 1] += 1

        elif result[1] == "AC":
            done_list.append(result[0])
            correct += 1
            pn += pn_list[result[0] - 1]
        if len(done_list) == n:
            break
    
    print(correct, pn)

Fixed submission:
n, m = input().split()
n = int(n)
m = int(m)

# 正解した問題を入れるlist

correct = 0
pn = 0
done_list = [0] * n
pn_list = [0] * n

for i in range(m):
    a,b=input().split()
    
    if done_list[int(a)-1] == 0 and b == "AC":
        done_list[int(a)-1] += 1
        correct += 1
        pn += pn_list[int(a) - 1]
    elif b == "WA":
        pn_list[int(a) - 1] += 1

print(correct, pn)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = input().split()
n = int(n)
m = int(m)
 
result_list = []
for i in range(m):
    a,b=input().split()
    result_list.append((int(a), b))
 
# 正解した問題を入れるlist
done_list = []
pn_list = [0] * n
correct = 0
pn = 0
 
 
for result in result_list:
    if result[0] in done_list:
        pass
    elif result[1] == "WA":
        pn_list[result[0] - 1] += 1

    elif result[1] == "AC":
        done_list.append(result[0])
        correct += 1
        pn += pn_list[result[0] - 1]
    if len(done_list) == n:
        break
 
print(correct, pn)

Fixed submission:
n, m = input().split()
n = int(n)
m = int(m)

# 正解した問題を入れるlist

correct = 0
pn = 0
done_list = [0] * n
pn_list = [0] * n

for i in range(m):
    a,b=input().split()
    
    if done_list[int(a)-1] == 0 and b == "AC":
        done_list[int(a)-1] += 1
        correct += 1
        pn += pn_list[int(a) - 1]
    elif b == "WA":
        pn_list[int(a) - 1] += 1

print(correct, pn)