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):
x, y = map(int, input().split())
li = []
k = 0 
for _ in range(y):
    a, b = map(str, input().split())
    if b == 'AC':
        if a in li:
            continue
        else:
            li.append(a)
    elif b == 'WA':
        if a in li:
            continue
        else:
            k += 1
s = 0
for _ in dd:
    s += 1
            
print(s, k)

x, y = map(int, input().split())
dd = {}
c = 0 
p = 0 
for i in range(x):
    dd[i+1] = 0
for _ in range(y):
    a, b = map(str, input().split())
    a = int(a)
    if b == 'WA':
        if dd[a] == 'o':
            continue
        else:
            dd[a] += 1
    else:
        if dd[a] == 'o':
            continue
        else:
            c += dd[a]
            p += 1
            dd[a] = 'o'
            
print(p, c)

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


n,m = map(int,input().split())
wa = [0]*n
ac = [False]*n
for i in range(m):
    p,s = map(str,input().split())
    if s == "AC":
        ac[int(p)-1] = True
    else:
        if not ac[int(p)-1]:
            wa[int(p)-1] += 1
ac_num = 0
wa_num = 0
for i in range(n):
    if ac[i]:
        ac_num += 1
        wa_num += wa[i]
print(ac_num, wa_num)



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())
P = []
S = []
count = [0]*N
AC = 0
WA = 0
for _ in range(M):
    p, s = input().split()
    if s == "WA":
        WA += 1
    elif count[int(p)-1] == 0 and s == "AC":
        AC += 1
        count[int(p)-1] = 1
print(AC, WA)

N, M = map(int, input().split())
count = [0]*N
ans = 0
ok = 1
for _ in range(M):
    p, s = input().split()
    if count[int(p)-1] >= 0 and s == "WA":
        count[int(p) - 1] += 1
    elif count[int(p)-1] >= 0 and s == "AC":
        ans += count[int(p)-1]
        count[int(p)-1] = -1
        ok += 1
print(ok, ans)

N, M = map(int, input().split())
count = [0]*N
ans = 0
ok = 0
for _ in range(M):
    p, s = input().split()
    if count[int(p)-1] >= 0 and s == "WA":
        count[int(p) - 1] += 1
    elif count[int(p)-1] >= 0 and s == "AC":
        ans += count[int(p)-1]
        count[int(p)-1] = -1
        ok += 1
print(ok, 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):
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, M = lr()
problems = [False] * N
AC = [0] * N
WA = [0] * N
for _ in range(M):
    p, S = sr().split(); p = int(p) - 1
    if not problems[p] and S == 'WA':
        WA[p] += 1
    if not problems[p] and S == 'AC':
        problems[p] = True
        AC += 1

AC_total = sum(AC)
WA_total = sum(y for x, y in zip(AC, WA) if x)
print(AC_total, WA_total)


import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, M = lr()
problems = [False] * N
AC = [0] * N
WA = [0] * N
for _ in range(M):
    p, S = sr().split(); p = int(p) - 1
    if not problems[p] and S == 'WA':
        WA[p] += 1
    if not problems[p] and S == 'AC':
        problems[p] = True
        AC[p] += 1

AC_total = sum(AC)
WA_total = sum(y for x, y in zip(AC, WA) if x)
print(AC_total, WA_total)


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

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

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

ac_chk = [0]*(N+1)
wa_chk = [0]*(N+1)
wa = 0
ac = 0

for i in range(M):
	p, S = input().split()
	p = int(p)
	if ac_chk[p] == 0:
		if S == "AC":
			ac_chk[p] = 1
			ac += 1
			wa += wa_chk[p]
			continue
		if S == "WA":
			wa_chk[p] += 1
			continue
	else:
		continue
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())
lists = [list(map(str, input().split())) for i in range(M)]

dict_ac = {}
dict_wa = {}
number = True

