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):
# C - Welcome to AtCoder


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


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


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

    if p == "AC":
        
        ac[i] = True
    else:
        if ac[i] == False:
            wa[i] += 1

ac_cnt = 0
wa_cnt = 0

for i in range(n):
    if ac[i] == True:
        ac_cnt += 1
        wa_cnt += wa[i]

print(ac_cnt,wa_cnt)






# C - Welcome to AtCoder


n,m = map(int,input().split())
submits = [list(input().split()) for i in range(0,m)]

ac = 0
wa = 0

AC = "AC"
WA = "WA"

tmp_wa = 0
tmp_ac = 0


for i in range(len(submits)):
    
    if submits[i][1] == AC:
        
        if submits[i][0] == tmp_ac:
            continue
        ac += 1
        
        wa += tmp_wa
        
        tmp_wa = 0
        tmp_ac = submits[i][0]
    else:
        
        tmp_wa += 1

print(ac + " " + wa)

# C - Welcome to AtCoder


n,m = map(int,input().split())
submits = [list(input().split()) for i in range(0,m)]

ac = 0
wa = 0

AC = "AC"
WA = "WA"

tmp_wa = 0
tmp_ac = 0


for i in range(len(submits)):
    
    if submits[i][1] == AC:
        
        if submits[i][0] == tmp_ac:
            continue
        ac += 1
        
        wa += tmp_wa
        
        tmp_wa = 0
        tmp_ac = submits[i][0]
    else:
        
        tmp_ac = submits[i][0]
        tmp_wa += 1

print(str(ac) + " " + str(wa))

# C - Welcome to AtCoder


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


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


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

    if p == "AC":
        
        ac[i] = True
    else:
        if ac[i] == False:
            wa[i] += 1

ac_cnt = 0
wa_cnt = 0

for i in range(n):
    if ac[i] == True:
        ac_cnt += 1
        wa_cnt += wa[i]

print(ac_cnt,wa_cnt)

# C - Welcome to AtCoder


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":
        
        ac[p] = True
    else:
        if ac[p] == False:
            wa[p] += 1

ac_cnt = 0
wa_cnt = 0

for i in range(n):
    if ac[i] == True:
        ac_cnt += 1
        wa_cnt += wa[i]

print(ac_cnt,wa_cnt)

Verdicts: Runtime Error

Runtime Error

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())
solved=[False]*N
ac=0
wa=0
for _ in range(M):
  p, s=input().split()
  p=int(p)-1
  if solved[p]:
    continue
  if s=="AC":
    solved[p]=True
    ac+=1
  else:
    wa+=1
print(as, wa)  

N, M=map(int, input().split())
solved=[False]*N
wal=[0]*N
ac=0
wa=0
for _ in range(M):
  p, s=input().split()
  p=int(p)-1
  if solved[p]:
    continue
  if s=="AC":
    solved[p]=True
    ac+=1
    wa+=wal[p]
  else:
    wal[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):
import collections
n, m =map(int,input().split())
p = []
for i in range(m):
    p.append(input().split())

del_l = []
for j in range(m):
    if p[j][1] == 'AC':
        del_l.append(p[j][0])
        p[j][0] = ''
        p[j][1] = ''
    if p[j][1] == 'WA':
        p[j][0] = ''
        p[j][1] = ''
pen = 0
for s in range(m):
    if p[s][1] == 'WA' and p[s][0] in del_l:
        pen += 1
print(len(collections.Counter(del_l)),pen)

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


r = ['WA']*(N+1)
o = []
c = 0
ac_c = 0
p_c =0
li.sort()

for ps in li:
    index = int(ps[0])
    if ps[1] == 'WA':
        if r[index] == 'WA':
            
            c+=1

    else: # AC
        if r[index] == 'WA':
            r[index] = 'AC'
            p_c += c
            ac_c += 1
        else:
            pass
        c=0

print(ac_c, p_c)


