TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
n, m = map(int, input().split())
ac = [0]*n
wa = [0]*n
a = 0
w = 0
for i in range(m):
  p, s = input().split()
  p = int(p)-1
  if ac[p] == 0, s == "AC":
    ac[p] += 1
    a += 1
    w += wa[p] 
  elif ac[p] == 0, s == "WA":
    wa[p] += 1
print(a,w)

n, m = map(int, input().split())
ac = [0]*n
wa = [0]*n
a = 0
w = 0
for i in range(m):
  p, s = input().split()
  p = int(p)-1
  if ac[p] == 0, s == "AC":
    acs[p] += 1
    a += 1
    w += was[p] 
  elif ac[p] == 0, s == "WA":
    was[p] += 1
print(a,w)

n, m = map(int, input().split())
ac = [0]*n
wa = [0]*n
a = 0
w = 0
for i in range(m):
  p, s = input().split()
  p = int(p)-1
  if ac[p] == 0 and s == "AC":
    ac[p] += 1
    a += 1
    w += wa[p] 
  elif ac[p] == 0 and s == "WA":
    wa[p] += 1
print(a,w)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
N, M = map(int, input().split())
right = 0
wrong = 0
now = 1
for i in range(M):
    p, S = list(input().split())
    if S == 'AC':
        if p == now:
            now += 1
            right += 1
    else:
        if p == now:
            wrong += 1

print(right, wrong, sep=' ')

n, m = map(int, input().split())
ac = [False] * n
wa = [0] * n

for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if s == 'AC':
        if not ac[p]:
            ac[p] = True
    else:
        if not ac[p]:
            wa[p] += 1

a = 0
b = 0

for i in range(n):
    if ac[i]:
        a += 1
        b += wa[i]

print(*[a, b])

Verdicts: Wrong Answer

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

N, M = I()
AC = [0]*N
WA = [0]*N
ac,wa = 0,0
for _ in range(M):
    s,t = L()
    s = int(s)-1
    if AC[s] == 0 and t == "WA":
        WA[s] += 1
    elif AC[s] == 0 and s == "AC":
        AC[s] = 1
        wa += WA[p]
        ac += 1

print(ac,wa)


import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

N,M=map(int,input().split())
L=[0]*N
R=[0]*N
right=0
pena=0
for _ in range(M):
    p,s=input().split()
    p=int(p)
    p-=1
    if R[p]==0:
        if s=='AC':
          right+=1
          R[p]=1
          pena+=L[p]
        else:
            L[p]+=1

print(right,pena)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
n,m = map(int,input().split())
ps = [input().split() for i in range(m)]

ans =[]
for i in range(m):
  if not(ps[i][0] in ans) :
    ans += ps[i][0]
    

print(ps[0][0])
wa = 0
ac = 0
for i in ans:
  for j in range(m):
    
    w = 0
    if ps[j][0] == str(i):
      if ps[j][1] =="WA":
        w += 1
      elif ps[j][1] == "AC":
        ac += 1
        wa +=w
        break

    else:
      continue
      
      
print(ac,wa)

N,M = map(int, input().split())
ps = []
AC = [0]*N
WA = [0]*N
WA_sum = 0
for _ in range(M):
  ps.append(list(input().split()))
for i in range(M):
  if ps[i][1] == 'AC' and AC[int(ps[i][0])-1] == 0:
    AC[int(ps[i][0])-1] = 1
  if ps[i][1] == 'WA' and AC[int(ps[i][0])-1] == 0:
    WA[int(ps[i][0])-1] += 1
for i in range(N):
  if AC[i] == 1:
    WA_sum += int(WA[i])
print(sum(AC), WA_sum)


Verdicts: Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
N, M = map(int, input().split())

AC = 0
WA = 0
PS = {}
for i in range(M):
    p, S = input().split()
    tmp = PS.get(p)
    if tmp != None:
        print("\t" + tmp)

    if tmp != "AC":
        if S == "AC":
            AC += 1
        elif S == "WA":
            WA += 1
        PS[p] = S
print(str(AC) + " " + str(WA))
    

N, M = map(int, input().split())