for i, j in lists:
    if j == "WA":
        if number:
            if i not in dict_wa.keys():
                dict_wa[i] = 1
                number = False
            else:
                continue
        elif i in dict_wa.keys():
            dict_wa[i] += 1
        else:
            continue
    elif j == "AC":
        if i not in dict_ac.keys():
            dict_ac[i] = 1
            number = True
        else:
            dict_ac[i] = 1
            number = True
    else:
        continue




for i in dict_ac.keys():
    for j in dict_wa.keys():
        if i == j:
            continue
        else:
            dict_wa[j] = 0




print(sum(dict_ac.values()), sum(dict_wa.values()))

N, M = map(int, input().split())
lists = [list(map(str, input().split())) for i in range(M)]
# print(lists)

dict_ac = {i:0 for i in range(N)}
dict_wa = {i:0 for i in range(N)}
# print(dict_ac)
# print(dict_wa)
number = True
index = 0
for i, j in lists:

    if j == "WA":
        i = int(i) - 1
        if dict_ac[i] == 0:
            dict_wa[i] += 1

    elif j == "AC":
        if i not in dict_ac.keys():
            i = int(i) - 1
            dict_ac[i] = 1






for i in dict_wa.keys():
    if dict_ac[i] == 0:
        dict_wa[i] = 0
    else:
        continue




print(sum(dict_ac.values()), sum(dict_wa.values()))

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())
p = []
s = []
for i in range(m):
    P,S = map(str,input().split())
    p.append(int(P))
    s.append(S)
Bool = [0 for i in range(n)]
count = [0 for i in range(n)]

for i in range(m):
    if not Bool[p[i]-1]:
        if s[i] == "WA":
            count[p[i]-1] += 1
        else:
            Bool[p[i]-1] = 1
ans = 0
for i in range(m):
    if Bool[p[i]-1]:
        ans += count[p[i]-1]

print(sum(Bool),ans)

n,m = map(int,input().split())
p = []
s = []
for i in range(m):
    P,S = map(str,input().split())
    p.append(int(P))
    s.append(S)
Bool = [0 for i in range(n)]
count = [0 for i in range(n)]

for i in range(m):
    if not Bool[p[i]-1]:
        if s[i] == "WA":
            count[p[i]-1] += 1
        else:
            Bool[p[i]-1] = 1
ans = 0
for i in range(n):
    if Bool[i]:
        ans += count[i]

print(sum(Bool),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):
lst = []
n, m  = map(int, input().split())
for _ in range(m):
    i, h = input().split()
    lst.append([int(i), str(h)])

jdg_wa = [0] * n 
jdg_ac = [0] * n

for _ in lst:
    if _[1] == 'WA' and jdg_ac[_[0]] == 0:
        jdg_wa[_[0]] += 1
    if _[1] == 'AC' and jdg_ac[_[0]] == 0:
        jdg_ac[_[0]] = 1

print(sum(jdg_ac),sum(jdg_wa))

lst = []
n, m  = map(int, input().split())
for _ in range(m):
    i, h = input().split()
    lst.append([int(i), str(h)])

jdg_wa = [0] * n 
jdg_ac = [0] * n

for _ in lst:
    idx = _[0] - 1
    if _[1] == 'WA' and jdg_ac[idx] != 1:
        jdg_wa[idx] += 1
    elif _[1] == 'AC':
        jdg_ac[idx] = 1
        penalty += jdg_wa[idx]
        
print(sum(jdg_ac),penalty)

lst = []
n, m  = map(int, input().split())
for _ in range(m):
    i, h = input().split()
    lst.append([int(i), str(h)])

jdg_wa = [0] * n 
jdg_ac = [0] * n

penalty = 0
for _ in lst:
    idx = _[0] - 1
    if  jdg_ac[idx] != 1:
        if _[1] == 'WA':
            jdg_wa[idx] += 1
        elif _[1] == 'AC':
            jdg_ac[idx] = 1
            penalty +=  jdg_wa[idx]
print(sum(jdg_ac), penalty)


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

