Problem:


Score : 300 points

Problem Statement

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 WAs received before receiving an AC for the first time on that problem.

Find the numbers of Takahashi's correct answers and penalties.

Constraints

N, M, and p_i are integers.

1 \leq N \leq 10^5

0 \leq M \leq 10^5

1 \leq p_i \leq N

S_i is AC or WA.

Input

Input is given from Standard Input in the following format:

N M
p_1 S_1
:
p_M S_M

Output

Print the number of Takahashi's correct answers and the number of Takahashi's penalties.

Sample Input 1

2 5
1 WA
1 AC
2 WA
2 AC
2 WA

Sample Output 1

2 2

In his second submission, he received an AC on the first problem for the first time. Before this, he received one WA on this problem.

In his fourth submission, he received an AC on the second problem for the first time. Before this, he received one WA on this problem.

Thus, he has two correct answers and two penalties.

Sample Input 2

100000 3
7777 AC
7777 AC
7777 AC

Sample Output 2

1 0

Note that it is pointless to get an AC more than once on the same problem.

Sample Input 3

6 0

Sample Output 3

0 0



Sample input:
2 5
1 WA
1 AC
2 WA
2 AC
2 WA


Sample output:
2 2

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
N, M = map(int, input().split())
d = defaultdict(lambda : "WA")
correct = 0
incorrect = 0
A = list()
for _ in range(M):
    p, S = input().split()
    A.append((int(p), S))

for p, S in A[::-1]:
    if S == "WA":
        if d[p] == "AC":
            incorrect += 1
    else:
        if d[p] == "WA":
            correct += 1
            d[p] = "AC"
print(correct, incorrect)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
words=[[] for _ in range(N)]
for _ in range(M):
    p,S=input().split()
    p=int(p)-1
    words[p].append(S)
AC=0
WA=0
for a in words:
    if a.count('WA')!=0 and len(a)==a.count('WA'):
        break
    for b in a:
        if b=='AC':
            AC+=1
            break
        elif b=='WA':
            WA+=1
print(AC,WA)

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
p=[0]*m
s=[0]*m
for i in range(m):
    p[i],s[i]=input().split()
    p[i]=int(p[i])
wa=[0]*n
ac=[0]*n
for i in range(m):
    if s[i]=="WA":
        if ac[p[i]-1]!=1:
            wa[p[i]-1]+=1
    if s[i]=="AC":
        if ac[p[i]-1]!=1:
            ac[p[i]-1]+=1
sum_wa=0
sum_ac=0
for j in range(n):
    sum_wa+=wa[j]
    sum_ac+=ac[j]
print("{0} {1}".format(sum_ac,sum_wa))

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
words=[[] for _ in range(N)]
for _ in range(M):
    p,S=input().split()
    p=int(p)-1
    words[p].append(S)
AC=0
WA=0
for a in words:
    for b in a:
        if b=='AC':
            AC+=1
            break
        elif b=='WA':
            WA+=1
print(AC,WA)

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
wa=dict()
AC=dict()
for i in range(M):
    p,s=map(str,input().split())
    if int(p) not in AC and s=='WA' :
        if int(p) in wa :
            wa[p]+=1
        else:
            wa[p]=1
    if s=='AC':
        AC[p]=1
        
print(len(AC),sum(wa.values()))

Submission status: Wrong Answer

Solution code:
def multi_input():
    return map(int, input().split())

N, M = multi_input()
pS = [input().split() for _ in range(M)]

l = ['WA' for _ in range(N+1)]
a = 0
p = 0
for i, j in pS:
    i = int(i)
    if l[i] == 'WA' and j == 'WA':
        p += 1
    elif l[i] == 'WA' and j == 'AC':
        a += 1
        l[i] = 'AC'

print(a, p)

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
p=[]
l=[1]*n
for i in range(m):
    P=list(input().split())
    p.append(P)

AC=0
WA=0

for i in range(m):
    if l[int(p[i][0])-1]==1:
        if p[i][1]=="WA":
            WA+=1
        else:
            AC+=1
            l[int(p[i][0])-1]=0