N,M = map(int,input().split())
li = []
for i in range(M):
    li.append(input().split())


r = ['WA']*(N+1)
wa_li = [0]*(N+1)
o = []
c = 0
ac_c = 0

for ps in li:
    index = int(ps[0])
    if ps[1] == 'WA':
        if r[index] == 'WA':
            wa_li[index]+=1

    else: # AC
        if r[index] == 'WA':
            r[index] = 'AC'
            ac_c += 1
        else:
            pass

p_c =0
for i,v in enumerate(r):
    if v == 'AC':
        p_c+=wa_li[i]

print(ac_c, p_c)


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

 
penaltyCount = dict()
penaltyCount = defaultdict(lambda: 0, penaltyCount)
 
correct = 0
penalty = 0
 
for i in range(m):
    submission = input.split()
    p = int(submission[0]) - 1
    status = submission[1]


import sys
from collections import defaultdict

n, m = map(int, input().split())
ac = 0
wa = defaultdict(lambda: 0)
already = set()
for line in sys.stdin:
    y, z = line.strip().split()
    y = int(y)
    if y in already:
        continue
    if z == 'AC':
        ac += 1
        already.add(y)
    else:
        wa[y] += 1
    
print(ac, sum(wa[i] for i in already))

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())
num = []
apb = []

for i in range(M):
    n, a = input().split()
    num.append(int(n))
    apb.append(a)

num_wa = 0
num_ac = 0
for i in range(N):
    for j in apb[num.count(i):(num.count(i)+(num.count(i+1)))]:
        if j == 'wa':
            num_wa += 1
        if j == 'ac':
            num_ac += 1
            break
print(num_ac, num_wa)


N,M = map(int, input().split())
# List to store grades
apb = [[] for i in range(10 ** 5)]

# num and apb convert to type dict
for i in range(M):
    n, a = input().split()
    apb[int(n)] += [a]
    if a == 'AC':
      continue

apb_new = list(filter(lambda a: a != [], apb))

# count
penalty = 0
correct_answer = 0
for words in apb_new:
  if 'AC' in words:
    correct_answer += 1
    for word in words:
      if word == 'WA':
        penalty += 1
      else:
        break


print(correct_answer, 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())

N=[]

for i in range(n):
    N.append([0,0])

co=0
pe=0
for i in range(m):
    p,s=input().split()
    p=int(p)
    if s=='WA':
        N[p-1][0]+=1
    elif N[p-1][1]!=1:
        pe+=N[p][0]
        co+=1
        N[p-1][1]=1

print(str(co)+' '+str(pe))

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

N=[[0,0]*n]
co=0
pe=0
for i in range(m):
    p,s=input().split()
    p=int(p)
    if s=='WA':
        N[p-1][0]+=1
    elif N[p-1][1]!=1:
        pe+=N[p-1][0]
        co+=1
        N[p-1][1]=1

print(str(co)+' '+str(pe))

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

N=[]

for i in range(n):
    N.append([0,0])

co=0
pe=0
for i in range(m):
    p,s=input().split()
    p=int(p)
    if s=='WA':
        N[p-1][0]+=1
    elif N[p-1][1]!=1:
        pe+=N[p-1][0]
        co+=1
        N[p-1][1]=1

print(str(co)+' '+str(pe))

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
ac = 0
ac_list = []
if m==0:
    print(0,0)
else:
    for i in range(m):
        p,s = input().split()
        if s=='WA':
            wa += 1
        elif ac_list.count(p) ==0:
            ac_list.append(p)
            ac += 1
        else:
            pass
    print(ac, wa)

wa = 0
ac = 0
ac_list = []
if m==0:
    print(0,0)