ac_list = []
wa_dict = {}
num_wa = 0

for ps in ps_list:
    p = int(ps[0])
    s = ps[1]
    
    if s == 'AC':
        ac_list.append(p)
        num_wa += wa_dict[p]
    elif p not in ac_list:
        if p not in wa_dict.keys():
            wa_dict[p] = 1
        else:
            wa_dict[p] += 1
         
print(num_ac, num_wa)

n, m = map(int, input().split())
ps_list = [[i for i in input().split()] for j in range(m)]

ac_list = []
wa_list = [0 for i in range(n)]
num_wa = 0
num_ac = 0

for ps in ps_list:
    p = int(ps[0])
    s = ps[1]
    
    if s == 'AC' and wa_list[p-1] != -1:
        ac_list.append(p)
        num_wa += wa_list[p-1]
        num_ac += 1
        wa_list[p-1] = -1
    elif wa_list[p-1] != -1:
        wa_list[p-1] += 1
        
print(num_ac, num_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())

l=[0 for i in range(n)]
w=0
ww=0
a=0
t=""
for i in range(m):
    p,s=input().split()
    if(l[int(p)-1]==1):continue
    if(t!=p):ww=0
    if(s=="WA"):
        ww+=1
    if(s=="AC"):
        w+=0
        a+=1
        l[int(p)-1]=1
    t=p
print(a,w-ww)

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

l=[0 for i in range(n)]
t=""
w=0
ww=0
a=0
for i in range(m):
    p,s=input().split()
    if(l[int(p)-1]==1):continue
    if(s=="WA"):
        w+=1
        ww+=1
    if(s=="AC"):
        ww=0
        a+=1
        l[int(p-1)]=1
print(a,w-ww)

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

l=[0 for i in range(n)]
ll=[0 for i in range(n)]
w=0
a=0
for i in range(m):
    p,s=input().split()
    if(l[int(p)-1]==1):continue
    if(s=="WA"):ll[int(p)-1]+=1
    if(s=="AC"):
        l[int(p)-1]=1
        w+=ll[int(p)-1]
        a+=1
print(a,w)

Verdicts: Wrong Answer

Runtime Error

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

Submission attempts (in order):
n,m = map(int,input().split())
x=['0']*m
y=['0']*m
for i in range(m):
    x[i],y[i] = map(str,input().split())

num = 0
pena = 0

lis=[0]*(n+1)
lis2=[0]*n
lis3=[0]*n
sw = [0]*n

for i in range(m):
    if y[i] == 'WA' and sw[int(x[i])]== 0:
        lis[int(x[i])] += 1
    else:
        lis2[int(x[i])] = 1
        sw[int(x[i])] = 1
        
pena = sum(lis)
num = sum(lis2)

print(num,pena)

n,m = map(int,input().split()) 
x=['0']*m 
y=['0']*m 
for i in range(m): 
    x[i],y[i] = map(str,input().split())

num = 0 
pena = 0

lis=[0]*n 
sw = [0]*n

for i in range(m): 
    if y[i] == 'WA':
        lis[int(x[i])-1] += 1
    else:
        if sw[int(x[i])-1] == 0:
            num += 1
            pena = pena + lis[int(x[i])-1]
            sw[int(x[i])-1] = 1

        else:
            pass
        
print(num,pena)

Verdicts: Runtime Error

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

Submission attempts (in order):
N, M = map(int, input().split())
t_ans = []
for _ in range(M):
  t_ans.append(list(map(str,input().split())))

ans_num = [0]*(N+1)
ans_pe = [0]*(N+1)

for i in range(M):
  result = t_ans[i][1]
  question = int(t_ans[i][0])
  print(question)
  if result == 'AC' and ans_num[question] == 0:
    ans_num[question] = 1
  elif result == 'WA' and ans_num[question] == 0:
    ans_pe[question] += 1
  
for i in range(N):
  if ans_num[i] != 1:
    ans_pe[i] = 0