print(AC,WA)

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
ac, pn = 0, 0
acdict = {}
wadict = {}
for k in range(m):
    p, S = input().split()
    if S == 'AC':
        if p not in acdict:
            ac += 1
            acdict[p] = 1
    else:
        if p not in acdict:
            pn += 1
            wadict[p] = 1
print(str(ac) + ' ' + str(pn))

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
ac, pn = 0, 0
acdict = {}
wadict = {}
for k in range(m):
    p, S = input().split()
    if S == 'AC':
        if p not in acdict:
            ac += 1
            acdict[p] = 1
    else:
        if p not in wadict:
            pn += 1
            wadict[p] = 1
print(str(ac) + ' ' + str(pn))

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
a=[input().split() for i in range(m)]
b=[0]*n
c=[0]*n
for j in range(m):
    if a[j][1]=="AC":
        b[int(a[j][0])-1]=1
    else:
        if b[int(a[j][0])-1]==0:
            c[int(a[j][0])-1]+=1
print(str(sum(b)),str(sum(c)))

Submission status: Wrong Answer

Solution code:
N, M = list(map(int, input().split()))
submits = [[] for i in range(M)]
for i in range(M):
    submits[i] = input().split()
    submits[i][0] = int(submits[i][0])

AC_number = [0 for i in range(N)] #バケット
WA_number = [0 for i in range(N)] #バケット
for i in range(M):
     #ACが出たら
    if submits[i][1] == 'AC':
        AC_number[submits[i][0] - 1] = 1
        
    #WAが出て、まだ終わってない問題なら
    if submits[i][1] != 'AC' and AC_number[submits[i][0] - 1] != 1:
        WA_number[submits[i][0] - 1] += 1

AC_count = 0
WA_count = 0
for i in range(N):
    if AC_number[i] == 1:
        AC_count += 1
        WA_count = WA_number[i]
print(AC_count, WA_count)

Submission status: Wrong Answer

Solution code:
N, M = list(map(int, input().split()))
submits = [[] for i in range(M)]
for i in range(M):
    submits[i] = input().split()
    submits[i][0] = int(submits[i][0])

AC_number = [0 for i in range(N)] #バケット
WA_number = [0 for i in range(N)] #バケット
for i in range(M):
    #WAが出て、まだ終わってない問題なら
    if submits[i][1] != 'AC' and AC_number[submits[i][0] - 1] != 1:
        WA_number[submits[i][0] - 1] += 1
    
    #ACが出たら
    if submits[i][1] == 'AC':
        AC_number[submits[i][0] - 1] = 1

AC_count = 0
WA_count = 0
for i in range(N):
    if AC_number[i] == 1:
        AC_count += 1
        WA_count = WA_number[i]
print(AC_count, WA_count)

Submission status: Wrong Answer

Solution code:
N, M = list(map(int, input().split()))
submits = [[] for i in range(M)]
for i in range(M):
    submits[i] = input().split()
    submits[i][0] = int(submits[i][0])

AC_number = [0 for i in range(N)] #バケット
WA_number = [0 for i in range(N)] #バケット
for i in range(M):
    #WAが出て、まだ終わってない問題なら
    if submits[i][1] != 'AC' and AC_number[submits[i][0] - 1] != 1:
        WA_number[submits[i][0] - 1] += 1
    
    #ACが出たら
    if submits[i][1] == 'AC':
        AC_number[submits[i][0] - 1] = 1
print(str(sum(AC_number)) + ' ' + str(sum(WA_number)))

Submission status: Wrong Answer

Solution code:
N, M = list(map(int, input().split()))
submits = [[] for i in range(M)]
for i in range(M):
    submits[i] = input().split()
    submits[i][0] = int(submits[i][0])

AC_number = [0 for i in range(N)] #バケット
WA_number = [0 for i in range(N)]
for i in range(M):
    #WAが出て、まだ終わってない問題なら
    if submits[i][1] != 'AC' and AC_number[submits[i][0] - 1] != 1:
        WA_number[submits[i][0] - 1] += 1
    
    #ACが出たら
    if submits[i][1] == 'AC':
        AC_number[submits[i][0] - 1] = 1