else:
    for i in range(m-1:
        p,s = input().split()
        if s=='WA':
            wa += 1
        elif ac_list.count(p) ==0:
            ac_list.append(p)
            ac += 1
        else:
            pass

n,m = map(int, input().split())
wa = 0
ac = 0
ac_list = []
if m==0:
    print(0,0)
else:
    for i in range(m):
        p,s = input().split()
        if s=='WA' & ac_list.count(p) ==0:
            wa += 1
        elif ac_list.count(p) ==0:
            ac_list.append(p)
            ac += 1
        else:
            pass
    print(ac, wa)

n,m = map(int, input().split())
wa = 0
ac_list = {'AC':{}, 'WA':{}}
if m==0:
    print(0,0)
else:
    for i in range(m):
        p,s = input().split()
        ac_list[s][p] = ac_list[s].get(p, 0) + 1* int(not(p in ac_list['AC'].keys()))
    kyotu_key = list(set(ac_list['AC'].keys()) & set(ac_list['WA'].keys()))
    wa_list = [ac_list['WA'][p] for p in kyotu_key]
    print(len(ac_list['AC'].keys()), sum(wa_list))

Verdicts: Wrong Answer

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())
score = [(False, 0) for i in range(n)]
for i in range(m):
	problem, s = input().split()
	p = int(problem)-1
	if not score[p][0]:
		if s=="AC":
			score[p][0] = True
		else:
			score[p][1] += 1
	

print(sum(i[0] for i in score), sum(j if i else 0 for i, j in score))

n, m = map(int, input().split())
score = [(False, 0) for i in range(n)]
for i in range(m):
	problem, s = input().split()
	p = int(problem)-1
	if not score[p][0]:
		score[p] = (True, score[p][1]) if s=="AC" else (False, score[p][1]+1)
	

print(sum(i[0] for i in score), sum(j if i else 0 for i, j in score))

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):
result = dict()
AC, WA = 0, 0
for p,s in PS:
    p = int(p)
    if not (p in result):
        result [p] = s
        if s == "WA":
            WA += 1
        elif s == "AC":
            AC += 1
    elif result[p] == "AC":
        continue
    else:
        result[p] = s
        if s == "WA":
            WA += 1
        elif s == "AC":
            AC += 1
print(AC, WA)

N, M = map(int, input().split())
PS = [tuple(input().split()) for _ in range(M)]
result = [{"AC":0, "WA":0} for _ in range(N)]
for p,s in PS:
    i = int(p) - 1
    if result[i]["AC"] == 1:
        continue
    else:
        result[i][s] += 1
for r in result:
    AC = len([e for e in result if e["AC"] >= 1])
    WA = sum([e["WA"] for e in result])

N, M = map(int, input().split())
PS = [tuple(input().split()) for _ in range(M)]
result = dict()
AC, WA = 0, 0
for p,s in PS:
    p = int(p)
    if not (p in result):
        result [p] = s
        if s == "WA":
            WA += 1
        elif s == "AC":
            AC += 1
    elif result[p] == "AC":
        continue
    else:
        if s == "WA":
            WA += 1
        elif s == "AC":
            AC += 1
print(AC, WA)

_, M = map(int, input().split())
PS = [tuple(input().split()) for _ in range(M)]
result = dict()
AC, WA = 0, 0
for p,s in PS:
    i = int(p)
    if not (i in result):
        if s == "WA":
            result[i] = 1
        elif s == "AC":
            AC += 1
            result [i] = "AC"
    else:
        if result[i] != "AC":
            if s == "WA":
                result[i] += 1
            if s == "AC":
                AC += 1
                WA += result[i]
                result[i] = s
print(AC, WA)

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):
N,M=map(int,input().split())
PS=[list(input().split()) for i in range(M)]
AC=[0]*N
WA=[0]*N
for p,s in PS:
  p=int(p)
  if s=="AC" and AC[p]==0:
    AC[p]=1
  elif s=="WA":
    WA[p]+=1
wa=0
for i in WA:
  wa+=i
print(sum(AC),wa)
  

