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):

cnts = [0] * n


at_dict = {}

for i in range(m):
    question, result = map(str, input().split())
    if result == 'AC':
        
        at_dict[question] = cnts[int(question)-1]
    elif result == 'WA':
        
        cnts[int(question)-1] += 1
    
ac = len(at_dict)
wa = sum(v for v in at_dict.values())

print(ac, wa)

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

for i in range(m):
    question, result=input().split()
    num = int(question) - 1
    if result == "AC" and ans[num]:
        ans[num]=False
        ac+=1
    
    elif result == "WA" and ans[num]:
        wa[num] += 1
 
wa_sum = 0

for i in range(n):
    
    if not ans[i]:
        wa_sum += wa[i]
 
print(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())
p=[]
S=[]
for i in range(M):
  p0,S0=map(int,input().split())
  p+=[p0]
  S+=[S0]
awlist=[0 for i in range(N)]
walist=[0 for i in range(N)]
wacount=0
account=0
for i in range(M):
  if s[i]=='WA' and awlist[s[i]]==0:
    walist[s[i]]+=1
  elif s[i]=='AC' and awlist[s[i]]==0:
    account+=1
    awlist[s[i]]=1
    wacount+=walist[s[i]]
Answer=[account,wacount]
print(*Answer)

N,M=map(int,input().split())
p=[]
s=[]
for i in range(M):
  p0,S0=map(str,input().split())
  p0=int(p0)-1
  p+=[p0]
  s+=[S0]
awlist=[0 for i in range(N)]
walist=[0 for i in range(N)]
wacount=0
account=0
for i in range(M):
  if s[i]=='WA' and awlist[p[i]]==0:
    walist[p[i]]+=1
  elif s[i]=='AC' and awlist[p[i]]==0:
    account+=1
    awlist[p[i]]=1
    wacount+=walist[p[i]]
Answer=[account,wacount]
print(*Answer)

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())
collect=[]
pen=[]
sum=0
for i in range(m):
  p,s=input().split()
  if p not in collect:
    if s=='WA':
      pen.append(p)
    else:
      collect.append(p)
      sum=sum+pen.count(p)
print(len(collect),sum-len(list))

n,m=map(int,input().split())
list=[]
sum=0
for i in range(m):
  p,s=input().split()
  if s='AC':
    list.append(p)
  else:
    if p not in list:
      sum=sum+1
print(sum)

n,m=map(int,input().split())
list=[]
sum=0
for i in range(m):
  p,s=input().split()
  if s=='AC':
    list.append(p)
  else:
    if p not in list:
      sum=sum+1
print(sum)

n,m=map(int,input().split())
ac=[0]*(n+1)
wa=[0]*(n+1)
for i in range(m):
  p,s=input().split()
  if ac[int(p)]!=1:
    if s=='WA':
      wa[int(p)]=wa[int(p)]+1
    else:
      ac[int(p)]=1
for i in range(n+1):
  if ac[i]==0:
    wa[i]=0
print(sum(ac),sum(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())
an = []

if(m != 0):
    for i in range(m):
        tp = list(map(str, input().split()))
        tp[0] = int(tp[0])
        an.append(tp)

    print(an)

    sc = 0
    er = 0

    flag = 0
    prob = an[0][0]
    for i in range(m):
        pr = an[i][0]
        ans = an[i][1]
        if (prob != pr):
            flag = 0
            prob = pr
        if(flag == 0 and ans == "AC"):
            sc += 1
            flag = 1
        elif (flag == 0 and ans == "WA"):
            er += 1

else:
    sc = 0
    er = 0

print("{} {}".format(sc, er))


from operator import itemgetter

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

an = [0]*n

sc = 0
er = 0

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


print("{} {}".format(sc, er))


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):




def main():
    n,m = map(int,input().split())
    d = dict()
    for i in range(m):
        a,b = input().split()
        a = int(a)
        if a not in d:
            d[a] = [0]
        if d[a][-1] != "AC":
            d[a].append(b)
    ac = 0
    pe = 0
    print(d)
    for i in d.values():
        #print(i)
        if i[-1] == "AC":
            ac += 1
        pe += i.count("WA")
    print(ac,pe)