print(sum(AC_number), sum(WA_number))

Submission status: Wrong Answer

Solution code:
N, M = list(map(int, input().split()))
submits = [[] for i in range(M)]
for i in range(M):
    submits[i] = input().split()
    submits[i][0] = int(submits[i][0])

AC_number = [0 for i in range(N)] #バケット
WA_number = [0 for i in range(N)]
for i in range(M):
    #WAが出て、まだ終わってない問題なら
    if submits[i][1] == 'WA' and AC_number[submits[i][0] - 1] != 1:
        WA_number[submits[i][0] - 1] += 1
    
    #ACが出たら
    if submits[i][1] == 'AC':
        AC_number[submits[i][0] - 1] = 1
print(sum(AC_number), sum(WA_number))

Submission status: Wrong Answer

Solution code:
N, M = list(map(int, input().split()))
submits = [[] for i in range(M)]
for i in range(M):
    submits[i] = input().split()
    submits[i][0] = int(submits[i][0])

finish_number = [0 for i in range(N)] #バケット
WA_count = 0
for i in range(M):
    #WAが出て、まだ終わってない問題なら
    if submits[i][1] == 'WA' and finish_number[submits[i][0] - 1] != 1:
        WA_count += 1
    
    #ACが出たら
    if submits[i][1] == 'AC':
        finish_number[submits[i][0] - 1] = 1
print(sum(finish_number), WA_count)

Submission status: Wrong Answer

Solution code:
N, M = list(map(int, input().split()))
submits = [[] for i in range(M)]
for i in range(M):
    submits[i] = input().split()
    submits[i][0] = int(submits[i][0])

finish_number = [0 for i in range(N)] #バケット
WA_count = 0
AC_count = 0
for i in range(M):
    #WAが出て、まだ終わってない問題なら
    if submits[i][1] == 'WA' and finish_number[submits[i][0] - 1] == 0:
        WA_count += 1
    
    #ACが出たら
    if submits[i][1] == 'AC':
        finish_number[submits[i][0] - 1] = 1
print(sum(finish_number), WA_count)

Submission status: Wrong Answer

Solution code:
N, M = list(map(int, input().split()))
submits = [[] for i in range(M)]
for i in range(M):
    submits[i] = input().split()
    submits[i][0] = int(submits[i][0])

finish_number = []
WA_count = 0
AC_count = 0
for i in range(M):
    #まだ終わってない問題で、WAが出たら
    if submits[i][0] not in finish_number and submits[i][1] == 'WA':
        WA_count += 1
    
    #まだ終わってない問題で、ACが出たら
    if submits[i][0] not in finish_number and submits[i][1] == 'AC':
        finish_number.append(submits[i][0])
        AC_count += 1
print(AC_count, WA_count)

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    input = sys.stdin.readline

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

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
ac = set()
wa = 0
for _ in range(m):
    p, s = input().split()
    p = int(p)
    if s == 'AC':
        ac.add(p)
    elif not p in ac:
        wa += 1
print(len(ac), wa)

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
ps=[list(map(str,input().split())) for _ in range(m)]
acwa=[0]*n
ac,wa=0,0
for P,s in ps:
  p=int(P)-1
  if acwa[p]==0 and s=='WA':
    wa+=1
  elif acwa[p]==0 and s=='AC':
    ac+=1
    acwa[p]=1
print(ac,wa)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
wa = [0 for _ in range(n+1)]
ac = 0
q = [False for _ in range(n+1)]

for i in range(m):
    p,s = input().split()
    p = int(p)
    if s =="WA":
        if q[p]:
            continue
        else:
            wa[p] += 1
    else:
        if q[p]:
            continue
        else:
            q[p] = True
            ac += 1
print(ac,sum(wa))

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
p=[]
s=[]
wa=0
www=[0]*100007
for i in range(M):
    P,S=input().split()
    if S=="AC":
        s.append(P)
        www[int(P)+1]=1
    if S=="WA" and  www[int(P)+1]!=1:
        wa+=1
    
ac=set(s)
print(len(ac),wa)

Submission status: Wrong Answer