AC = 0
WA = 0
PS = {}
for _ in range(M):
    p, S = input().split()
    tmp = PS.get(p)
    # print(PS)
    if tmp == None:
        if S == "AC":
            PS[p] = S
            AC += 1
        else:
            PS[p] = 1
    elif tmp != "AC":
        if S == "AC":
            PS[p] = S
            AC += 1
            WA += tmp
        else:
            PS[p] += 1
print(AC, WA)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
N,M = map(int,input().split())
dic = {}

for _ in range (M):
  p, s = input().split()
  if p not in dic and s == 'AC':
    dic[p] = [1,0]
  elif p not in dic and s == 'WA':
    dic[p] = [0,1]
  elif s == 'AC' and dic[p][0] == 0:
    dic[p][0] += 1
  elif s == 'WA'and dic[p][0]:
    dic[p][1] += 1

right = 0
wrong = 0

for item in dic.values():
  right += item[0]
  if item[0]== 1:
    wrong += item[1]

print(right, wrong)



N,M = map(int,input().split())
dic = {}
 
for _ in range (M):
  p, s = input().split()
  if p not in dic and s == 'AC':
    dic[p] = [1,0]
  elif p not in dic and s == 'WA':
    dic[p] = [0,1]
  elif s == 'AC' and dic[p][0] == 0:
    dic[p][0] += 1
  elif s == 'WA' and dic[p][0] == 0:
    dic[p][1] += 1

right = 0
wrong = 0
 
for item in dic.values():
  right += item[0]
  if item[0]==1:
    wrong += item[1]

print(right, wrong)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
n, m = map(int, input().split())

if m == 0:
    print(0, 0)
else:
    check_list = [0]*(n+1)
    wa = 0
    ac = 0
    for i in range(m):
        p, s = input().split()
        p = int(p)
        if check_list[p] == 1:
            continue
        elif s == 'AC':
            check_list[p] = 1
            ac += 1
        #elif check_list[p] == 0 and s == 'WA':                                          
        else:
            wa += 1
        print(check_list)
    print(ac, wa)

n, m = map(int, input().split())

if m == 0:
    print(0, 0)
else:
    check_list = [0]*(n+1)
    wa = 0
    ac = 0
    for i in range(m):
        p, s = input().split()
        p = int(p)
        if check_list[p] == 1:
            continue
        if check_list[p] == 0 and s == 'AC':
            check_list[p] = 1
            ac += 1
        #elif check_list[p] == 0 and s == 'WA':                                          
        else:
            wa += 1
        print(check_list)
    print(ac, wa)

n, m = map(int, input().split())

ac_list = [0]*(n+1)
wa_list = [0]*(n+1)
wa = 0
ac = 0
if m == 0:
    pass
else:
    for i in range(m):
        p, s = input().split()
        p = int(p)
        if ac_list[p] == 1:
            continue
        if ac_list[p] == 0 and s == 'AC':
            ac_list[p] = 1
        #elif check_list[p] == 0 and s == 'WA':                                          
        else:
            wa_list[p] += 1
    for t_ac, t_wa in zip(ac_list, wa_list):
        if t_ac == 1:
            wa += t_wa
            ac += t_ac
print(ac, wa)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
n, m = map(int, input().split())
ans = [0,0]
cur_n = 1
for i in range(m):
    p, s = map(str, input().split())
    p = int(p)
    if i == 0: cur_n = p
    if cur_n == p:
        if s == 'AC':
            ans[0] += 1
            cur_n += 1
        else: ans[1] += 1
print(ans)

n, m = map(int, input().split())
is_ac = [False]*n
 
ac = 0
wa_cnt = [0]*n

for i in range(m):
    p, s = input().split()
    p = int(p)
    if is_ac[p-1] == False:
        if s == 'AC':
            is_ac[p-1] = True
            ac += 1
        else:
            wa_cnt[p-1] += 1

wa = 0
for i in range(n):
    if is_ac[i]:
        wa += wa_cnt[i]
print(ac, wa)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
n,m = map(int,input().split())

plist = []
slist = []
for _ in range(m):
    p,s = list(input().split())
    p = int(p)
    plist.append(p)
    slist.append(s)
#print(n, m, plist, slist)