if __name__ == '__main__':
    main()






def main():
    n,m = map(int,input().split())
    d = dict()
    for i in range(m):
        a,b = input().split()
        a = int(a)
        if a not in d:
            d[a] = [0]
        if d[a][-1] != "AC":
            d[a].append(b)
    ac = 0
    pe = 0
    #print(d)
    for i in d.values():
        #print(i)
        if i[-1] == "AC":
            ac += 1
            pe += i.count("WA")
    print(ac,pe)








if __name__ == '__main__':
    main()


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())
correct = [0]*N
penalty = [0]*N
ans_c,ans_p = 0,0
for i in range(M):
    p,s = input().split()
    p = int(p)
    if s=="AC":
        if correct[p-1]==0:
            correct[p-1]+=1
    if s=="WA":
        if correct[p-1]==0:
            penalty[p-1]+=1
            
ans_penalty = 0
for i in range(N):
    if correct[i]!=1:
        ans_penalty+=penalty[i]
print(sum(correct),ans_penalty)


N,M = map(int,input().split())
correct = [0]*N
penalty = [0]*N
ans_c,ans_p = 0,0
for i in range(M):
    p,s = input().split()
    p = int(p)
    if s=="AC":
        if correct[p-1]==0:
            correct[p-1]+=1
    if s=="WA":
        if correct[p-1]==0:
            penalty[p-1]+=1

ans_penalty = 0
for i in range(N):
    if correct[i]>=1:
        ans_penalty+=penalty[i]
print(sum(correct),ans_penalty)

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 = [list(map(str,input().split())) for _ in range(M)]

wacnt = [0]*(N+1)
is_ac = [False]*(N+1)
for pp,s in ps:
    p = int(pp)
    if s=='AC':
        is_ac[p] = True
    else:
        if not is_ac[p]:
            wacnt[p] += 1

ans = 0
for l in range(N+1):
    if is_ac[l]:
       ans += wacnt[l]
       
print(ans)


N,M = map(int,input().split())
ps = [list(map(str,input().split())) for _ in range(M)]

wacnt = [0]*(N+1)
is_ac = [False]*(N+1)
for pp,s in ps:
    p = int(pp)
    if s=='AC':
        is_ac[p] = True
    else:
        if not is_ac[p]:
            wacnt[p] += 1
num = 0
ans = 0
for l in range(N+1):
    if is_ac[l]:
       ans += wacnt[l]
       num += 1
       
print(num,ans)

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):
# -*- coding: utf-8 -*-

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

AC = [False for _ in range(N)]
WA = [0 for _ in range(N)]

for _ in range(M):
    p,s = input().split()
    p = int(p)
    if AC[p]:
        continue
    if s=='AC':
        AC[p] = True
    else:
        WA[p] += 1

print(sum(AC), sum(WA))

# -*- coding: utf-8 -*-

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

AC = [False for _ in range(N)]
WA = [0 for _ in range(N)]
total_WA = 0

for _ in range(M):
    p,s = input().split()
    p = int(p)-1
    if AC[p]:
        continue
    if s=='AC':
        AC[p] = True
        total_WA += WA[p]
    else:
        WA[p] += 1

print(sum(AC), total_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):
n, m = input().split()
m = int(m)
if m == 0:
    print("0 0")
else:
    penalty = {}
    score = 0
    last = False
    for i in range(0, m):
        b = input().split()
        if b[1] == 'AC':
            if b[0] not in penalty.keys():
                score += 1
                penalty[b[0]] = 0
            last = True
        elif b[1] == 'WA':
            if last and b[0] in penalty.keys():
                continue
            else:
                if b[0] not in penalty.keys():
                    penalty[b[0]] = 1
                else:
                    penalty[b[0]] += 1
            last = False
    print(str(score) + " " + str(sum(penalty.values())))


n, m = map(int, input().split())
if m == 0:
    print("0 0")
else:
    p = 0
    p_flag = [0] * n
    s = 0
    s_flag = [0] * n
    for i in range(m):
        b = input().split()
        b[0] = int(b[0])
        if b[1] == 'AC':
            if s_flag[b[0] - 1] == 0:
                s += 1
                s_flag[b[0] - 1] = 1
                p += p_flag[b[0] - 1]
        else:
            p_flag[b[0] - 1] += 1
    print(str(s) + " " + str(p))


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_count = 0
wa_count = 0
p_dic = {}