N,M=map(int,input().split())
AC=[0]*N
WA=[0]*N
wa=0
for i in range(M):
    p,s=input().split()
    p=int(p)-1
    if AC[p]==0 and s=="AC":
        AC[p]=1
        wa+=WA[p]
    WA[p]+=1
print(sum(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):
n,m = map(int,input().split())
pS_list = [list(input().split()) 
           for nesya in range(m)]
ac = 0
wa = 0
q_list = [0]*n
for ps in ps_list:
  p = int(ps[0])-1
  s = ps[1]
  if q_list[p] == 1:
    continue
  if s == 'WA':
    q_list[p] -= 1
  else:
    a = q_list[p]
    wa -= a
    ac += 1
    q_list[p] = 1
print(ac,wa)

n,m = map(int,input().split())
pS_list = [list(input().split()) 
           for nesya in range(m)]
ac = 0
wa = 0
q_list = [0]*n
for ps in pS_list:
  p = int(ps[0])-1
  s = ps[1]
  if q_list[p] == 1:
    continue
  if s == 'WA':
    q_list[p] -= 1
  else:
    a = q_list[p]
    wa -= a
    ac += 1
    q_list[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):
n, m = [int(i) for i in input().split(" ")]
score_dict = {}
 
for i in range(m):
    p, s = input().split(" ")
    if p not in score_dict:
        score_dict[p] = []
    
    score_dict[p].append(s)
 
ac_count = 0
wa_count = 0
 
for i in score_dict.values():

    if "AC" in i:
        ac_count += 1
        wa_count += i.index("AC")]
    else:
        wa_count += len(i)
 
print("{0} {1}".format(ac_count, wa_count))

n, m = input().split(" ")
score_dict = {}
 
for i in range(m):
    p, s = input().split(" ")
    if p not in score_dict:
        score_dict[p] = []
    
    score_dict[p].append(s)
 
ac_count = 0
wa_count = 0
 
for i in score_dict.values():
    if "AC" in i:
        ac_count += 1
    
    wa_count += len(i[:i.index("AC")])
 
print("{0} {1}".format(ac_count, wa_count))

n, m = [int(i) for i in input().split(" ")]
score_dict = {}
 
for i in range(m):
    p, s = input().split(" ")
    if p not in score_dict:
        score_dict[p] = []
    
    score_dict[p].append(s)
 
ac_count = 0
wa_count = 0
 
for i in score_dict.values():

    if "AC" in i:
        ac_count += 1
        wa_count += i.index("AC")
 
print("{0} {1}".format(ac_count, wa_count))

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 = list(map(int, input().split()))
lst = [input().split() for lst in range(M)]
lst.sort(key=lambda x: x[0])
pn = 0
temp_pn = [] 
for _ in range(M):
  temp_pn.append(0)
cr = 0
plbnum = 0
for i in lst:
  a = int(i[0])
  if N >=  a > plbnum:
    if i[1] == "WA":
      temp_pn[a] += 1
    elif i[1] == "AC":
      cr += 1
      pn += temp_pn[a-1]
      plbnum = a
print(cr, pn)

N, M = list(map(int, input().split()))
lst = [input().split() for lst in range(M)]
lst.sort(key=lambda x: x[0])
pn = 0
temp_pn = [] 
for _ in range(M):
  temp_pn.append(0)
cr = 0
plbnum = 0
for i in lst:
  a = int(i[0])
  if N >=  a > plbnum:
    if i[1] == "WA":
      temp_pn[a] += 1
    elif i[1] == "AC":
      cr += 1
      pn += temp_pn[a-1]
      plbnum = a
print(cr, pn)

N, M = list(map(int, input().split()))
lst = [input().split() for lst in range(M)]
pn = 0
lst_pn = []
lst_cr = []
for _ in range(N):
  lst_pn.append(0)
  lst_cr.append(0)