print(f'{sum(ans_num)} {sum(ans_pe)}')

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

ans_num = [0]*(N+1)
ans_pe = [0]*(N+1)

for i in range(M):
  result = t_ans[i][1]
  question = int(t_ans[i][0])
  if result == 'AC' and ans_num[question] == 0:
    ans_num[question] = 1
  elif result == 'WA' and ans_num[question] == 0:
    ans_pe[question] += 1

for i in range(N+1):
  if ans_num[i] != 1:
    ans_pe[i] = 0

print(f'{sum(ans_num)} {sum(ans_pe)}')

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 = map(int,input().split())
if M == 0:
    print('%d %d' % (0,0))
    sys.exit(0)
Liste = dict()
Question = [0] * M
ACorWE = [0] * M
Z = 0
correct = 0
pena = 0
for i in range(M):
    Question[i], ACorWE[i]= map(str, input().split())
Question = [int(element) for element in Question]
for _ in range(max((max(Question)+1),len(ACorWE))): #range(max(Question)+1) before
    Liste[_] = [0] 
#Liste[4].append(0) 
#print(Liste)
#print(Question) #[1, 1, 2, 2, 2]
#print(ACorWE) #['WA', 'AC', 'WA', 'AC', 'WA']
for i in range(M): 
    Liste[Question[i]].append(ACorWE[i])
    #print(Liste)
    Liste[i].remove(0)
#print(Liste)
#{0: [], 1: ['WA', 'AC'], 2: ['WA', 'AC', 'WA'], 3: [], 4: []}

for i in range(1,len(Liste)): #range(1,max(Question)+1) before
    if 'AC' in Liste[i] and Z == 0:
        correct += 1
        Z = 1
    Z = 0
for i in range(1,len(Liste)): #range(1,max(Question)+1) before
    for j in range(len(Liste[i])):
        if j <= len(Liste[i]) -2:
            if Liste[i][j] == 'WA' and Liste[i][j+1] == 'AC' and　(i == max(Question)):
                pena += 1
                print('%d %d' % (correct,pena))
                sys.exit(0)
            elif Liste[i][j] == 'WA' and Liste[i][j+1] == 'AC':
                pena += 1
                break
            elif Liste[i][j] == 'WA' and Liste[i][j+1] == 'WA':
                pena += 1

print('%d %d' % (correct,pena))

import sys
N,M = map(int,input().split())
if M == 0:
    print('%d %d' % (0,0))
    sys.exit(0)
Liste = dict()
Question = [0] * M
ACorWE = [0] * M
correct = 0
penalty = 0
for i in range(M):
    Question[i], ACorWE[i]= map(str, input().split())
Question = [int(element) for element in Question]
for _ in Question:
    Liste[_] = [0] 
for i in range(M):
    Liste[Question[i]].append(ACorWE[i])
for liste in Liste:
    while 0 in Liste[liste]:
        Liste[liste].remove(0)
AC = []
for key in Liste:
    if 'AC' in Liste[key]:
        correct += 1
        AC.append(key)
j = 0
for key in AC:
    while Liste[key][j] != 'AC' and j<len(Liste[key]):
        penalty += 1
        j += 1 
    j = 0         
print('%d %d' % (correct,penalty))

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
n,m = map(int,input().split())
p = [list(map(str,input().split())) for _ in range(m)]
box = []
acnt,wcnt,tmp = 0,0,0
if m == 0:
	print(0,0)
	sys.exit()
inx = 0
for i in range(m):
	if p[i][0] != inx
		if p[i][1] == 'AC':
				inx =p[i][0]
				acnt += 1
				wcnt += tmp
				tmp = 0
		else:
			tmp += 1
print(acnt,wcnt)

import sys
n,m = map(int,input().split())
p = [list(map(str,input().split())) for _ in range(m)]
p.sort(key=lambda x:x[0])
acnt,wcnt,tmp = 0,0,0
if m == 0:
	print(0,0)
	sys.exit()
