Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
ac=[False]*(n+1)
wa=[0]*(n+1)
pena=0
for i in range(m):
    p,s=input().split()
    p=int(p)
    if s == "AC":
        ac[p] = True
    else:
        if False:
            wa[p] += 1
        else:
            continue
for i in ac:
    if i == True:
        pena += wa[index(i)]

Fixed submission:
n,m=map(int,input().split())
AC=[0 for _ in range(n)]
WA=[0 for _ in range(n)]
pen=0
for _ in range(m):
    p,s=input().split()
    p=int(p)
    if s=="AC":
        if AC[p-1]==0:
            AC[p-1]=1
            pen += WA[p-1]
        else:
            pass
    else:
        if AC[p-1]==0:
            WA[p-1] +=1
        else:
            pass
print(AC.count(1),pen)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
ac=[0 for _ in range(n)]
wt=[0 for _ in range(n)]
pen=0
for i in range(m):
    p,s=input().split()
    if s=="AC":
        ac.append(int(p))
        pen += wt[int(p)]
    else:
        if int(p) in ac:
            pass
        else:
            wt[int(p)] += 1
            
t_ac=set(ac))
print(len(t_ac),pen)







Fixed submission:
n,m=map(int,input().split())
AC=[0 for _ in range(n)]
WA=[0 for _ in range(n)]
pen=0
for _ in range(m):
    p,s=input().split()
    p=int(p)
    if s=="AC":
        if AC[p-1]==0:
            AC[p-1]=1
            pen += WA[p-1]
        else:
            pass
    else:
        if AC[p-1]==0:
            WA[p-1] +=1
        else:
            pass
print(AC.count(1),pen)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
ac=[0 for _ in range(n)]
wt=[0 for _ in range(n)]
pen=0
for i in range(m):
    p,s=input().split()
    if s=="AC":
        ac.append(p)
        pen += wt[int(p)]
    else:
        if p in ac:
            pass
        else:
            wt[int(p)] += 1
            
t_ac=set(ac))
print(len(t_ac),pen)







Fixed submission:
n,m=map(int,input().split())
AC=[0 for _ in range(n)]
WA=[0 for _ in range(n)]
pen=0
for _ in range(m):
    p,s=input().split()
    p=int(p)
    if s=="AC":
        if AC[p-1]==0:
            AC[p-1]=1
            pen += WA[p-1]
        else:
            pass
    else:
        if AC[p-1]==0:
            WA[p-1] +=1
        else:
            pass
print(AC.count(1),pen)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
ac=[]
wt=[0 for _ in range(n)]
pen=0
for i in range(m):
    p,s=input().split()
    if s=="AC":
        ac.append(p)
        pen += wt[p]
    else:
        if p in ac:
            pass
        else:
            wt[p] += 1
            
t_ac=set(ac)
print(len(t_ac),pen)

Fixed submission:
n,m=map(int,input().split())
AC=[0 for _ in range(n)]
WA=[0 for _ in range(n)]
pen=0
for _ in range(m):
    p,s=input().split()
    p=int(p)
    if s=="AC":
        if AC[p-1]==0:
            AC[p-1]=1
            pen += WA[p-1]
        else:
            pass
    else:
        if AC[p-1]==0:
            WA[p-1] +=1
        else:
            pass
print(AC.count(1),pen)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
ac=[]
wt=[]
pen=0
for i in range(m):
    p,s=input().split()
    if s=="AC":
        ac.append(p)
        pen += wt[p]
    else:
        if p in ac:
            pass
        else:
            wt[p] += 1
            
t_ac=set(ac)
print(len(t_ac),pen)


Fixed submission:
n,m=map(int,input().split())
AC=[0 for _ in range(n)]
WA=[0 for _ in range(n)]
pen=0
for _ in range(m):
    p,s=input().split()
    p=int(p)
    if s=="AC":
        if AC[p-1]==0:
            AC[p-1]=1
            pen += WA[p-1]
        else:
            pass
    else:
        if AC[p-1]==0:
            WA[p-1] +=1
        else:
            pass
print(AC.count(1),pen)