cr = 0
for i in lst:
  a = int(i[0])
  if lst_cr[a-1] == 1:
    continue
  elif i[1] == "WA":
    lst_pn[a-1] += 1
  elif i[1] == "AC":
    cr += 1
    lst_cr[a-1] += 1
    pn += lst_pn[a-1]
print(cr, pn)

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

n,m=[int(i) for i in input().split()]
ac=[0]*n
wa=[0]*n
for i in range(m):
    p,s=input().split()
    p=int(p)-1
    if s=="AC":
        if check[p]==0:
            check[p]=1
    else:
        if check[p]==0:
            wa[p]+=1
    
for i in range(n):
    wa[i]=wa[i]*ac[i]
print(sum(check),wa)

n,m=[int(i) for i in input().split()]
ac=[0]*n
wa=[0]*n
for i in range(m):
    p,s=input().split()
    p=int(p)-1
    if s=="AC":
        if ac[p]==0:
            ac[p]=1
    else:
        if ac[p]==0:
            wa[p]+=1
    
for i in range(n):
    wa[i]=wa[i]*ac[i]
print(sum(ac),sum(wa))

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())
ps=list(list(input().split()) for _ in range(m))

wal=[0]*n
acl=[0]*n

for p,s in ps:
    p=int(p)-1
    if s=='AC' and acl[p] ==0:
        acl[p]+=1
    elif s=='WA' and acl[p] ==0:
        wal[p]+=1
print(acl)
print(wal)
wa=0
for i,ac in enumerate(acl):
    if ac == 1:
        wa+=wal[i]    
    
print(sum(acl),wa)

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

print(sum(acl),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):
#!/usr/bin/env python3

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

flag = [0 for _ in range(n)]
wa_num_list = [0 for _ in range(n)]

for i in range(m):
    p, s = list(map(str, input().split()))
    p = int(p)
    if flag[p-1] == 0:
        if s == "WA":
            wa_num_list[p-1] += 1
        else:
            flag[p-1] = 1

pen = 0
for i in range(m):
    if flag[i] == 1:
        pen += wa_num_list[i]

print(sum(flag), pen)


#!/usr/bin/env python3

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

flag = [0 for _ in range(n)]
wa_num_list = [0 for _ in range(n)]

for i in range(m):
    p, s = list(map(str, input().split()))
    p = int(p)
    if flag[p-1] == 0:
        if s == "WA":
            wa_num_list[p-1] += 1
        else:
            flag[p-1] = 1

pen = 0
for i in range(n):
    if flag[i] == 1:
        pen += wa_num_list[i]

print(sum(flag), pen)


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 = [0]*m 
for i in range(m):
    p[i] = input().split()
for i in range(m):
    p[i][0]=int(p[i][0])
AC=[]
WA=0
for i in range(m):
    if p[i][1]=="AC" and p[i][0] not in AC:
        AC.append(p[i][0])
    elif s[i]=="WA" and p[i][0] not in AC and [p[i][0],"AC"] in p:
        WA=WA+1
print(len(AC),WA)

n,m = map(int, input().split())
p = [0] * m
s = [0] * m
for i in range(m):
    p[i], s[i] = map(int, input().split())
AC=[]
AC1=[]
WA=0
for i in range(m):
    if s[i]=="AC" and p[i] not in AC:
        AC.append(p[i])
        AC1.append(i)
for i in range(m):
    if s[i]=="WA" and p[i] in AC:
        if AC1[AC.index(p[i])]>i:
            WA=WA+1
print(len(AC),WA)

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

for i in range(m):
    p[i] = input().split()
AC=[[0,-1] for j in range(n)]
k=0
WA=0
for i in range(m):
    if p[i][1]=="AC" and AC[int(p[i][0])-1][0]==0 :
        AC[int(p[i][0])-1][0]=1
        AC[int(p[i][0])-1][1]=i
        k=k+1
for i in range(m):
    if p[i][1]=="WA" and AC[int(p[i][0])-1][0]==1 and AC[int(p[i][0])-1][1]>i:
        WA=WA+1