for i in range(m):
    x = list(map(str,input().split(" ")))
    x0 = int(x[0])
    x1 = str(x[1])
    if x0 not in p_dic:
        if x1 == "AC":
            ac_count += 1
            p_dic[x0] = 1
        else:
            wa_count += 1
            p_dic[x0] = 0
            print(p_dic)
    else:
        if x1 == "AC":
            if p_dic[x0] == 1:
                pass
            else:
                ac_count += 1
                p_dic[x0] = 1
                print(p_dic)
        else:
            if p_dic[x0] == 1:
                pass
            else:
                wa_count += 1
                p_dic[x0] = 0
                print(p_dic)
print(ac_count,wa_count)

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

for i in range(m):
    x = list(map(str,input().split(" ")))
    x0 = int(x[0])
    x1 = str(x[1])
    if ac_list[x0-1] == 1:
        pass
    else:
        if x1 == "AC":
            ac_count += 1
            ac_list[x0-1] = 1
        else:
            wa_list[x0-1] += 1

acnone =[i for i, x in enumerate(ac_list) if x == 0]
if not acnone:
    pass
else:
    for i in acnone:
        wa_list[i] = 0
wa_count = sum(wa_list)
print(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())

cor = 0
penalty = 0
dic = {}
for i in range(M):
  p, S = input().split()
  p = int(p)
  if p not in dic:
    dic[p] = "_"
  if (S == "AC") & (dic[p] != "AC"):
    dic[p] = "AC"
    cor = cor+1
    continue
  elif (S == "WA") & (dic[p] != "AC"):
    penalty = penalty + 1
    
print("{} {}"penalty)

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

penalty = 0
dic = {}
for i in range(M):
  p, S = input().split()
  p = int(p)
  if p not in dic:
    dic[p] = "_"
  if S == "AC":
    dic[p] = "AC"
    continue
  elif (S == "WA") & (dic[p] != "AC"):
    penalty = penalty + 1
    
print(penalty)

N, M = map(int, input().split())
 
cor = 0
penalty = 0
dic_penalty = {}
dic = {}
for i in range(M):
  p, S = input().split()
  p = int(p)
  if p not in dic:
    dic[p] = "_"
    dic_penalty[p] = 0
  if (S == "AC") & (dic[p] != "AC"):
    dic[p] = "AC"
    cor = cor+1
    penalty = penalty + dic_penalty[p]
    continue
  elif (S == "WA") & (dic[p] != "AC"):
    dic_penalty[p] = dic_penalty[p] + 1
    
print("{} {}".format(cor, penalty))

Verdicts: 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
ac = [0] * n
wa = [0] * n

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

for i in range(n):
    if ac[i] == 0:
        wa[i] = 0

print(sum(ac), sum(wa))

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

p = [0] * m
s = [0] * m
ac = [0] * n
wa = [0] * n

for i in range(m):
    p[i], s[i] = input().split()

p = [int(i) for i in p]
 
for i in range(m):
    if ac[p[i] - 1] == 0:
        if s[i] == 'AC':
            ac[p[i] - 1] = 1
        else:
            wa[p[i] - 1] += 1

for i in range(n):
    if ac[i] == 0:
        wa[i] = 0