inx = '0'
for i in range(m):
	if p[i][0] != inx:
		if p[i][1] == 'AC':
				inx = p[i][0]
				acnt += 1
				wcnt += tmp
				tmp = 0
				print(inx)
				
		else:
			tmp += 1
print(acnt,wcnt)

n,m = map(int,input().split())
p = [list(map(str,input().split())) for _ in range(m)]

ac =[0]*(n+1)
wa =[0]*(n+1)
for i in range(m):
    question =int(p[i][0])
    
    if p[i][1] == "AC" and ac[question] == 0:
        ac[question] = 1
     
    elif p[i][1] == "WA" and ac[question] == 0:
        wa[question] += 1
for j in range(n+1):
  
    if ac[j] == 0:
        wa[j] = 0
       # print(wa)
print(sum(ac),sum(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())
ac_list = [False]*(n+1)
pena_count = [0]*(n+1)
for i in range(m):
  p, s = map(int, input().split())
  if not ac_list[p]:
    if s == "AC":
      ac_list[p] = True
    else:
      pena_count[p] += 1
ac_count = 0
pena_c = 0
for i in range(1, n+1):
  if ac_list[i]:
    ac_count += 1
    pena_c += pena_count[i]
print(ac_count, pena_c)
      

n,m = map(int, input().split())
ac_list = [False]*(n+1)
pena_count = [0]*(n+1)
for i in range(m):
  p, s = input().split()
  p = int(p)
  if not ac_list[p]:
    if s == "AC":
      ac_list[p] = True
    else:
      pena_count[p] += 1
ac_count = 0
pena_c = 0
for i in range(1, n+1):
  if ac_list[i]:
    ac_count += 1
    pena_c += pena_count[i]
print(ac_count, pena_c)
      


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())
AC = np.zeros(N)
WA = np.zeros(N)

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

  if s == 'WA' and AC[int(p) - 1] == 0:
    WA[int(p) - 1] += 1
  else:
    AC[int(p) - 1] = 1

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

import numpy as np

N, M = map(int, input().split())
AC = np.zeros(N, dtype = int)
WA = np.zeros(N, dtype = int)

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

  if s == 'WA' and AC[int(p) - 1] == 0:
    WA[int(p) - 1] += 1
  else:
    AC[int(p) - 1] = 1

print(sum(AC), sum(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())
dicts = {key: [False,0] for key in range(1, n+1)}
for i in range(m):
    p, s = input().split()
    p = int(p)
    if s == "AC":
        dicts[p][0] = True
        continue
    else:
        if dicts[p][0]==True:
            continue
        else:
            dicts[p][1] += 1
print(dicts)
ans_list = [v[1] for k, v in dicts.items() if v[0]==True]
ans_n = len(ans_list)
penal = sum(ans_list)
print(ans_n,penal)

n,m=map(int,input().split())
dicts = {key: [False,0] for key in range(1, n+1)}
for i in range(m):
    p, s = input().split()
    p = int(p)
    if s == "AC":
        dicts[p][0] = True
        continue
    else:
        if dicts[p][0]==True:
            continue
        else:
            dicts[p][1] += 1
ans_list = [v[1] for k, v in dicts.items() if v[0]==True]
ans_n = len(ans_list)
penal = sum(ans_list)
print(ans_n,penal)

Verdicts: Wrong Answer

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

Submission attempts (in order):
from collections import defaultdict as dic
n, m = map(int, input().split())
ac = 0
pena = 0
d = dic(list)
for i in range(m):
    pi, si = input().split()
    d[pi].append(si)


print(d)
for (k, v) in d.items():
    pe = 0
    flag = False
    for aw in v:
        if aw == 'WA':
            pe += 1
        else:
            ac += 1
            flag = True
            break

    if flag:
        pena += pe

print(ac, pena)


# -*- coding: utf-8 -*-
n, m = map(int, input().split())
ck = set()
pe = 0
ac = 0
penalty = 0
cp = [0] * (n+1)
for i in range(m):
    p, s = input().split()
    p = int(p)
    if p in ck:
        continue

    if s == 'WA':
        cp[p] += 1
    else:
        penalty += cp[p]
        pe = 0
        ac += 1
        ck.add(p)

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


ac = 0
wa = 0
aclist = {}
walist = {}

count_WA=0
for i in range(n):
    aclist[i + 1] = 0
    walist[i + 1] = 0

for i in range(M):
    a,b=input().split()
    a=int(a)
    if aclist[a] == 1:
        continue
    elif b == 'WA':
        walist[a] += 1
    elif b == 'AC':
        aclist[a] += 1
        ac += 1
        wa += walist[a]




print(ac,wa,sep=" ")


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


ac = 0
wa = 0
aclist = {}
walist = {}

count_WA=0
for i in range(N):
    aclist[i + 1] = 0
    walist[i + 1] = 0

for i in range(M):
    a,b=input().split()
    a=int(a)
    if aclist[a] == 1:
        continue
    elif b == 'WA':
        walist[a] += 1
    elif b == 'AC':
        aclist[a] += 1
        ac += 1
        wa += walist[a]




print(ac,wa,sep=" ")


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):
    te, mp = input().split()
    p.append(te), s.append(mp)

