Buggy python submission (verdict: Time Limit Exceeded):
F_str = input().split()
F = [int(f) for f in F_str]
N = F[0]
M = F[1]

WA_list = [0 for _ in range(N)]
AC_list = []

for i in range(M):
    S_str = input().split()
    S = [str(s) for s in S_str]
    if(S[1] == "AC"):
        AC_list.append(S[0])
        AC_list = list(set(AC_list))
    elif(not(S[0] in AC_list)):
        WA_list[int(S[0])-1] += 1
        
WA_count = 0

for item in AC_list:
    WA_count += WA_list[int(item)-1]

print(str(len(AC_list)) + " " + str(WA_count))

Fixed submission:
F_str = input().split()
F = [int(f) for f in F_str]
N = F[0]
M = F[1]

WA_list = [0 for _ in range(N)]
AC_list = [0 for _ in range(N)]

for i in range(M):
    S_str = input().split()
    S = [str(s) for s in S_str]
    if(S[1] == "AC"):
        AC_list[int(S[0])-1] = 1
    elif(AC_list[int(S[0])-1] != 1):
        WA_list[int(S[0])-1] += 1

WA_count = 0
AC_count = 0

for i in range(N):
    if(AC_list[i] == 1):
        AC_count += 1
        WA_count += WA_list[i]

print(AC_count, WA_count)

Buggy python submission (verdict: Runtime Error):
F_str = input().split()
F = [int(f) for f in F_str]
N = F[0]
M = F[1]

WA_list = [0 for _ in range(N)]
AC_list = []

for i in range(M):
    S_str = input().split()
    S = [str(s) for s in S_str]
    if(S[1] == "AC"):
        AC_list.append(S[0])
        AC_list = list(set(AC_list))
    elif(not(S[0] in AC_list)):
        WA_list[int(S[0])-1] += 1
        
WA_count = 0

for item in AC_list:
    WA_count += WA_list[int(item)-1]

print(str(len(AC_list)) + " " + str(sum(WA_count)))

Fixed submission:
F_str = input().split()
F = [int(f) for f in F_str]
N = F[0]
M = F[1]

WA_list = [0 for _ in range(N)]
AC_list = [0 for _ in range(N)]

for i in range(M):
    S_str = input().split()
    S = [str(s) for s in S_str]
    if(S[1] == "AC"):
        AC_list[int(S[0])-1] = 1
    elif(AC_list[int(S[0])-1] != 1):
        WA_list[int(S[0])-1] += 1

WA_count = 0
AC_count = 0

for i in range(N):
    if(AC_list[i] == 1):
        AC_count += 1
        WA_count += WA_list[i]

print(AC_count, WA_count)

Buggy python submission (verdict: Time Limit Exceeded):
F_str = input().split()
F = [int(f) for f in F_str]
N = F[0]
M = F[1]

WA_list = [0 for _ in range(N)]
AC_list = []

for i in range(M):
    S_str = input().split()
    S = [str(s) for s in S_str]
    if(S[1] == "AC"):
        AC_list.append(S[0])
    elif(not(S[0] in AC_list)):
        WA_list[int(S[0])-1] += 1

AC_set = list(set(AC_list))

WA_count = 0

for item in AC_set:
    WA_count += WA_list[int(item)-1]

print(str(len(AC_set)) + " " + str(WA_count))

Fixed submission:
F_str = input().split()
F = [int(f) for f in F_str]
N = F[0]
M = F[1]

WA_list = [0 for _ in range(N)]
AC_list = [0 for _ in range(N)]

for i in range(M):
    S_str = input().split()
    S = [str(s) for s in S_str]
    if(S[1] == "AC"):
        AC_list[int(S[0])-1] = 1
    elif(AC_list[int(S[0])-1] != 1):
        WA_list[int(S[0])-1] += 1

WA_count = 0
AC_count = 0

for i in range(N):
    if(AC_list[i] == 1):
        AC_count += 1
        WA_count += WA_list[i]

print(AC_count, WA_count)