print(sum(ac), sum(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 numpy as np
N,M=map(int,input().split())
A=[]
for i in range(M):
  A.append(tuple(map(str,input().split())))
check=np.zeros((N,2))
for i in range(M):
  if check[int(A[i][0])-1,0]==0:
    if A[i][1]=='WA':
      check[int(A[i][0])-1,1]+=1
    else:
      check[int(A[i][0])-1,0]+=1
sum=check.sum(axis=0)
print(sum[0],sum[1])

import numpy as np
N,M=map(int,input().split())
A=[]
for i in range(M):
  A.append(tuple(map(str,input().split())))
check=np.zeros((N,2))
for i in range(M):
  if check[int(A[i][0])-1,0]==0:
    if A[i][1]=='WA':
      check[int(A[i][0])-1,1]+=1
    elif A[i][1]=='AC':
      check[int(A[i][0])-1,0]+=1
for i in range(N):
  if check[i,0]==0:
    check[i,1]=0
sum=check.sum(axis=0)
print(int(sum[0]),int(sum[1]))

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())
TF=[0]*n
p=[0]*n
for _ in range(m):
    i,s =map(str,input().split())
    i=int(i)-1
    if (s=="WA") and (TF[i]==1):
        pass
    elif (s=="WA") and (TF[i]==0):
        p[i]+=1
    elif (s=="AC") and (TF[i]==0):
        TF[i]=1
    elif (s=="AC") and (TF[i]==1):
        pass
for i in range(m):
    if TF[i]==0:
        p[i]=0
ac=sum(TF)
pe=sum(p)
print(ac,pe)

n,m=map(int,input().split())
TF=[0]*n
p=[0]*n
for _ in range(m):
    i,s =map(str,input().split())
    i=int(i)-1
    if (s=="WA") and (TF[i]==1):
        pass
    elif (s=="WA") and (TF[i]==0):
        p[i]+=1
    elif (s=="AC") and (TF[i]==0):
        TF[i]=1
    elif (s=="AC") and (TF[i]==1):
        pass
for i in range(n):
    if TF[i]==0:
        p[i]=0
ac=sum(TF)
pe=sum(p)
print(ac,pe)

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(" "))
p = []
S = []
flag_AC = []
flag_WA = []

for i in range(M):
    inp = input().split(" ")
    p.append(int(inp[0]))
    S.append(inp[1])

for i in range(N):
    flag_AC.append(0)
    flag_WA.append(0)


def Anc(n):
    L = []
    L.append(p[n])
    L.append(S[n])
    return L

AC = 0
WA = 0

for i in range(M):
    data = Anc(i)
    if data[1] == "AC":
        if flag_AC[data[0]] == 0:
            flag_AC[data[0]] = 1
            AC = AC + 1

    if data[1] == "WA":
        if flag_AC[data[0]] == 0:
            flag_WA[data[0]] = flag_WA[data[0]] + 1
            WA = WA+1

print(AC,WA)

N,M = map(int,input().split(" "))
p = []
S = []
flag_AC = []
flag_WA = []

for i in range(M):
    inp = input().split(" ")
    p.append(int(inp[0]))
    S.append(inp[1])

for i in range(N):
    flag_AC.append(0)
    flag_WA.append(0)


def Anc(n):
    L = []
    L.append(p[n])
    L.append(S[n])
    return L

AC = 0
WA = 0

for i in range(M):
    data = Anc(i)
    if data[1] == "AC":
        if flag_AC[data[0]] == 0:
            flag_AC[data[0]] = 1
            AC = AC + 1

    if data[1] == "WA":
        if flag_AC[data[0]] == 0:
            flag_WA[data[0]] = flag_WA[data[0]] + 1

for i in range(M):
    data = Anc(i)
    if flag_AC[data[0]] == 0:
        flag_WA[data[0]] = 0
    else:
        flag_WA[data[0]] = flag_WA[data[0]] + 1

print(AC,WA)

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

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
P = 0
N,M = map(int,input().strip().split())
if M == 0:
    print("{0} {1}".format(0,P))
    sys.exit()
ans_list = [list(input().strip().split()) for _ in range(M)]
result = [False] * N
for ans in ans_list:
    if result[int(ans[0])-1] != True
        if ans[1] == "WA":
            P += 1
        elif ans[1] == "AC":
            result[int(ans[0])-1] = True
print("{0} {1}".format(result.count(True),P))

import sys
P = 0
N,M = map(int,input().strip().split())
if M == 0:
    print("{0} {1}".format(0,P))
    sys.exit()
ans_list = [list(input().strip().split()) for _ in range(M)]
result = [False] * N
for ans in ans_list:
    if int(ans[0]) <= N and result[int(ans[0])-1] != True
        if ans[1] == "WA":
            P += 1
        elif ans[1] == "AC":
            result[int(ans[0])-1] = True
print("{0} {1}".format(result.count(True),P))