ac = 0
wa = 0
actotal = 0
watotal = 0
def total(i,ac=ac,wa=wa):
    count = 0
    for j in plist:
        if i+1 == j:
            if slist[count] == 'AC':
                ac += 1
                break
            elif slist[count] == 'WA':
                wa += 1
            count += 1
    return ac,wa
for i in range(n):
    print(i)
    
    ac, wa = total(i)
    actotal += ac
    watotal += wa
        
print(actotal, watotal)

N,M = map(int,input().split())
ac,wa = 0,0
was = [0]*(N+1)
acs = [0]*(N+1)
for i in range(M):
    p,S = input().split()
    p = int(p)
    if S=="AC":
        if acs[p]==0:
            ac+=1
            wa+=was[p]
            acs[p]=1
    else:
        was[p] += 1
print(ac,wa)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
n,m = map(int,input().split(" "))
question_list = []
res_list = []
ac_list = []
for i in range(m):
    a,b = input().split(" ")
    a = int(a)
    question_list.append(a)
    res_list.append(b)
correct = 0
mistake = 0




for i,j in enumerate(res_list):
    if i == 0:
        if j == "WA":
            mistake += 1
        else:
            correct += 1
            ac_list.append(question_list[i])
            
    elif question_list[i] not in ac_list:      
    	if j == "WA":
      		mistake += 1
     	else:
      		correct += 1
        	ac_list.append(question_list[i])
                
            
    if len(ac_list) == n:
        break
            
for i,j in enumerate(res_list):
    if question_list[i] not in ac_list:
        mistake -= 1
        
      
print(correct,mistake)
            

    



# coding: utf-8

n,m = map(int,input().split(" "))
ac_list = [0] * n
wa_list = [0] * n


wa = 0

for i in range(m):
    a,b = input().split(" ")
    if ac_list[int(a) - 1]:
        continue
    if b == "AC":
        ac_list[int(a) - 1] = 1
        wa += wa_list[int(a)-1]
    else:
        wa_list[int(a)-1] += 1
        
print(sum(ac_list),wa)

Verdicts: Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
%%time
N,M=map(int, input().split())
P=[]
S=[]
for i in range(M):
    p,s=input().split()
    P.append(int(p))
    S.append(s)


import numpy as np
P=np.array(P)
S=np.array(S)

if M>0:
    ans=P[S=="AC"]

    wa=0
    ac=[]
    for i in range(M):
        if P[i] in ans and P[i] not in ac and S[i]=="WA":
            wa+=1
        else:
            ac.append(P[i])
    
    
    print(len(ans),wa)
else:
    print(0,0)

N,M=map(int, input().split())
wa={}
ac=[]
key=[]
for i in range(M):
    p,s=input().split()
    if p not in ac:
        if s=="WA":
            if s not in key:
                wa[p]=0
                key.append(p)
            else:
                wa[p]+=1
        else:
            ac.append(p)
ans=0
for i in ac:
    if i in key:
        ans+=wa[i]
print(len(ac),ans)  

N,M=map(int, input().split())
wa={}
ac=[]
key=[]
for i in range(M):
    p,s=input().split()
    if p not in ac:
        if s=="WA":
            if s not in key:
                wa[p]=0
                key.append(p)
            else:
                wa[p]+=1
        else:
            ac.append(p)
ans=0
for i in ac:
    if i in key:
        ans+=wa[i]
print(len(ac),ans)  

N,M=map(int, input().split())
wa={}
ac=[]
key=[]

    
for i in range(M):
    p,s=input().split()
    if p not in ac:
        if p not in key:
            key.append(p)
            wa[P[i]]=0

        if s=="WA":
            wa[p]+=1
        else:
            ac.append(p)
ans=0
for i in key:
    if i in ac:
        ans+=wa[i]
print(len(ac),ans)



N,M=map(int,input().split())
AC={}
WA={}
for i in range(M):
    a,b=input().split()
    if not(a in AC.keys()):
        if b=="AC":
            AC[a]=1
        else:
            if a in WA.keys():
                WA[a]+=1
            else:
                WA[a]=1
y=0
for i in AC.keys():
    if i in WA.keys():
        y+=WA[i]
print(sum(AC.values()),y)

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
N, M = map(int, input().split())

wa = [0] * N
pnt = [0] * N
ac = [False] * N