acdic = []
ans = 0
for i in range(m):
    if p[i] not in acdic:
        if s[i] == 'WA':
            ans += 1
        else:
            acdic.append(p[i])

print(ans)


n, m = map(int, input().split())
p, s = [], []
acdic = []
ans, tmp = 0, 0
for i in range(m):
    te, mp = input().split()
    p.append(te), s.append(mp)
    if p[i] not in acdic:
        if s[i] == 'WA':
            tmp += 1
        else:
            acdic.append(p[i])  
            ans += tmp  

print(len(acdic), ans)


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

ac_check = [False for i in range(n)]
wa_count = [0 for i in range(n)]

clear = 0
error = 0
for i in range(m):
    p, s = input().split()
    p = int(p) - 1

    if s == 'AC' and ac_check[p] == False:
        ac_check[p] = True
        error += wa_count[p]
    elif s == 'WA' and ac_check[p] == False:
        wa_count[p] += 1

for i in range(n):
    if ac_check[i]:
        clear += 1

print(clear, error)


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())
L = [0]*n
AC = 0
WA = 0
tmp = [0]*n
for i in range(m):
	x,y = input().split()
	x = int(x)
	if L[x-1] == 0:
		if y == "WA":
			tmp[x-1] += 1
		else:
			AC += 1
			WA += tmp[x-1]
			L[x-1]=1
print(A,W)


n,m = map(int,input().split())
L = [0]*n
AC = 0
WA = 0
tmp = [0]*n
for i in range(m):
	x,y = input().split()
	x = int(x)
	if L[x-1] == 0:
		if y == "WA":
			tmp[x-1] += 1
		else:
			AC += 1
			WA += tmp[x-1]
			L[x-1]=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 sys
input = sys.stdin.readline

N,M = map(int, input().split())
X = list(input().split() for i in range(M))
X=[['1', 'AC'], ['2', 'AC']]
p=0
c=0

for i in range(N):
    L = [x[1] for x in X if x[0] == str(i+1)]
    if "AC" in L:
        c += 1
    for l in L:
        if l == "WA":
            p += 1
        else:
            break

print(c,p)

import sys
input = sys.stdin.readline

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

penalty=[0]*N
correct=[False]*N

for i in range(M):

    p,s = input().split()
    p = int(p)

    if s=="AC":
        correct[p-1]=True

    else:
        if correct[p-1]==False:
            penalty[p-1] += 1

for i in range(N):
    if correct[i]==False:
        penalty[i]=0