import sys
P = 0
N,M = map(int,input().strip().split())
if M == 0:
    print("{0} {1}".format(0,0))
    sys.exit()
ans_list = [list(input().strip().split()) for _ in range(M)]
result = [False] * N
wa_count = [0] * N
for ans in ans_list:
    if result[int(ans[0])-1] != True:
        if ans[1] == "WA":
            wa_count[int(ans[0])-1] += 1
        elif ans[1] == "AC":
            result[int(ans[0])-1] = True
for i in range(len(result)):
    if result[i] == True:
        P += wa_count[i]
print("{0} {1}".format(result.count(True),P))

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())
L = list()
for m in range(M):
    l = input().split()
    L.append(l)
AC = 0
WA = 0
cnt = 0
for m in range(M):
    res = False
    if L[m][1] == 'AC':
        AC += 1
        res = True
        if res:
            cnt += 1
    elif L[m][1] == 'WA':
        WA += 1
    if int(L[m][0]) == N and res == True:
        break
print('{} {}'.format(AC // cnt, WA))


N, M = map(int, input().split())
L = list()
for m in range(M):
    l = input().split()
    L.append(l)
AC = 0
WA = 0
cnt = 0
A   = 0
man = 0
for m in range(M):
    man = L[m][0]
    if L[m][1] == 'AC':
        A = 0
        if cnt == L[m][0]:
            continue
        A += 1
        AC += 1
        cnt = L[m][0]
    if L[m][1] == 'WA':
        if A > 0 and man == L[m][0]:
            continue
        WA += 1
print('{} {}'.format(AC, WA))

N, M = map(int, input().split())
L = list()
for m in range(M):
    l = input().split()
    L.append(l)
AC = 0
WA = 0
cnt = 0
for m in range(M):
    res = False
    if L[m][1] == 'AC':
        AC += 1
        res = True
        if res:
            cnt += 1
    elif L[m][1] == 'WA':
        WA += 1
    if int(L[m][0]) == N and res == True:
        break
if AC > 0:
    AC = AC // cnt
print('{} {}'.format(AC, WA))


N, M = map(int, input().split())
AC = [0]*N
WA = [0]*N
L = []
for m in range(M):
    p, S = map(str, input().split())
    p = int(p)
    L.append([p, S])
for m in range(M):
    if not AC[L[m][0]-1] == 0:
        continue    
    if L[m][1] == 'AC':
        AC[L[m][0]-1] = 1
    elif L[m][1] == 'WA':
        WA[L[m][0]-1] += 1
A = sum(AC)
W = 0
for n in range(N):
    if AC[n] == 1:
        W += WA[n]
print(A, W)

Verdicts: Runtime Error

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):
import numpy as np

N, M = map(int,input().split())
AC = np.array([0 for i in range(N)])
WA = np.array([0 for i in range(N)])

for _ in range(M):
  p, S = map(str,input().split())
  p = int(p)
  if AC[p-1] == 0 and S == 'AC':
    AC[p-1] += 1
  elif AC[p-1] == 0 and S == 'WA':
    WA[p-1] += 1
    
for i in range(N):
  if AC[i] >= 1:
    WA[i] = 0
    
print(AC.sum(),WA.sum())
    
    

import numpy as np

N, M = map(int,input().split())
AC = np.array([0 for i in range(N)])
WA = np.array([0 for i in range(N)])

for _ in range(M):
  p, S = map(str,input().split())
  p = int(p)
  if AC[p-1] == 0 and S == 'AC':
    AC[p-1] += 1
  elif AC[p-1] == 0 and S == 'WA':
    WA[p-1] += 1
    
for i in range(N):
  if AC[i] == 1:
    WA[i] = 0
    
print(AC.sum(),WA.sum())
    
    

import numpy as np

N, M = map(int,input().split())
AC = np.array([0 for i in range(N)])
WA = np.array([0 for i in range(N)])

for _ in range(M):
  p, S = map(str,input().split())
  p = int(p)
  if AC[p-1] == 0 and S == 'AC':
    AC[p-1] += 1
  elif AC[p-1] == 0 and S == 'WA':
    WA[p-1] += 1
    
for i in range(N):
  if AC[i] == 0:
    WA[i] = 0
    
print(AC.sum(),WA.sum())
    
    

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):
#c welcome to atcoder
import sys
n,m=map(int,input().split())
ps=[]
num={}