for _ in range(M):
    tmp = 0
    p, s = list(map(str, input().split()))
    if s == 'WA':
      wa[int(p)] += 1
    elif s == 'AC' and not (ac[int(p)]):
      ac[int(p)] = not (ac[int(p)])
      pnt[int(p)] += wa[int(p)]

print(ac.count(True), sum(pnt))

N, M = map(int, input().split())

wa = [0] * N
pnt = [0] * N
ac = [False] * N

for _ in range(M):
    p, s = list(map(str, input().split()))
    if s == 'WA':
      wa[int(p) - 1] += 1
    elif s == 'AC' and not (ac[int(p) - 1]):
      ac[int(p) - 1] = not (ac[int(p) - 1])
      pnt[int(p) - 1] += wa[int(p) - 1]

print(ac.count(True), sum(pnt))

Verdicts: Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
n,m=map(int,input().split())
if m==0:
    print(0,0)
    exit()
AC=[0]*n+1
WA=[0]*n+1

for i in range(m):
    p,s=map(str,input().split())
    if s=="AC":
        AC[int(p)]+=1
    elif s=="WA" and AC[int(p)]==0:
        WA[int(p)]+=1

for i in range(n+1):
    if AC[i]==0:
        WA[i]=0

cnt=AC.count(0)
answer=len(AC)-cnt
ans=sum(WA)
print(answer,ans)

n,m=map(int,input().split())
if m==0:
    print(0,0)
    exit()
AC=[0]*(n+1)
WA=[0]*(n+1)

for i in range(m):
    p,s=map(str,input().split())
    if s=="AC":
        AC[int(p)]+=1
    elif s=="WA" and AC[int(p)]==0:
        WA[int(p)]+=1

for i in range(n+1):
    if AC[i]==0:
        WA[i]=0

cnt=AC.count(0)
answer=len(AC)-cnt
ans=sum(WA)
print(answer,ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
import numpy as np
n,m = map(int,input().split())

p = []
s = []
ans_a = np.zeros(n+1)
ans_p = np.zeros(n+1)

for i in range(m):
    pi ,si = map(str,input().split())
    p.append(int(pi))
    s.append(si)

for i in range(m):
    if s[i] == "AC":
        ans_a[p[i]] = 1
    if s[i] == "WA" and ans_a[p[i]] == 0:
        ans_p[p[i]] += 1

print(int(np.sum(ans_a)), int(np.sum(ans_p))s)


import numpy as np
n,m = map(int,input().split())

p = []
s = []
ans_a = np.zeros(n)
ans_p = np.zeros(n)

for i in range(m):
    pi ,si = map(str,input().split())
    p.append(int(pi))
    s.append(si)

for i in range(m):
    if s[i] == "AC":
        ans_a[p[i]-1] = 1
    elif ans_a[p[i]-1] == 0:
        ans_p[p[i]-1] += 1

for i in range(n):
    if ans_a[i] == 0:
        ans_p[i] = 0

print(int(np.sum(ans_a)),int(np.sum(ans_p)))


Verdicts: Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10000000)

N, M = map(int, input().split())

ac_set = set()
wa_count = 0

for i in range(M):
    p, s = input().split()

    
    if s == 'AC':
        ac_set.add(p)
    elif s == 'WA':
        if s not in ac_set:
            wa_count += 1
    else:
        pass

ac_count = len(ac_set)

print('{} {}'.format(ac_count, wa_count))


import sys
input = sys.stdin.readline
sys.setrecursionlimit(10000000)

N, M = map(int, input().split())

ac_set = set()
wa_dict = {}

for i in range(M):
    p, s = input().split()

    
    if s == 'AC':
        ac_set.add(p)
    elif s == 'WA':
        if p not in ac_set:
            if wa_dict.get(p) is None:
                wa_dict[p] = 1
            else:
                wa_dict[p] += 1
    else:
        pass

ac_count = len(ac_set)
wa_count = 0

for k, v in wa_dict.items():
    if k in ac_set:
        
        wa_count += v

print('{} {}'.format(ac_count, wa_count))


Verdicts: Wrong Answer

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
n,m=map(int,input().split())

ans_ac = set()
wa_cnt = 0
wa_sled = [i for i in range(1,n+1)]