Solution code:
from collections import deque
def solve():
    solved = set()

    N,M = map(int, input().split())
    wa = [0]*(N+1)
    pn = 0
    for i in range(M):
        p,s = input().split()

        if s == "AC":
            solved.add(p)
            pn += wa[int(p)]
        else:
            if not (p in solved):
                wa[int(p)] += 1
    print(len(solved), pn)



if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
Q = [0]*(n+1)
q = [0]*(n+1)
for i in range(m):
    p,s = input().split()
    if q[int(p)]==1:
        continue
    else:
        if s=="AC":
            q[int(p)] = 1
        else:
            Q[int(p)] += 1
print(sum(q),sum(Q))

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
ac,wa=0,0
ac_set=set()
wa_cnt=[0]*(n+1)
for i in range(m):
  p,s=map(str,input().split())
  p=int(p)
  if s=="AC":
    if p in ac_set:
      continue
    ac_set.add(p)
  else:
    if p in ac_set:
      continue
    wa_cnt[p]+=1
ac=len(ac_set)
wa=sum(wa_cnt)
print(ac,wa)

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
pro = [0 for i in range(N+1)]
ac,wa = 0,0
for i in range(M):
    p,s = input().split()
    p = int(p)
    if s == 'AC':
        if pro[p] != -1:
            ac += 1
            wa += pro[p]
            pro[p] = -1
    else:
        pro[p] += 1
print(ac,wa)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
li = []
for _ in range(m):
    li.append(list(input().split()))
li.sort(key=lambda x:x[0])
already = False
cnt_ans = 0
cnt_penalty = 0
prev = 0
checked = []
for p,s in li:
    if p in checked:
        continue
    else:
        prev = p
        if s == "WA":
            cnt_penalty += 1
        else:
            cnt_ans += 1
            checked.append(p)
print(cnt_ans,cnt_penalty)

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
ac,wa=0,0
ac_set=set()
wa_cnt=[0]*(n+1)
wa_cnt_f=[True]*(n+1)
for i in range(m):
  p,s=map(str,input().split())
  p=int(p)
  if s=="AC":
    ac_set.add(p)
    wa_cnt_f[p]=False
  else:
    if p not in ac_set:
      if wa_cnt_f[p]:
        wa_cnt[p]+=1
ac=len(ac_set)
wa=sum(wa_cnt)
print(ac,wa)

Submission status: Wrong Answer

Solution code:
from collections import deque
def solve():
    solved = set()

    N,M = map(int, input().split())
    wa = [0]*(N+1)
    for i in range(M):
        p,s = input().split()
        if not(p in solved):
            if s == "AC":
                solved.add(p)
            else:
                wa[int(p)] += 1
    print(len(solved), sum(wa))



if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
#%%code
def resolve():
    N,M=pin()
    ps=[tupin(str) for _ in range(M)]

    WA=[0]*N
    AC=[0]*N
    for m in range(M):
        p,s=ps[m]
        p=int(p)-1#0-indxd
        if AC[p]==0:
            if s=="WA": 
                WA[p]+=1
            else:
                AC[p]=1
    print(sum(AC),sum(WA))
        
#%%submit!
resolve()

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())
b = [0]*(n+1)
AC,WA = 0,0
for _ in range(m):
    p,s = map(str, input().split())
    if b[int(p)] == 0:
        if s == "AC":
            AC += 1
            b[int(p)] = 1
        elif s == "WA":
            WA += 1
print(AC,WA)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
q = []
ac = 0
wa = 0
for i in range(m):
    p,s = input().split()
    if p in q:
        continue
    else:
        if s=="AC":
            ac += 1
            q.append(p)
        else:
            wa += 1
print(ac,wa)

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
C = {i:[0,0] for i in range(1,N+1)}
for _ in range(M):
    p,S = input().split()
    p = int(p)
    if C[p][0]==0 and S=="WA":
        C[p][1] += 1
    elif C[p][0]==0 and S=="AC":
        C[p][0] = 1
numA = 0
numB = 0
for i in range(1,N+1):
    numA += C[i][0]
    numB += C[i][1]