print(sum(i == True for i in correct),sum(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):
from functools import reduce
N, M = list(map(int, input().split()))
ps_list = [input().split() for _ in range(M)]

result = {}
for row in ps_list:
  if not row[0] in result:
    result[row[0]] = {
        "AC": 0,
        "WA": 0
    }
  if result[row[0]]["AC"] > 0:
    continue
  else:
    result[row[0]][row[1]] = result[row[0]][row[1]] + 1

print(result)
ac = 0
wa = 0
for k,v in result.items():
  ac = ac + v["AC"]
  if v["AC"] = 0:
    continue
  wa = wa + v["WA"]
print(ac, wa)

from functools import reduce
N, M = list(map(int, input().split()))
ps_list = [input().split() for _ in range(M)]

result = {}
for row in ps_list:
  if not row[0] in result:
    result[row[0]] = {
        "AC": 0,
        "WA": 0
    }
  if result[row[0]]["AC"] > 0:
    continue
  else:
    result[row[0]][row[1]] = result[row[0]][row[1]] + 1

ac = 0
wa = 0
for k,v in result.items():
  ac = ac + v["AC"]
  if v["AC"] == 0:
    continue
  wa = wa + v["WA"]
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 = map(int, input().split())
ans = 0
Q = [0] * N
wrong = [0] * N
for i in (M):
  p, S = map(str, input().split())
  p = int(p) - 1
  if Q[p] == 0 and S == "AC":
    ans += wrong[p]
    Q[p] = 1
  elif S == "WA":
    wrong[p] += 1
print(ans)

N, M = map(int, input().split())
ans = 0
Q = [0] * N
wrong = [0] * N
for i in range(M):
  p, S = map(str, input().split())
  p = int(p) - 1
  if Q[p] == 0 and S == "AC":
    ans += wrong[p]
    Q[p] = 1
  elif S == "WA":
    wrong[p] += 1
print(ans)

N, M = map(int, input().split())
ans1 = 0
ans2 = 0
Q = [0] * N
wrong = [0] * N
for i in range(M):
  p, S = map(str, input().split())
  p = int(p) - 1
  if Q[p] == 0 and S == "AC":
    ans1 += 1
    ans2 += wrong[p]
    Q[p] = 1
  elif S == "WA":
    wrong[p] += 1
print(ans1,ans2)

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_list = []
s_list = []
ac_list = [0] * (n + 1)
ac, wa = 0, 0
if m == 0:
    print(0, 0)
else:
    for i in range(m):
        p, s = map(str, input().split())
        p = int(p)
        p_list.append(p)
        s_list.append(s)
        if s == "WA":
            if ac_list[p] == 0:
                wa += 1
            else:
                continue
        elif s == "AC":
            if ac_list[p] == 0:
                ac += 1
                ac_list[p] = 1
            else:
                continue
    for i in reversed(s_list):
        if i == "AC":
            break
        else:
            wa -= 1
    print(ac, wa)

n, m = map(int, input().split())
p_list = []
s_list = []
ac_list = [0] * (n + 1)
ac, wa = 0, 0
if m == 0:
    print(0, 0)
else:
    for i in range(m):
        p, s = map(str, input().split())
        p = int(p)
        p_list.append(p)
        s_list.append(s)
        if s == "WA":
            if ac_list[p] == 0:
                wa += 1
            else:
                continue
        elif s == "AC":
            if ac_list[p] == 0:
                ac += 1
                ac_list[p] = 1
            else:
                continue
    for i in reversed(p_list):
        if ac_list[i] == 0:
            wa -= 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())
p = dict()
ans, penalty = 0, 0
for _ in range(M):
  tmp = input()
  if tmp[0] in p:
    continue
  if tmp[1] == 'AC':
    p[tmp[0]] = 1
    ans += 1
  else:
    penalty += 1
print(ans, penalty)