for i in range(m):
  p,s = input().split()
  if s == "AC":
    ans_ac.add(p)
      
  if s == 'WA' and p not in wa_sled:
    wa_cnt += 1
    
print(len(ans_ac),wa_cnt)

n,m = map(int,input().split())
WA = 0
q = []
ans = []
for i in range(m):
    print(ans,WA,q)
    p,s = input().split()
    if p in q:
        if p in ans:
            continue
        else:
            if s == 'WA':
                WA += 1
            else:
                ans.append(p)
    elif p not in q:
        q.append(p)
        if s == 'WA':
            WA += 1
        else:
            ans.append(p)
            
print(len(ans),WA)

n,m=map(int,input().split())
ac_cnt = set()
wa_cnt = 0
penalty = [0]*n
for i in range(m):
    p,s = input().split()
    num = p - 1
    if num not in ac_cnt:
        if s == "AC":
            ac_cnt.add(num)
            wa_cnt += penalty[num]
        else:
            penalty[num] += 1
print(len(set(ac_cnt)),wa_cnt)
    

n,m=map(int,input().split())
ac_cnt = set()
wa_cnt = 0
penalty = [0]*n
for i in range(m):
    p,s = input().split()
    num = int(p) - 1
    if num not in ac_cnt:
        if s == "AC":
            ac_cnt.add(num)
            wa_cnt += penalty[num]
        else:
            penalty[num] += 1
print(len(set(ac_cnt)),wa_cnt)

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
from collections import defaultdict
N,M = map(int,input().split())
AC_List = defaultdict(int)
WA_List = defaultdict(int)

for i in range(M):
    Num,Sta = map(str,input().split())
    if Num in AC_List:
        continue
    else:
        if Sta == "WA":
            WA_List[Num] += 1
        else:
            AC_List[Num] += 1

ansct = 0
for k,v in WA_List:
    if k in AC_List:
        ansct += v
            
print(str(len(AC_List))+" " +str(ansct))
            
            

from collections import defaultdict
N,M = map(int,input().split())
AC_List = defaultdict(int)
WA_List = defaultdict(int)

for i in range(M):
    Num,Sta = map(str,input().split())
    if Num in AC_List:
        continue
    else:
        if Sta == "WA":
            WA_List[Num] += 1
        else:
            AC_List[Num] += 1

ansct = 0
for k,v in WA_List.items():
    if k in AC_List:
        ansct += v
            
print(str(len(AC_List))+" " +str(ansct))
            
            

Verdicts: Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n,m=map(int,readline().split())
dic={}
w=ac=0
for _ in range(m):
  a,b=readline().split()
  if a in dic:
    if dic[a]:
      if b == b'WA':
        w+=1
      else:
        ac+=1
        dic[a]=False
  else:
    dic[a]=True
    if b == b'WA':
      w+=1
      print(w)
    else:
      ac+=1
      dic[a]=False
print(ac,w)
      


import sys
readline = sys.stdin.buffer.readline

n, m = map(int, readline().split())
ac_lst = [False] * (n + 1)
wa_lst = [0] * (n + 1)
ac = w = 0
for _ in range(m):
    a, b = readline().split()
    a = int(a)
    if ac_lst[a]:
        continue
    if b == b'WA':
        wa_lst[a] += 1
    else:
        ac += 1
        w += wa_lst[a]
        ac_lst[a] = True
print(ac, w)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
from collections import defaultdict
N, M = map(int, input().split())
d = defaultdict(lambda : "WA")
correct = 0
incorrect = 0
for _ in range(M):
    p, S = input().split()
    if d[p] == "WA":
        if S == "WA":
            incorrect += 1
            print(p, "WA", d)
        else:
            correct += 1
            d[p] = "AC"
            print(p, "AC", d)
print(correct, incorrect)

N, M = map(int, input().split())
ac = 0
wa = 0
mp = [0]*N
for _ in range(M):
    p, S = input().split()
    p = int(p) - 1
    if S == "AC":
        if mp[p] != "AC":
            ac += 1
            wa += mp[p]
            mp[p] = "AC"
    else:
        if mp[p] != "AC":
            mp[p] += 1
print(ac, wa)

Verdicts: Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):