print(k,WA)

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

n, m = map(int, input().split())
l = [[0,0] for i in range(n)]
for i in range(m):
    p, m = input().split()
    if l[int(p)-1][0] == 0:
        if m == 'WA':
            l[int(p)-1][1] = l[int(p)-1][1] + 1
        else:
            l[int(p)-1][0] = 1
ac = 0
wa = 0
for i in range(n):
    if l[i][0] == 1:
        ac = ac + 1
        wa = wa + l[i][1]
print(str(ac) + ' ' + str(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_list = [0] * n
wa_list = [0] * n
for _ in range(m):
    p, s = input().split()
    p = int(p) - 1
    if s == "AC":
        ac_list[p] = 1
    if s == "WA":
        if ac_list[p] == 0:
            wa_list[p] += 1
for k in range(m):
    if ac_list[k] == 0:
        wa_list[k] = 0
print(sum(ac_list), sum(wa_list))

n, m = list(map(int, input().split()))
ac_list = [0] * n
wa_list = [0] * n
for _ in range(m):
    p, s = input().split()
    p = int(p) - 1
    if s == "AC":
        ac_list[p] = 1
    if s == "WA":
        if ac_list[p] == 0:
            wa_list[p] += 1
for k in range(n):
    if ac_list[k] == 0:
        wa_list[k] = 0
print(sum(ac_list), sum(wa_list))

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
import time
import math
import itertools as it
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()
# ------------------------------

N, M = inpl()
dp = [False] * (N+10)
ac = 0
wa = 0
for _ in range(M):
    p, S = input().split()
    p = int(p)
    if S == 'WA':
        if !dp[p]:
            wa += 1
    else:
        if !dp[p]:
            ac += 1
            dp[p] = True
print(ac, wa)


# ------------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)


import sys
import time
import math
import itertools as it
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()
# ------------------------------

N, M = inpl()
ac = [False] * (N+10)
wa = [0] * (N+10)

a = 0
w = 0
for _ in range(M):
    p, S = input().split()
    p = int(p)
    if S == 'WA':
        if not ac[p]:
            wa[p] += 1
    else:
        if not ac[p]:
            ac[p] = True
            a += 1
            w += wa[p]

print(a, w)

# ------------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)


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())
ans_ac = 0
ans_wa = 0
dic = {}
for i in range(1, n):
  dic[i] = [False, 0]

for i in range(m):
  p, s = input().split()
  if dic[int(p)][0]:
    continue
  if s == 'WA':
    dic[int(p)][1] += 1
  else:
    ans_ac += 1
    ans_wa += dic[int(p)][1]
    dic[int(p)][0] = True
    
print(ans_ac, ans_wa)


n, m = map(int, input().split())
ans_ac = 0
ans_wa = 0
lst = [[False, 0]] * n
for i in range(m):
  p, s = input().split()
  p = int(p)
  if lst[p-1][0]:
    continue
  if s == 'WA':
    lst[p-1][1] += 1
  else:
    ans_ac += 1
    ans_wa += lst[p-1][1]
    lst[p-1][0] = True
print(ans_ac, ans_wa)


n, m = map(int, input().split())
ans_ac = 0
ans_wa = 0
lst = []
for i in range(n):
  lst.append([False, 0])
for i in range(m):
  p, s = input().split()
  p = int(p) - 1
  if lst[p][0]:
    continue
  if s == 'WA':
    lst[p][1] += 1
  else:
    ans_ac += 1
    ans_wa += lst[p][1]
    lst[p][0] = True
print(ans_ac, ans_wa)

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,s = ["0"]*m,["WJ"]*m
for i in range(0,m):
    p[i],s[i] = input().split()
p = [int(s) for s in p]
PN_count = [0]*(n)
AC_count = [0]*(n)
for i in range(len(s)):
    if(s[i] == "AC"):
        AC_count[p[i]-1] = 1
    else:
        if(AC_count[p[i]-1] != 0):
            PN_count[p[i]-1] += 1
print(sum(AC_count),sum(PN_count))

n,m = map(int,input().split())
p,s = ["0"]*m,["WJ"]*m
for i in range(0,m-1):
    p[i],s[i] = input().split()
p = [int(s) for s in p]
PN_count = [0]*(n+1)
AC_count = [0]*(n+1)
for i in range(m):
    if(s[i] == "AC"):
        AC_count[p[i]-1] = 1
    else:
        if(AC_count[p[i]-1] == 0):
            PN_count[p[i]-1] += 1
print(sum(AC_count),sum(PN_count))

n,m = map(int,input().split())
p = [0]*m
s = [""]*m
for i in range(m):
  p[i],s[i] = input().split()
  
p = [int(j) for j in p]

u = [[0 for i in range(2)]for j in range(n)]

for k in range(0,m):
  if(s[k] == "WA" and u[p[k]-1][1] == 0):
    u[p[k]-1][0] += 1
  elif(s[k] == "AC"):
    u[p[k]-1][1] = 1

ans = 0
ac = 0
for i in range(n):
  if(u[i][1] == 1):
    ac += 1
    ans += u[i][0]
print(ac,ans)

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())
l1 = [0]*n
l2 = [0]*n
for i in range(m):
        p,s=map(str,input().split())
        p= int(p)
        if s == 'AC':
                if l2[p-1] == 0:
                        l2[p-1] +=1
                else:
                        pass 
        else:
                if l2[p-1] == 0:
                        l1[p-1] +=1
                else:
                        pass