print(numA,numB)

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())
b = [0]*(n+1)
AC,WA = 0,0
for _ in range(m):
    p,s = map(str, input().split())
    if b[int(p)] == 0:
        if s == "AC":
            AC += 1
            b[int(p)] = 1
        else:
            WA += 1
print(AC,WA)

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
ps = []
for _ in range(m):
    p, s = input().split()
    ps.append((int(p), s))
isac = [False]*(n+1)
total_ac = 0
total_wa = 0
for p, s in ps:
    if isac[p]:
        continue
    if s=='AC':
        isac[p] = True
        total_ac += 1
    else:
        total_wa += 1
print(total_ac, total_wa)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
q = set()
ac = 0
wa = 0
for i in range(m):
    p,s = input().split()
    if p in q:
        continue
    else:
        if s=="AC":
            ac += 1
            q.add(p)
        else:
            wa += 1
print(ac,wa)

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
use=[1]*n
pen=0
ans=0
for i in range(m):
    p,s=input().split()
    p=int(p)-1
    if s=="AC":
        if use[p]:
            use[p]=0
            ans+=1
    else:
        if use[p]:
            pen+=1
print(ans,pen)

Submission status: Wrong Answer

Solution code:
def main():
    n, m = map(int, input().split())
    questions = [[0, False] for _ in range(n)]
    for _ in range(m):
        p, s = input().split()
        p = int(p) - 1
        if not questions[p][1]:
            if s == "WA":
                questions[p][0] += 1
            else:
                questions[p][1] = True
    ac = 0
    wa = 0
    for wa_num, is_accepted in questions:
        wa += wa_num
        if is_accepted:
            ac += 1
    print(ac, wa)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n,m= map(int,input().split())

B = []
C = [0]*n
ans = 0
pna = 0
for i in range(m):
    a,b= map(str,input().split())
    if ans == n:
        break
    if b=="AC":
        if a not in B :
            B += a
            ans += 1
            pna += C[int(a)-1]
    else:
        C[int(a)-1] += 1 
print(ans,pna)

Submission status: Wrong Answer

Solution code:
n,m= map(int,input().split())

B = []
C = [0]*n
ans = 0
pna = 0
for i in range(m):
    A = list(map(str,input().split()))
    if ans == n:
        break
    if A[1]=="AC":
        if A[0] not in B :
            B += A[0]
            ans += 1
            pna += C[int(A[0])-1]
    if A[1]=="WA"  :
        C[int(A[0])-1] += 1 
print(ans,pna)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
n,m= map(int,input().split())

B = []
C = [0]*n
ans = 0
pna = 0
for i in range(m):
    A = list(map(str,input().split()))
    if ans == n:
        break
    if A[1]=="AC":
        if A[0] not in B :
            B += A[0]
            ans += 1
            pna += C[int(A[0])-1]
    if A[1]=="WA"  :
        C[int(A[0])-1] += 1 
print(ans,pna)

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
a=[0]*(N+1)
w=[0]*(N+1)
for _ in range(M):
    p,s=input().split()
    if a[int(p)]==0:
        if s=="AC":
            a[int(p)]=1
        else:
            w[int(p)]+=1
print(sum(a),sum(w))

##なぜか部分WA,,,理由がわからない

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
a=[False]*(N+1)
ans=0
miss=0
for _ in range(M):
    p,s=input().split()
    if a[int(p)]==False:
        if s=="AC":
            a[int(p)]=True
            ans+=1
        else:
            miss+=1
print(ans,miss)

##なぜか部分WA,,,理由がわからない

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
a=[False]*(N+1)
ans=0
miss=0
for _ in range(M):
    p,s=input().split()
    if a[int(p)]==False:
        if s=="AC":
            a[int(p)]=True
            ans+=1
        else:
            miss+=1
print(ans,miss)

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())

AC_list = []
WA_list = []

for i in range(0,M):
    p,S = map(str,input().split())
    if S == "AC":
        if p not in AC_list:
            AC_list.append(p)

    elif S == "WA":
        if p not in AC_list:
            if p not in WA_list:
                WA_list.append(p)