ac=0
pena=0
if m==0:
    print('0 0')
    sys.exit()
for i in range(m):
    result=input().split()
    ps.append(result)

for x in ps:
    if x[0] not in num:
        num[x[0]]=0
    if x[1]=="WA" and num[x[0]]==0:
        pena+=1
    if x[1]=="AC" and num[x[0]]==0:
        ac+=1
        num[x[0]]=1
print(ac," ",pena)


#c welcome to atcoder
import sys
n,m=map(int,input().split())
ps=[]
num=[]

ac=0
pena=0
if m==0:
    print('0 0')
    sys.exit()
for i in range(m):
    result=input().split()
    ps.append(result)
    if ps[i][0] not in num:
        num.append(ps[i][0])
now=0
i=0
for x in ps:
    if x[0]!=num[now]:
        continue
    elif x[1]=="WA":
        pena+=1
    elif x[1]=="AC":
        ac+=1
        now+=1
    if now==len(num):
        break
print(ac," ",pena)


#c welcome to atcoder
import sys
n,m=map(int,input().split())
ps=[]
num={}

ac=0
pena=0
if m==0:
    print('0 0')
    sys.exit()
for i in range(m):
    result=input().split()
    ps.append(result)

for x in ps:
    print(x[0])
    if x[0] not in num:
        num[x[0]]=0
    print(num[x[0]])
    if x[1]=="WA" and num[x[0]]==0:
        pena+=1
    if x[1]=="AC" and num[x[0]]==0:
        ac+=1
        num[x[0]]=1

print(num)

print(ac,pena)

#c welcome to atcoder
import sys
n,m=map(int,input().split())
ps=[]
num={}

ac=0
pena=0
if m==0:
    print('0 0')
    sys.exit()
for i in range(m):
    result=input().split()
    ps.append(result)
    if result[1]=="AC":
        num[result[0]]=0

for x in ps:
    if not x[0] in num:
        continue
    if x[1]=="WA" and num[x[0]]==0:
        pena+=1
    if x[1]=="AC" and num[x[0]]==0:
        ac+=1
        num[x[0]]=1

print(ac,pena)

Verdicts: Wrong Answer

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):
num_of_probs, num_of_submission = [ int(i) for i in input().split(" ") ]

solution_table = {}

for i in range(0, num_of_submission):
  prob, result = [ i for i in input().split(" ") ]

  if solution_table.get(int(prob)) == None:
    solution_table[int(prob)] = {"WA": 0, "AC": 0}

  if result == "WA":
    if solution_table[int(prob)]["AC"] == 0:
      solution_table[int(prob)]["WA"] += 1
  else:
    solution_table[int(prob)]["AC"] += 1

total_wa = 0
for value in solution_table.values():
  total_wa += value['WA']

print( total_wa )

num_of_probs, num_of_submission = [ int(i) for i in input().split(" ") ]

solution_table = {}

for i in range(0, num_of_submission):
  prob, result = [ i for i in input().split(" ") ]

  if solution_table.get(int(prob)) == None:
    solution_table[int(prob)] = {"WA": 0, "AC": 0}

  if result == "WA":
    if solution_table[int(prob)]["AC"] == 0:
      solution_table[int(prob)]["WA"] += 1
  else:
    solution_table[int(prob)]["AC"] += 1
  
  print(solution_table)

total_wa = 0
for value in solution_table.values():
  total_wa += value['WA']

print( total_wa )
  
  

num_of_probs, num_of_submission = [ int(i) for i in input().split(" ") ]

solution_table = {}

for i in range(0, num_of_submission):
  prob, result = [ i for i in input().split(" ") ]

  if solution_table.get(int(prob)) == None:
    solution_table[int(prob)] = {"WA": 0, "AC": 0}

  if result == "WA":
    if solution_table[int(prob)]["AC"] == 0:
      solution_table[int(prob)]["WA"] += 1
  else:
    if solution_table[int(prob)]["AC"] == 0:
      solution_table[int(prob)]["AC"] += 1

