Buggy python submission (verdict: Time Limit Exceeded):
N, M = list(map(int, input().split(' ')))
AC_total = 0
WA_total = 0
ac_list = []
wa_dict = {}
for i in range(M):
    p, s = input().split(' ')
    if p not in ac_list:
        if s == 'WA':
            if p in wa_dict:
                wa_dict[p] += 1
            else:
                wa_dict[p] = 1
        else:
            AC_total += 1
            if p in wa_dict:
                WA_total += wa_dict[p]
            ac_list.append(p)
print('{} {}'.format(AC_total, WA_total))

Fixed submission:
N, M = list(map(int, input().split(' ')))
AC_total = 0
WA_total = 0
ac_list = [False] * N
wa_list = [0] * N
for i in range(M):
    p, s = input().split(' ')
    p = int(p) - 1
    if not ac_list[p]:
        if s == 'WA':
            wa_list[p] += 1
        else:
            AC_total += 1
            WA_total += wa_list[p]
            ac_list[p] = True
print('{} {}'.format(AC_total, WA_total))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = list(map(int, input().split(' ')))
result_list = [input().split(' ') for i in range(M)]
AC_total = 0
WA_total = 0
ac_list = []
wa_dict = {}
for p, s in result_list:
    if p not in ac_list:
        if s == 'WA':
            if p in wa_dict:
                wa_dict[p] += 1
            else:
                wa_dict[p] = 1
        else:
            AC_total += 1
            if p in wa_dict:
                WA_total += wa_dict[p]
            ac_list.append(p)
print('{} {}'.format(AC_total, WA_total))

Fixed submission:
N, M = list(map(int, input().split(' ')))
AC_total = 0
WA_total = 0
ac_list = [False] * N
wa_list = [0] * N
for i in range(M):
    p, s = input().split(' ')
    p = int(p) - 1
    if not ac_list[p]:
        if s == 'WA':
            wa_list[p] += 1
        else:
            AC_total += 1
            WA_total += wa_list[p]
            ac_list[p] = True
print('{} {}'.format(AC_total, WA_total))

Buggy python submission (verdict: Runtime Error):
N, M = list(map(int, input().split(' ')))
result_list = [input().split(' ') for i in range(M)]
AC_total = 0
WA_total = 0
ac_list = []
wa_dict = {}
for p, s in result_list:
    if p not in ac_list:
        if s == 'WA':
            if p in wa_dict:
                wa_dict[p] += 1
            else:
                wa_dict[p] = 1
        else:
            AC_total += 1
            WA_total += wa_dict[p]
            ac_list.append(p)
print('{} {}'.format(AC_total, WA_total))

Fixed submission:
N, M = list(map(int, input().split(' ')))
AC_total = 0
WA_total = 0
ac_list = [False] * N
wa_list = [0] * N
for i in range(M):
    p, s = input().split(' ')
    p = int(p) - 1
    if not ac_list[p]:
        if s == 'WA':
            wa_list[p] += 1
        else:
            AC_total += 1
            WA_total += wa_list[p]
            ac_list[p] = True
print('{} {}'.format(AC_total, WA_total))

Buggy python submission (verdict: Time Limit Exceeded):
N, M = list(map(int, input().split(' ')))
result_list = [input().split(' ') for i in range(M)]
AC_total = 0
WA_total = 0
ac_list = []
wa_dict = {}
for p, s in result_list:
    if p not in ac_list:
        if s == 'WA':
            if p in wa_dict:
                wa_dict[p] += 1
            else:
                wa_dict[p] = 1
        else:
            AC_total += 1
            ac_list.append(p)
for p in wa_dict:
    if p in ac_list:
        WA_total += wa_dict[p]
print('{} {}'.format(AC_total, WA_total))

Fixed submission:
N, M = list(map(int, input().split(' ')))
AC_total = 0
WA_total = 0
ac_list = [False] * N
wa_list = [0] * N
for i in range(M):
    p, s = input().split(' ')
    p = int(p) - 1
    if not ac_list[p]:
        if s == 'WA':
            wa_list[p] += 1
        else:
            AC_total += 1
            WA_total += wa_list[p]
            ac_list[p] = True
print('{} {}'.format(AC_total, WA_total))

Buggy python submission (verdict: Runtime Error):
N, M = list(map(int, input().split(' ')))
result_list = [input().split(' ') for i in range(M)]
AC_total = 0
WA_total = 0
ac_list = []
wa_dict = {}
for p, s in result_list:
    if p not in ac_list:
        if s == 'WA':
            if p in wa_dict:
                wa_dict[p] += 1
            else:
                wa_dict[p] = 1
        else:
            AC_total += 1
            ac_list.append(p)
for p in wa_dict:
    if p in ac_list:
        WA_total += wa
print('{} {}'.format(AC_total, WA_total))

Fixed submission:
N, M = list(map(int, input().split(' ')))
AC_total = 0
WA_total = 0
ac_list = [False] * N
wa_list = [0] * N
for i in range(M):
    p, s = input().split(' ')
    p = int(p) - 1
    if not ac_list[p]:
        if s == 'WA':
            wa_list[p] += 1
        else:
            AC_total += 1
            WA_total += wa_list[p]
            ac_list[p] = True
print('{} {}'.format(AC_total, WA_total))