a,b = map(int,input().split())
dp = [0]*(100010)
qp = [0]*(100010)
for i in range(b):
    ta,tb = map(str,input().split())
    ta = int(ta)
    if tb == 'WA' and qp[ta] == 0 :dp[ta]+=1
    elif tb == 'AC' and qp[ta] == 0 :qp[ta]==1
print(sum(qp),sum(dp))

a,b = map(int,input().split())
dp = [0]*(100010)
qp = [0]*(100010)
for i in range(b):
    ta,tb = map(str,input().split())
    ta = int(ta)
    if qp[ta] == 0 :
        if tb == 'WA':dp[ta]+=1
        else qp[ta]=1
print(sum(qp),sum(dp))


a,b = map(int,input().split())
dp = [0]*(100010)
qp = [0]*(100010)
for i in range(b):
    ta,tb = map(str,input().split())
    ta = int(ta)
    if qp[ta] == 0 :
        if tb == 'WA':
            dp[ta]+=1
        else :
            qp[ta]=1
ANS = 0
for i, j in zip(dp,qp):
    ANS += i*j
print(sum(qp),ANS)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
n, m = map(int, input().split(' '))

pena = [0 for i in range(n)]
acc = [0 for i in range(n)]

for i in range(m):
    pp, ss = input().split(' ')
    p = int(pp) - 1

    if acc[p] == 0:
        if ss == 'WA':
            pena[p] += 1
        else:
            acc[p] = 1

for i in range(m):
    pena[i] = pena[i] * acc[i]

print(sum(acc), sum(pena))

n, m = map(int, input().split(' '))

pena = [0 for i in range(n)]
acc = [0 for i in range(n)]

for i in range(m):
    pp, ss = input().split(' ')
    p = int(pp) - 1

    if acc[p] == 0:
        if ss == 'WA':
            pena[p] += 1
        else:
            acc[p] = 1

for i in range(n):
    pena[i] = pena[i] * acc[i]

print(sum(acc), sum(pena))

Verdicts: Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
from collections import OrderedDict
n, m = map(int,input().split())
a = OrderedDict()

for i in range(m):
  p, s = input().split()
  if a.get(p) == None:
    a[p] = list()
  a[p].append(s)

for k, v in a.items():
  sum += a.find('AC')

print(sum)

from collections import OrderedDict
n, m = map(int,input().split())

aclist = [0]*n
walist = [0]*n
acflag = [False]*n

for i in range(m):
  pp, s = input().split()
  p = int(pp)
  if s == 'AC':
    if acflag[p]:
      pass
    else:
      aclist[p] += 1
      acflag[p] = True
  else:
    if acflag[p]:
      pass
    else:
      walist[p] += 1
  

print(sum(aclist), sum(walist))


from collections import OrderedDict
n, m = map(int,input().split())
a = OrderedDict()

for i in range(m):
  p, s = input().split()
  if a.get(p) == None:
    a[p] = list()
  a[p].append(s)
  
sum = 0
for k, _ in a.items():
  try:
    sum += a[k].index('AC')
  except:
    pass
print(sum)


from collections import OrderedDict
n, m = map(int,input().split())
 
aclist = [0]*n
walist = [0]*n
wa = 0
for i in range(m):
  pp, s = input().split()
  p = int(pp) - 1
  if s == 'AC':
    if not aclist[p]:
      aclist[p] = 1
      wa += walist[p]
  else:
    if not aclist[p]:
      walist[p] += 1
"""
  pp, s = input().split()
  p = int(pp) - 1
  if s == 'AC' and not aclist[p]:
    aclist[p] = 1
    ac += 1
    wa += walist[p]
  else:
    walist[p] += 1
"""
print(sum(aclist), wa)

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
N, M = map(int, input().split())
p = [0] * M
S = [0] * M
count_AC = [0] * N
count_WA = [0] * N
for i in range(M):
    p[i],S[i] =  input().split()
    p[i] = int(p[i])

    if S[i] == 'AC':
        if count_AC[p[i]] == 0:
            count_AC[p[i]] = 1
            
    if S[i] == 'WA':
        if count_AC[p[i]] == 0:
            count_WA[p[i]] += 1
            
print(sum(count_AC) , sum(count_WA))