total_ac = 0
total_wa = 0
for value in solution_table.values():
  if value['AC'] > 0:
    total_wa += value['WA']
    total_ac += value['AC']

print( total_ac, total_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):
w,*d=[0]*10**6
a={0}
for t in open(0):
  p,s=t.split()
  p=int(p)
  if'AC'==s*(not p in a):w+=d[p];a|={p}
  d[p]+=1
print(len(a)-1,w)

w,*d=[0]*10**6
a={0}
for t in open(0):
  p,s=t.split()
  p=int(p)
  if'AC'==s*(not p in a):w+=d[p];a|={p}
  d[p]+=s>'V'
print(len(a)-1,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):
import sys
N, M, *PS = sys.stdin.read().strip().split()
N = int(N)
ac = [0] * N
wa = [0] * N
for p, s in zip(*[iter(PS)] * 2):
  p = int(p) -1
  if s == "AC":
    ac[p] = 1
  elif ac[p] == 0:
    wa[p] += 1
penalties = sum([w or a for a, w in zip(ac, wa)])
print("{} {}".format(sum(ac),penalties)

import sys
N, M, *PS = sys.stdin.read().strip().split()
N = int(N)
ac = [0] * N
wa = [0] * N
for p, s in zip(*[iter(PS)] * 2):
  p = int(p) - 1
  if s == "AC":
    ac[p] = 1
  elif ac[p] == 0:
    wa[p] += 1
penalties = sum(w * a else 0 for a, w in zip(ac, wa))
print(sum(ac), penalties)

import sys
N, M = map(int, input().split())
PS = sys.stdin.read().strip().split()
ac, wa = [0] * N, [0] * N
for p, s in zip(*[iter(PS)] * 2):
  p = int(p) - 1
  if s == "AC":
    ac[p] = 1
  elif ac[p] == 0:
    wa[p] += 1
penalties = sum(w if a > 0 else 0 for a, w in zip(ac, wa))
print(sum(ac), penalties)

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())
WA = [0] * n
AC = [0] * n

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

WA = [WA[i] for i in range(m) if AC[i] >= 1]

print(sum(AC), sum(WA))

n, m = map(int, input().split())
WA = [0] * n
AC = [0] * n

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

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

print(sum(AC), sum(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):
N, M = map(int, input().split())
wa_dict = {}
is_AC = []
ac_cnt = 0
for i in range(N):
    p, s = input().split()
    p = int(p)
    if s == 'WA':
        if is_AC.count(p) == 0:
            if wa_dict.get(p) is None:
                wa_dict[p] = 1
            else:
                wa_dict[p] += 1
        else:
            continue
    else:
        if is_AC.count(p) == 0:
            ac_cnt += 1
            is_AC.append(p)

print(ac_cnt, sum(wa_dict.values()))


N, M = map(int, input().split())
ac = 0
is_AC = [False] * (10 ** 5) + 1
WA_cnt = [0] * (10 ** 5) + 1
for i in range(M):
    p, s = input().split()
    p = int(p)
    if s == 'WA':
        if is_AC[p]:
            continue
        else:
            WA_cnt[p] += 1
    else:
        if is_AC[p]:
            continue
        else:
            is_AC[p] = True
            ac += 1

print(ac, sum(WA_cnt))



N, M = map(int, input().split())
ac = [False] * N
wa_cnt = [0] * N
ac_cnt = 0
for i in range(M):
    p, s = input().split()
    p_i = int(p) - 1
    if s == 'WA':
        if not ac[p_i]:
            wa_cnt[p_i] += 1
    else:
        if not ac[p_i]:
            ac[p_i] = True
            ac_cnt += 1

wa_cnt_sum = 0
for i in range(N):
    if ac_cnt[i]:
        wa_cnt_sum += wa_cnt[i]

print(ac_cnt,wa_cnt_sum)


N, M = map(int, input().split())
ac = [False] * N
wa_cnt = [0] * N
ac_cnt = 0
for i in range(M):
    p, s = input().split()
    p_i = int(p) - 1
    if s == 'WA':
        if not ac[p_i]:
            wa_cnt[p_i] += 1
    else:
        if not ac[p_i]:
            ac[p_i] = True
            ac_cnt += 1

wa_cnt_sum = 0
for i in range(N):
    if ac[i]:
        wa_cnt_sum += wa_cnt[i]

print(ac_cnt,wa_cnt_sum)


Verdicts: 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())
ac = [0] * n
pen = [0] * n
pen_count = 0
for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if ac[p] == "AC":
        continue
    elif s == "AC":
        ac[p] = "AC"
    else:
        pen[p] += 1