AC_set = set(AC_list)
WA_set = set(WA_list)

print(len(AC_set),len(WA_set))

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())

AC_list = []
WA_list = []

for i in range(0,M):
    p,S = map(str,input().split())
    if S == "AC":
        AC_list.append(p)
    elif S == "WA":
        if p not in AC_list:
            WA_list.append(p)

AC_set = set(AC_list)
WA_set = set(WA_list)

print(len(AC_set),len(WA_set))

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())

AC_list = []
WA_list = []

for i in range(0,M):
    p,S = map(str,input().split())
    if S == "AC":
        AC_list.append(p)
    else:
        WA_list.append(p)
    
AC_set = set(AC_list)
WA_set = set(WA_list)

print(len(AC_set),len(WA_set))

Submission status: Wrong Answer

Solution code:
N,M = map(int, input().split())
p = []
S = []
acnum = [-1]*N
for i in range(M):
    tmp1,tmp2 = input().split()
    p.append(int(tmp1))
    S.append(tmp2)
account = 0
wacount = 0
for i in range(M):
    if acnum[p[i] - 1] == -1:
        if S[i] == "AC":
            acnum[p[i] - 1] = 1
            account += 1
        else:
            wacount += 1
print(account,wacount)

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())

d_1=[0]*N
d_2=[0]*N

for i in range(M):
    p_i,S_i = input().split()
    p_i =int(p_i)-1
    if S_i=='WA' and d_2[p_i]==0:
        d_1[p_i]+=1
    elif S_i=='AC' and d_2[p_i]==0:
        d_2[p_i]=1

print(sum(d_2),sum(d_1))

Submission status: Wrong Answer

Solution code:
#!/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

print(sum(flag), sum(wa_num_list))

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())

Submittion = [None]*M
for i in range(M):
    Submittion[i] =input().split()
    Submittion[i][0] =int(Submittion[i][0])

answer = [0]*(N)
WA = 0
for i in range(M):
    if Submittion[i][1] == "AC":
        answer[Submittion[i][0]-1] +=1
    else:
        if answer[Submittion[i][0]-1] == 0:
            WA+=1

print_ans = 0
for i in range(len(answer)):
    if answer[i] >0:
        print_ans+=1

print(print_ans,WA)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
AC = [0]*N
WA = [0]*N

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

    if S == "AC":
        AC[p-1] = 1
    elif S == "WA":
        if not AC[p-1]:
            WA[p-1] = 1

for j in range(N):
    if AC[j]==0:
        WA[j]==0

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
AC = [0]*N
WA = [0]*N

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

    if S == "AC":
        AC[p-1] = 1
    elif S == "WA":
        if not AC[p-1]:
            WA[p-1] = 1

for j in range(N):
    if AC[j]==0:
        WA[j]==0
            
print(sum(AC), sum(WA))

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
AC = [0]*N
WA = [0]*N

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

    if S == "AC":
        AC[p-1] = 1
    elif S == "WA":
        if not AC[p-1]:
            WA[p-1] = 1

for j in range(N):
    if AC[j-1]==0:
        WA[j-1]==0
            
print(sum(AC), sum(WA))

Submission status: Wrong Answer

Solution code:
N,M = [int(x) for x in input().split()]
count = [0]*N
ac = 0
wa = 0
for i in range(M):
    a,b = input().split()
    a = int(a)
    if b == "AC" and count[a-1] == 0:
        count[a-1] = 1
        ac += 1
    elif count[a-1] == 0:
        wa += 1
print(ac,wa)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
AC = 0
penalty = 0
judge = ["WA"]*N
for i in range(M):
    p, S = input().split()
    p = int(p)
    if S == "AC" and judge[p-1] == "WA":
        judge[p-1] = "AC"
        AC += 1
    elif S == "AC":
        AC += 1
    elif S == "WA" and judge[p-1] == "WA":
        penalty += 1
    elif S == "WA":
        pass
        


print(AC, penalty)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
AC = 0
penalty = 0
judge = ["WA"]*N
for i in range(M):
    p, S = input().split()
    p = int(p)
    if S == "AC" and judge[p-1] == "WA":
        judge[p-1] = "AC"
        AC += 1
    elif S == "AC":
        pass
    elif S == "WA" and judge[p-1] == "WA":
        penalty += 1
    elif S == "WA":
        pass
        


