Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())

AC = {}
WA = {}

if M == 0:
    print("0 0")
    exit()
for i in range(M):
    prob,sub = input().split()
    if sub == "WA":
        if (prob in AC) == False:
            if (prob in WA) == False:
                WA[prob] = 1
            else:
                WA[prob] += 1
    
    if sub == "AC":
         if (prob in AC) == False:
            AC[prob] = 1
         else:
            AC[prob] += 1
            
ans_WA = 0
for prob,sub in WA.items:
    if (prob in AC) == True:
        ans_WA += int(sub)
            
print(len(AC.values()),ans_WA)

Fixed submission:
N,M = map(int,input().split())
AC = {}
WA = {}
for i in range(M):
    prb ,ans = input().split()
    if ans == "AC":
        AC[prb] = 1
    else:
        if (prb in WA) == False and (prb in AC) ==  False:
            WA[prb] = 1
        else:
            if (prb in AC) ==  False:
                WA[prb] +=1
wa = 0
for i,v in WA.items():
    if (i in AC):
        wa += v
print("{} {}".format(len(AC),wa))

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())

AC = {}
WA = {}

if M == 0:
    print("0 0")
    exit()
for i in range(M):
    prob,sub = input().split()
    if sub == "WA":
        if (prob in AC) == False:
            if (prob in WA) == False:
                WA[prob] = 1
            else:
                WA[prob] += 1
    
    if sub == "AC":
         if (prob in AC) == False:
            AC[prob] = 1
         else:
            AC[prob] += 1
            
ans_WA = 0
for prob,sub in WA.items:
    if (prob in AC) = True:
        ans_WA += int(sub)
            
print(len(AC.values()),ans_WA)

Fixed submission:
N,M = map(int,input().split())
AC = {}
WA = {}
for i in range(M):
    prb ,ans = input().split()
    if ans == "AC":
        AC[prb] = 1
    else:
        if (prb in WA) == False and (prb in AC) ==  False:
            WA[prb] = 1
        else:
            if (prb in AC) ==  False:
                WA[prb] +=1
wa = 0
for i,v in WA.items():
    if (i in AC):
        wa += v
print("{} {}".format(len(AC),wa))

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())

AC = {}
WA = {}

if M == 0:
    print("0 0")
    exit()
for i in range(M):
    prob,sub = input().split()
    if sub == "WA":
        if (prob in AC) == False:
            if (prob in WA) == False:
                WA[prob] = 1
            else:
                WA[prob] += 1
    
    if sub == "AC":
         if (prob in AC) == False:
            AC[prob] = 1
         else:
            AC[prob] += 1
            
ans_WA = 0
for prob,sub in WA.items:
    if (prob in AC) = True:
        ans_WA += sub
            
print(len(AC.values()),ans_WA)

Fixed submission:
N,M = map(int,input().split())
AC = {}
WA = {}
for i in range(M):
    prb ,ans = input().split()
    if ans == "AC":
        AC[prb] = 1
    else:
        if (prb in WA) == False and (prb in AC) ==  False:
            WA[prb] = 1
        else:
            if (prb in AC) ==  False:
                WA[prb] +=1
wa = 0
for i,v in WA.items():
    if (i in AC):
        wa += v
print("{} {}".format(len(AC),wa))

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
AC = {}
WA = {}
for i in range(M):
    prb ,ans = input().split()
    if ans == "AC":
        AC[prb] = 1
    else:
        if (prb in WA) == False:
            WA[prb] = 1
        else:
            if AC[prb] == None:
                WA[prb] +=1
wa = 0
for i,v in WA.items():
    wa += v
print("{} {}".format(len(AC),wa))

Fixed submission:
N,M = map(int,input().split())
AC = {}
WA = {}
for i in range(M):
    prb ,ans = input().split()
    if ans == "AC":
        AC[prb] = 1
    else:
        if (prb in WA) == False and (prb in AC) ==  False:
            WA[prb] = 1
        else:
            if (prb in AC) ==  False:
                WA[prb] +=1
wa = 0
for i,v in WA.items():
    if (i in AC):
        wa += v
print("{} {}".format(len(AC),wa))