for i in range(n):
    if ac[i] == "AC":
        pen_count = pen[i]

print(ac.count("AC"), pen_count)


n, m = map(int, input().split())
ac = [0] * n
pen = [0] * n
pen_count = 0
for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if ac[p] == "AC":
        continue
    elif s == "AC":
        ac[p] = "AC"
    else:
        pen[p] += 1
 
for i in range(n):
    if ac[i] == "AC":
        pen_count += pen[i]
 
print(ac.count("AC"), pen_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())
A_list=[N*0]
PS=[list(map(str,input().split())) for i in range(M) ]
ans=0
pena=0
for x in range(M):
    if PS[x][0] not in A_list:
        if PS[x][1]=='AC':
            A_list.append(PS[x][0])
            ans+=1
    
    elif PS[x][0] not in A_list:
        if PS[x][1]=='WA':
            pena+=1

print(ans,pena)

N,M=map(int,input().split())
A_list=[N*0]
PS=[list(map(str,input().split())) for i in range(M) ]
ans=0
pena=0
for x in range(M):
    if PS[x][0] not in A_list:
        if PS[x][1]=='AC':
            A_list.append(PS[x][0])
            ans+=1
    
    elif PS[x][0] not in A_list:
        if PS[x][1]=='WA':
            pena+=1

print(ans,pena)

import sys
input = sys.stdin.readline
 
def main():
    N, M = map(int, input().split())
 
    ac_check = [False] * N
    p_counts = [0] * N
 
    for i in range(M):
        p, s = input().strip().split()
        p = int(p) - 1
        if s == "AC":
            if not ac_check[p]:
                ac_check[p] = True
        else:
            if not ac_check[p]:
                p_counts[p] += 1
 
    ac_count = 0
    p_count = 0
    for i in range(N):
        if ac_check[i]:
            ac_count += 1
            p_count += p_counts[i]
    print(ac_count, p_count)
 
 
if __name__ == "__main__":
    main()

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())
S = [input().split() for i in range(M)]

wa = 0
ac = 0
ac_list = []
for p, s in S:
    if p not in ac_list:
        print(s)
        if s == "WA":
                wa += 1
        else:
                ac += 1
                ac_list.append(p)
print(ac, wa)

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

seikai = [False] * (n + 1)
wa_list = [0] * (n + 1)
ac = 0
wa = 0
for i in range(m):
    p, s = input().split()

    if not seikai[int(p)]:
        if s == "WA":
            wa_list[int(p)] += 1
        else:
            ac += 1
            wa += wa_list[int(p)]
            seikai[int(p)] = True
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):
d = dict()
wa = ac = 0
N, M= map(int,input().split())
for i in range(M):
  a, b = input().split()
  if a not in d:
    d[a] = 0
if d[a] >= 0 and b == "AC":
    ac += 1
    wa += d[a]
    d[a] = -1
elif d[a] >= 0:
    d[a] += 1
print(ac,wa)

d = dict()
wa = ac = 0
N, M= map(int,input().split())
for i in range(M):
  a, b = input().split()
    if a not in d:
        d[a] = 0
    if d[a] >= 0 and b == "AC":
        ac += 1
        wa += d[a]
        d[a] = -1
    elif d[a] >= 0:
        d[a] += 1
print(ac,wa)

d = dict()
wa = ac = 0
N, M= map(int,input().split())
for i in range(M):
  a, b = input().split()
  if a not in d:
    d[a] = 0
  if d[a] >= 0 and b == "AC":
    ac += 1
    wa += d[a]
    d[a] = -1
  elif d[a] >= 0:
    d[a] += 1
print(ac,wa)

Verdicts: Runtime Error

Runtime Error

Accepted