for i in range(n):
        if l2[i] == 0:
                l1[i] == 0:
                
print(sum(l2),sum(l1))

n,m=map(int,input().split())
l1 = [0]*n
l2 = [0]*n
for i in range(m):
        p,s=map(str,input().split())
        p= int(p)
        if s == 'AC':
                l2[p-1] +=1
        else:
                if l2[p-1] == 0:
                        l1[p-1] +=1
cntac = 0
cntwa = 0
for i in range(n):
        if l2[i] != 0:
                cntac +=1
                cntwa += l1[i]

                
                
print(cntac,cntwa)

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 operator import mul
from functools import reduce
def cmb(n,r):
    r=min(n-r,r)
    if r==0: return 1
    over=reduce(mul, range(n,n-r,-1))
    under=reduce(mul, range(1,r+1))
    return over//under
n,k=map(int,input().split())
A=sorted(list(map(int,input().split())))
s=0
c=int(cmb(n-1,k-1))
for i in range(n-k+1):
  s+=(A[n-1-i]-A[i])*c
  s%=10**9+7
  c=c*(n-k-i)//(n-1-i)
print(s)

n,m=map(int,input().split())
if m == 0:
  print(0,0)
  exit()
A=[[0,0] for _ in range(n)]
for i in range(m):
  p,s=input().split()
  p=int(p)-1
  if A[p][0]==1:
    continue
  elif s=='AC':
    A[p][0]=1
  else:
  	A[p][1]+=1
ac=0
wa=0
for a in A:
  ac+=a[0]
  wa+=a[1] if a[0]==1 else 0
print(A)
print(ac,wa)

n,m=map(int,input().split())
if m == 0:
  print(0,0)
  exit()
A=[[0,0] for _ in range(n)]
for i in range(m):
  p,s=input().split()
  p=int(p)-1
  if A[p][0]==1:
    continue
  elif s=='AC':
    A[p][0]=1
  else:
  	A[p][1]+=1
ac=0
wa=0
for a in A:
  ac+=a[0]
  if a[0] == 1:wa+=a[1]
print(ac,wa)

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())
test = list(map(list, set(map(tuple, [input().split() for i in range(m)]))))
count = 0
for i in test:
  if(i[1] == 'WA'):
    count += 1