N, M = map(int, input().split())
p = dict()
ac = dict()
ans, penalty = 0, 0
for _ in range(M):
  tmp = input().split()
  if tmp[0] in ac:
    continue
  if tmp[1] == 'AC':
    ans += 1
    ac[tmp[0]] = 1
    penalty += p.get(tmp[0], 0)
  else:
    p[tmp[0]] = p.get(tmp[0], 0) + 1
print(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())
L1=[0]*(N+1) 
L2=[0]*(N+1) 

for i in range(M):
    p,S=input().split()
    if L1[int(p)]==1:
        pass
    else:
        if S=='AC':
            L1[int(p)]=1
        else:
            L2[int(p)]+=1

for j in range (M):
    if L1[j]==0 and L2[j]>0:
        L2[j]=0

print(sum(L1),sum(L2))

N,M=map(int,input().split())
L1=[0]*(N+1) 
L2=[0]*(N+1) 

for i in range(M):
    p,S=input().split()
    if L1[int(p)]==1:
        pass
    else:
        if S=='AC':
            L1[int(p)]=1
        else:
            L2[int(p)]+=1

for j in range (N+1):
    if L1[j]==0 and L2[j]>0:
        L2[j]=0

print(sum(L1),sum(L2))

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 = []
for i in range(m):
    p,s = input().split()
    ps.append([int(p),s])
ps.sort(key=lambda x:x[0])
t = 0
ac = 0
wa = 0
cnt = 0

for res in ps:
    if t != res[0]:
        if res[1] == "WA":
            cnt += 1
        else:
            ac += 1
            wa += cnt
            t = res[0]

print(ac,wa)

n,m = map(int,input().split())
ps = []
for i in range(m):
    p,s = input().split()
    ps.append([int(p),s])
ps.sort(key=lambda x:x[0])
d = {}
t = 0
ac = 0
wa = 0

for res in ps:
    if t != res[0]:
        if res[1] == "WA":
            d[res[0]] = d.get(res[0],0) + 1
        else:
            ac += 1
            wa += d.get(res[0],0)
            t = res[0]

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):
print('reference')

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

ac = [False] * N
wa = [0] * N
for _ in range(M):
    p, S = input().split()
    p = int(p) - 1
    if S == 'AC':
        ac[p] = True
    else:
        if not ac[p]:
            wa[p] += 1

a = 0
b = 0
for i in range(N):
    if ac[i]:
        a += 1
        b += wa[i]
print(*[a, b])

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

rslts = [[] for _ in range(n)]
for i in range(m):
    x, y = input().split()
    rslts[int(x) - 1].append(y)
#print(rslts)

ac, p = 0, 0
for j in range(n):
    seq = rslts[j]
    if 'AC' in seq:
        ac += 1
        for k in seq:
            if k == 'WA':
                p += 1
            else:
                break

print(ac, 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):
# coding: utf-8
import math
N, M = map(int,input().split())
#N = int(input())
#K = int(input())
#S = input()
ans = 0
#l = list(map(int,input().split()))
#A = list(map(int,input().split()))
F = [False] * (N+1)
P = [0] * (N+1)
l = []
for i in range(M):
    p, s = map(str,input().split())
    p = int(p)
    l.append([p, s])
    if s == "WA" and not F[p]:
        P[p] += 1
    if s == "AC" and not F[p]:
        ans += 1
        F[p] = True
pen = 0
#print(l)
for i in range(M):
    p = l[i][0]
    if F[p]:
        pen += P[p]
print(ans, pen)

# coding: utf-8
import math
N, M = map(int,input().split())
#N = int(input())
#K = int(input())
#S = input()
ans = 0
#l = list(map(int,input().split()))
#A = list(map(int,input().split()))
F = [False] * (N+1)
pen = 0
P = [0] * (N+1)
for i in range(M):
    p, s = map(str,input().split())
    p = int(p)
    if s == "WA" and not F[p]:
        P[p] += 1
    if s == "AC" and not F[p]:
        ans += 1
        pen += P[p]
        F[p] = True

print(ans, pen)

Verdicts: Wrong Answer

Accepted