N, M = map(int, input().split())
p = [0] * M
S = [0] * M
count_AC = [0] * N
count_WA = [0] * N
for i in range(M):
    p[i],S[i] =  input().split()
    p[i] = int(p[i]) - 1

    if S[i] == 'AC':
        if count_AC[p[i]] == 0:
            count_AC[p[i]] = 1
            
    if S[i] == 'WA':
        if count_AC[p[i]] == 0:
            count_WA[p[i]] = count_WA[p[i]] + 1
            
print(sum(count_AC) , sum([x * y for (x, y) in zip(count_AC, count_WA)]))

Verdicts: Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
import itertools
n, m = map(int, input().split())
P = [input().split() for i in range(m)]
P = list(itertools.chain.from_iterable(P))
ac_list = []
wa_list = [0] * n

counta = 0
countb = 0
for i in range(1, m * 2, 2):
    if P[i] == "AC" and:
        if int(P[i - 1]) not in ac_list:
            counta += 1
            ac_list.append(int(P[i - 1]))
            countb += wa_list[int(P[i - 1]) - 1]
    else:
        wa_list[int(P[i - 1]) - 1] += 1
print(counta, countb)

import itertools
n, m = map(int, input().split())
P = [input().split() for i in range(m)]
P = list(itertools.chain.from_iterable(P))
ac_list = [0] * n
wa_list = [0] * n

counta = 0
countb = 0
for i in range(1, m * 2, 2):
    if P[i] == "AC" and ac_list[int(P[i - 1])] == 0:
        counta += 1
        ac_list[int(P[i - 1])] = 1
        countb += wa_list[int(P[i - 1]) - 1]
    elif P[i] == "WA":
        wa_list[int(P[i - 1]) - 1] += 1
    else:
        continue

print(counta, countb)


import itertools
n, m = map(int, input().split())
P = [input().split() for i in range(m)]
P = list(itertools.chain.from_iterable(P))
ac_list = [0] * n
wa_list = [0] * n
counta = 0
countb = 0
for i in range(1, m * 2, 2):
    if P[i] == "AC" and ac_list[int(P[i - 1])-1] == 0:
        counta += 1
        ac_list[int(P[i - 1])-1] = 1
        countb += wa_list[int(P[i - 1]) - 1]
    elif P[i] == "WA":
        wa_list[int(P[i - 1]) - 1] += 1
    else:
        continue

print(counta, countb)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N,M = map(int,readline().split())
PS = [line.split() for line in readlines()]

AC = [False] * (N+1)
WA_cnt = [0] * (N+1)

penal = 0
for p,s in PS:
    p = int(p)
    if AC[p]:
        continue
    if s == 'WA':
        WA_cnt[p] += 1
    else:
        AC[p] = True
        penal += WA_cnt[p]

ac = sum(AC)
print(ac, penal)

N,M=[int(i) for i in input().split()]
AC,WA=[False]*N,[0]*N
for i in range(M):
    p,s=input().split()
    p=int(p)-1
    if AC[p]==False:
        if s=="AC":
            AC[p]=True
        if s=="WA":
            WA[p]+=1
    else:
        continue

ans_AC=AC.count(True)
ans_WA=0
for i in range(N):
    if AC[i]:
        ans_WA+=WA[i]
print(ans_AC,ans_WA)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
n, m = list(map(int, input().split()))

ac = [0] * n
wa = [0] * n
pena = 0

for i in range(m):
    question, answer = input().split()
    question = int(question)
    if (answer == "AC") and (ac[question] == 0):
        ac[question] = 1
        pena += wa[question]
    elif (answer == "WA") and (ac[question] == 0):
        wa[question] += 1

print(sum(ac), pena)

n,m = list(map(int, input().split()))
 
ac = [0]*n
wa = [0]*n
pena = 0
 
for i in range(m):
  question, answer = input().split()
  question = int(question)
  
  if (answer=="AC") and (ac[question]==0):
    ac[ques] = 1
    pena += wa[ques]
  elif (answer=="WA") and (ac[question]==0):
    wa[question] += 1
    
print(sum(ac), pena)

N,M=map(int,input().split())
ac_list = [0] * N
wa_list = [0] * N

for i in range(M):
    Pi, answer = input().split()
    number=int(Pi)
    if answer =='AC':
        
        ac_list[number] =1
        
    else:
        if ac_list[number]!=1:
            wa_list[number] =wa_list[number]+1