print(len(test), count)


n, m = map(int, input().split())
test = list(map(list, set(map(tuple, [input().split() for i in range(m)]))))
count = 0
for i in test:
  if(i[1] == 'WA'):
    count += 1

print(len(test), count)


n, m = map(int, input().split())
list_num = list([] for i in range(n))
test = [input().split() for i in range(m)]
for i in test:
  list_num[int(i[0]) - 1].append(i[1])
count = 0
count_ac = 0
count_wa = 0
check = 0
for i in list_num:
  for j in range(len(i)):
    if(i[j] =='WA'):
      count += 1
    elif(i[j] == 'AC'):
      count_ac += 1
      check = 1
      break
  if(check == 1):
    count_wa += count
    check = 0 
  count = 0
print(count_ac , count_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 = input().split()
n = int(n)
m = int(m)
results = []
for i in range(m):
    results.append(list(input().split()))

wa = 0
ac = 0

dic = {}
for q, a in results:
    if q not in dic.keys():
        dic[q] = {"ac": False, "wa": 0}
    if dic[q]["ac"] is False and a == "WA":
        wa += 1
    elif dic[q]["ac"] is False and a == "AC":
        ac += 1
        dic[q]["ac"] = True
    elif dic[q]["ac"] is True:
        pass
    print(dic, ac, wa)

print(ac, wa)

n, m = input().split()
n = int(n)
m = int(m)
results = []
for i in range(m):
    results.append(list(input().split()))

wa = 0
ac = 0

dic = {}
for q, a in results:
    if q not in dic.keys():
        dic[q] = {"ac": False, "wa": 0}
    if dic[q]["ac"] is True:
        pass
    elif dic[q]["ac"] is False and a == "WA":
        dic[q]["wa"] += 1
    elif dic[q]["ac"] is False and a == "AC":
        ac += 1
        dic[q]["ac"] = True
for x in dic.keys():
    if dic[x]["ac"] is True:
        wa += dic[x]["wa"]

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())
ac = [0 for _ in range(n)]
pen = [0 for _ in range(n)]

for _ in range(m):
  p, s = input().split()
  p = int(p) - 1
  if s == 'WA':
    if ac[p] == 0:
      pen[p] += 1
  else:
    ac[p] = 1

for p in range(m):
  if ac[p] == 0:
    pen[p] = 0
print(str(sum(ac)) + ' ' + str(sum(pen)))

n, m = map(int, input().split())
ac = [0 for _ in range(n)]
pen = [0 for _ in range(n)]

for _ in range(m):
  p, s = input().split()
  p = int(p) - 1
  if s == 'WA':
    if ac[p] == 0:
      pen[p] += 1
  else:
    ac[p] = 1

for p in range(n):
  if ac[p] == 0:
    pen[p] = 0
print(str(sum(ac)) + ' ' + str(sum(pen)))

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())
ps = [0] * m
p = [0] * m
s = [0] * m
for i in range(m):
    ps[i] = list(map(str,input().split()))
if m = 0:
    print(0,0)
    exit()
cp=int(ps[0][0])
countA = [0] * n
countW = 0
cn = 0
for item in ps:
    if item[1] == 'AC':
        countA[int(item[0])-1] = 1
        countW += cn
        cp += 1
        cn = 0
    else:
        cn+=1
print(sum(countA),countW)

n,m = map(int,input().split())
ps = [0] * m
for i in range(m):
    ps[i] = list(map(str,input().split()))
if m == 0:
    print(0,0)
    exit()
countA = [0] * n
countW = [0] * n
cn = 0
for item in ps:
    if item[1] == 'AC' and countA[int(item[0])-1] == 0:
        countA[int(item[0])-1] = 1
        cn += countW[int(item[0])-1]
    else:
        countW[int(item[0])-1] += 1
print(sum(countA),cn)

Verdicts: Runtime Error

Accepted