print(AC, penalty)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())

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

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())

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

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

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())

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

ac = 0
wa = 0
for i in range(n):
    #print(i)
    for j in range(m):
        #print(j)
        if ac == i+1:
            pass
        elif i+1 == plist[j]:
            if slist[j] == 'AC':
                ac += 1
                
            elif slist[j] == 'WA':
                wa += 1
        
print(ac, wa)

Submission status: Wrong Answer

Solution code:
n, m = map(int,input().split())
q = [0 for i in range(n)]
alist = []
ac = 0
pe = 0
be = 0
for i in range(m):
    a,b=input().split()
    alist.append((int(a), b))
for i in range(m):
    if q[alist[i][0]-1] == 0:
        if alist[i][1] == 'AC':
            ac += 1
            be = be + pe
            pe = 0
            q[alist[i][0]-1] = 1
        else:
            pe += 1
    else:
        continue
print(ac,be)

Submission status: Wrong Answer

Solution code:
n, m = map(int,input().split())
q = [0 for i in range(n)]
alist = []
ac = 0
pe = 0
for i in range(m):
    a,b=input().split()
    alist.append((int(a), b))
for i in range(m):
    if q[alist[i][0]-1] == 0:
        if alist[i][1] == 'AC':
            ac += 1
            q[alist[i][0]-1] = 1
        else:
            pe += 1
    else:
        continue
print(ac,pe)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())

q = [0]*N
pen = 0

for i in range(M):
    p, S = map(str, input().split())

    if S == 'AC':
        q[int(p)-1] = 1
    elif S == 'WA' and q[int(p)-1] == 1:
        pass
    else:
        pen += 1

print('{} {}'.format(q.count(1), pen))

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
is_ac = [False]*n
 
ac, wa = 0, 0
for i in range(m):
    p, s = input().split()
    p = int(p)
    if is_ac[p-1] == False:
        if s == 'AC':
            is_ac[p-1] = True
            ac += 1
        else:
            wa += 1
            
print(ac, wa)

Submission status: Wrong Answer

Solution code:
test,submit=map(int,input().split())
ac_wa_map={}
ac=0
wa=0
for i in range(submit):
    test_no,acwa=input().split()
    if test_no not in ac_wa_map:
        ac_wa_map[test_no]=acwa
        if acwa=="AC":
            ac+=1
        elif acwa=="WA":
            wa+=1
    elif acwa=="AC" and ac_wa_map[test_no]=="WA":
        ac+=1
        ac_wa_map[test_no]=acwa
    elif acwa=="WA" and ac_wa_map[test_no]=="WA":
        wa+=1

print(ac,wa)

Submission status: Wrong Answer

Solution code:
test,submit=map(int,input().split())
ac_wa_map={}
ac=0
wa=0
for i in range(submit):
    test_no,acwa=input().split()
    if test_no not in ac_wa_map:
        ac_wa_map[test_no]=acwa
        if acwa=="AC":
            ac+=1
    if acwa=="AC" and ac_wa_map[test_no]!="AC":
        ac+=1
        ac_wa_map[test_no]=acwa
    elif acwa=="WA" and ac_wa_map[test_no]=="WA":
        wa+=1

print(ac,wa)

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())

AC = [0] * n
WA = [0] * n
for i in range(m):
  prb, res = input().split()
  prb = int(prb)
  if AC[prb-1] == 1:
    continue
  else:
    if res == "AC":
      AC[prb-1] = 1
    else:
      WA[prb-1] += 1

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

Submission status: Wrong Answer

Solution code:
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
    count = 0
  check = 0 

print(count_ac , count_wa)

Submission status: Wrong Answer

Solution code:
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
    count = 0
    check = 0 

print(count_ac , count_wa)

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
list_num = list([] for i in range(n))
test = [input().split() for i in range(m)]
check = [0] * n
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
    count = 0
    check = 0 

print(count_ac , count_wa)