Buggy python submission (verdict: Runtime Error):
F_str = input().split()
F = [int(f) for f in F_str]
N = F[0]
M = F[1]

WA_list = [0 for _ in range(N)]
AC_list = []

for i in range(M):
    S_str = input().split()
    S = [str(s) for s in S_str]
    if(S[1] == "AC"):
        AC_list.append(S[0])
    elif(not(S[0] in AC_list)):
        WA_list[int(S[0])-1] += 1

AC_set = list(set(AC_list))

WA_count = 0

for item in AC_set:
    WA_count += WA_list[int(item)-1]

print(str(len(AC_set)) + " " + str(sum(WA_count)))

Fixed submission:
F_str = input().split()
F = [int(f) for f in F_str]
N = F[0]
M = F[1]

WA_list = [0 for _ in range(N)]
AC_list = [0 for _ in range(N)]

for i in range(M):
    S_str = input().split()
    S = [str(s) for s in S_str]
    if(S[1] == "AC"):
        AC_list[int(S[0])-1] = 1
    elif(AC_list[int(S[0])-1] != 1):
        WA_list[int(S[0])-1] += 1

WA_count = 0
AC_count = 0

for i in range(N):
    if(AC_list[i] == 1):
        AC_count += 1
        WA_count += WA_list[i]

print(AC_count, WA_count)

Buggy python submission (verdict: Time Limit Exceeded):
F_str = input().split()
F = [int(f) for f in F_str]
N = F[0]
M = F[1]

WA_dict = {}
AC_list = []

for i in range(M):
    S_str = input().split()
    S = [str(s) for s in S_str]
    if(S[1] == "AC"):
        AC_list.append(S[0])
    elif(not(S[0] in AC_list)):
        WA_dict.setdefault(S[0], 0)
        WA_dict[S[0]] += 1

AC_set = list(set(AC_list))

WA_count = 0

for item in AC_set:
    if(item in WA_dict):
        WA_count += WA_dict[item]

print(str(len(AC_set)) + " " + str(WA_count))

Fixed submission:
F_str = input().split()
F = [int(f) for f in F_str]
N = F[0]
M = F[1]

WA_list = [0 for _ in range(N)]
AC_list = [0 for _ in range(N)]

for i in range(M):
    S_str = input().split()
    S = [str(s) for s in S_str]
    if(S[1] == "AC"):
        AC_list[int(S[0])-1] = 1
    elif(AC_list[int(S[0])-1] != 1):
        WA_list[int(S[0])-1] += 1

WA_count = 0
AC_count = 0

for i in range(N):
    if(AC_list[i] == 1):
        AC_count += 1
        WA_count += WA_list[i]

print(AC_count, WA_count)

Buggy python submission (verdict: Time Limit Exceeded):
F_str = input().split()
F = [int(f) for f in F_str]
N = F[0]
M = F[1]

WA_dict = {}
AC_list = []

for i in range(M):
    S_str = input().split()
    S = [str(s) for s in S_str]
    if(S[1] == "AC"):
        AC_list.append(S[0])
    elif(S[0] not in AC_list):
        WA_dict.setdefault(S[0], 0)
        WA_dict[S[0]] += 1

AC_set = list(set(AC_list))

WA_count = 0

for item in AC_set:
    if(item in WA_dict):
        WA_count += WA_dict[item]

print(str(len(AC_set)) + " " + str(WA_count))

Fixed submission:
F_str = input().split()
F = [int(f) for f in F_str]
N = F[0]
M = F[1]

WA_list = [0 for _ in range(N)]
AC_list = [0 for _ in range(N)]

for i in range(M):
    S_str = input().split()
    S = [str(s) for s in S_str]
    if(S[1] == "AC"):
        AC_list[int(S[0])-1] = 1
    elif(AC_list[int(S[0])-1] != 1):
        WA_list[int(S[0])-1] += 1

WA_count = 0
AC_count = 0

for i in range(N):
    if(AC_list[i] == 1):
        AC_count += 1
        WA_count += WA_list[i]

print(AC_count, WA_count)