wa_num = 0
ac_num = 0
for i in range(N):
    if ac_list[i] == 1:
       ac_num=ac_num+1
       wa_num=wa_list[i]
    
print(ac_num, wa_num)


n, m = list(map(int, input().split()))

ac = [0] * n
wa = [0] * n
pena = 0

for i in range(m):
    question, answer = input().split()
    question = int(question)
    if (answer == "AC") and (ac[question] == 0):
        ac[question] = 1
        pena += wa[question]
    elif (answer == "WA") and (ac[question] == 0):
        wa[question] += 1

print(sum(ac), pena)

n, m = list(map(int, input().split()))

ac = [0] * (n+1)
wa = [0] * (n+1)
pena = 0

for i in range(m):
    question, answer = input().split()
    question = int(question)
    if (answer == "AC") and (ac[question] == 0):
        ac[question] = 1
        pena += wa[question]
    elif (answer == "WA") and (ac[question] == 0):
        wa[question] += 1

print(sum(ac), pena)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
N,M = map(int,input().split())
p = [0]*M
s = [a]*M
for i in range(M):
    p[i],s[i] = map(str,input().split())
pans = 0
sans = 0

for j in range(N):
    for k,val in enumerate(p):
        if val == str(j+1) and s[k] == "WA":
            sans += 1
        elif val == str(j+1) and s[k] == "AC":
            pans += 1
            break
print(int(pans),int(sans))

n,m = map(int,input().split())
a = [input().split() for i in rabge(m)]
p = [int(i[0]) for i in a]
q = [j[1] for j in a]

ac = 0
wa = 0
wa_c = [0]*n
ac_c = [False]*n

for t in range(m):
    if ac_c[p[t]-1]:
        continue
    if q[t] == "AC":
        ac += 1
        ac_c[p[t]-1] = True
        wa += wa_c[p[t]-1]
    else:
        wa_c[p[t]-1] += 1
print(ac,wa)

N,M = map(int,input().split())
p = [0]*M
s = [a]*M
for i in range(M):
    p[i],s[i] = map(str,input().split())
pans = 0
sans = 0

for j in range(N):
    for k,val in enumerate(p):
        if val == str(j+1) and s[k] == "WA":
            sans += 1
        elif val == str(j+1) and s[k] == "AC":
            pans += 1
            break
print(pans,sans)

N,M = map(int,input().split())
p = [0]*M
s = [a]*M
for i in range(M):
    p[i],s[i] = map(str,input().split())
pans = 0
sans = 0

for j in range(N):
    for k,val in enumerate(p):
        if val == str(j+1) and s[k] == "WA":
            sans += 1
        elif val == str(j+1) and s[k] == "AC":
            pans += 1
            break
print(pans,sans)

n,m = map(int,input().split())
a = [input().split() for i in range(m)]
p = [int(i[0]) for i in a]
q = [j[1] for j in a]

ac = 0
wa = 0
wa_c = [0]*n
ac_c = [False]*n

for t in range(m):
    if ac_c[p[t]-1]:
        continue
    if q[t] == "AC":
        ac += 1
        ac_c[p[t]-1] = True
        wa += wa_c[p[t]-1]
    else:
        wa_c[p[t]-1] += 1
print(ac,wa)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
N, M = list(map(lambda x: int(x), input().split()))
cleared = [False for i in range(N+1)]
ac = 0
wa = 0
for _ in range(M):
  p, s = input().split()
  p = int(p)
  
  if cleared[p]:
    continue
  print(s)
  if s == "AC":
    cleared[p] = True
    ac = ac + 1
  elif s == "WA":
    wa = wa + 1

print(ac, wa)

import numpy as np
N, M = list(map(lambda x: int(x), input().split()))
cleared = np.array([False for i in range(N+1)])
wa_count = np.array([0 for i in range(N+1)])
for _ in range(M):
  p, s = input().split()
  p = int(p)
  
  if cleared[p]:
    continue
  if s == "AC":
    cleared[p] = True
  elif s == "WA":
    wa_count[p] = wa_count[p] + 1

print("{} {}".format(sum(np.array(cleared) *1), sum(wa_count[cleared])))

Verdicts: Wrong Answer

Accepted