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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
p = []
s = []
for i in range(m):
    pp, ss = input().split()
    p.append(int(pp) - 1)
    s.append(ss)

acs = [0] * n
was = [0] * n
for i in range(m):
    if s[i] == 'AC':
        acs[p[i]] = 1
    else:
        if acs[p[i]] == 0:
            was[p[i]] += 1
print("{} {}".format(sum(acs), sum(was)))

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
wrongnumber = [0] * N
ACset = set()
for i in range(M):
    p, S = input().split()
    if S == "AC":
        ACset.add(int(p)-1)
    else:
        if (int(p) - 1) not in ACset:
            wrongnumber[int(p) - 1] += 1
WAnumber = 0
ACnumber = len(ACset)
for j in ACset:
    WAnumber += wrongnumber[j-1]

print(ACnumber, WAnumber)

Submission status: Wrong Answer

Solution code:
def num():
    return int(input())
def nums():
    return list(map(int,input().split()))

import itertools as iter
import math
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N,M = nums()
P,S = [], []
AC = set()
WA = {}
for _ in range(M):
    pi,si = input().split()
    P.append(pi)
    S.append(si)
    if si == "AC":
        AC.add(pi)
    else:
        if not pi in WA.keys():
            WA[pi] = 1
        elif not pi in AC:
            WA[pi] += 1
for problem in WA.keys():
    if not problem in AC:
        WA[problem] = 0
ACnum = len(AC)
WAnum = sum(WA.values())
print(ACnum,WAnum)

Submission status: Wrong Answer

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

p, s = [], []
result = [0] * (n + 1)
ac, wa = 0, 0

for _ in range(m):
    tmpp, tmps = map(str, input().split())
    p.append(int(tmpp)), s.append(tmps)

for i in range(m):
    if result[p[i]] == 0:
        if s[i] == "AC":
            result[p[i]] = 1

        else:
            wa += 1

print(sum(result), wa)

Submission status: Wrong Answer

Solution code:
def main():
    N, M = [int(s) for s in input().split()]
    p = []
    S = []
    for i in range(M):
        s_pn, Sn = input().split()
        p.append(int(s_pn))
        S.append(Sn)

    cleared = {}
    ng = 0
    for i in range(M):
        if S[i] == 'AC':
            cleared[p[i]] = True
        elif S[i] == 'WA':
            if p[i] not in cleared:
                ng += 1
    print(len(cleared), ng)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N, K= [int(x) for x in input().split()]
t = [[] for i in range(N)]
for i in range(K):
  q,ans = input().split()
  t[int(q)-1].append(ans)

wa = 0
ac = 0
for i in t:
  for j in i:
    if j == "WA":
      wa += 1
    elif j== "AC":
      ac += 1
      break
print(ac,wa)

Submission status: Wrong Answer

Solution code:
N, M=map(int, input().split())
lst=[input().split() for _ in range(M)]
AC=[False for _ in range(N)]
WA=[0 for _ in range(N)]
for p, S in lst:
  p=int(p)-1
  if S=="AC":
    AC[p]=True
  if S=="WA" and not AC[p]:
    WA[p]+=1
print(sum(AC), sum(WA))

Submission status: Wrong Answer

Solution code:
def main():
    n, m = list(map(int, input().split()))
    ac_list = [0] * n
    wa_list = [0] * n
    for _ in range(m):
        tmp = input().split()
        contest_num = int(tmp[0]) - 1
        ret = tmp[1]
        if ret == "AC":
            ac_list[contest_num] = 1
        else:
            wa_list[contest_num] = 1

    print(sum(ac_list), sum(wa_list))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline


def main():
    N, M = map(int, input().split())

    ac_list = [False] * N
    count_wa = 0

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

    print(sum(ac_list), count_wa)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
ps = [list(input().split()) for _ in range(m)]
ps.sort(key=lambda x: x[0])

correct, penalty = 0, 0
last_c, is_solved = 1, False
for ps_i in ps:
  p, s = ps_i
  if (p != last_c):
    is_solved = False
    last_c = p
    if (is_solved):
      continue
    elif (s == "WA"):
      penalty += 1
    else:
      correct += 1
      is_solved = True
  else:
    if (is_solved):
      continue
    elif (s == "WA"):
      penalty += 1
    else:
      correct += 1
      is_solved = True
print(correct, penalty)

Submission status: Wrong Answer

Solution code:
def main():
    N, M = map(int, input().split(" "))
    ac = 0
    wa = 0
    accpted = []
    for _ in range(M):
        ps = input().split(" ")
        if ps[0] not in accpted:
            if ps[1] == "AC":
                ac += 1
                accpted.append(ps[0])
            else:
                wa += 1
    print(ac, wa)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

ac_list = [0] * (N+1)
wa_cnt = 0
ac_cnt = 0

for _ in range(M):
  p, S = map(str, input().split())
  if S == 'AC':
    if ac_list[int(p)] == 0:
      ac_cnt += 1
      ac_list[int(p)] = 1
    else:
      pass
  elif ac_list[int(p)] == 0:
    wa_cnt += 1
  else:
    pass
  
print(ac_cnt, wa_cnt)

Submission status: Wrong Answer

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


c = 0
a = 0

temp = []

for i in range(m):
    s = input().split()
    if s[1] == 'AC' and s[0] not in temp:
        a += 1
        temp.append(s[0])
    elif s[1] == 'WA':
        if a != n:
            c += 1

print(a, c)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline


def main():
    N, M = map(int, input().split())
    ps = []
    for i in range(M):
        p, s = input().split()
        ps.append((int(p), s))
    import collections
    ac = collections.defaultdict(int)
    pena = 0
    for p, s in ps:
        if s == "WA":
            if not ac[p]:
                pena += 1
        if s == "AC":
            if not ac[p]:
                ac[p] = 1
    print(len(ac), pena)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
temp=list(map(int, input().split()))
N=temp[0]
M=temp[1]
f=[0]*N
cnt=0
ac=0
for i in range(M):
  temp=input().split()
  if f[int(temp[0])-1]==0:
    if temp[1]=='WA':
      cnt+=1
    else:
      f[int(temp[0])-1]=1
      ac+=1
print(ac,cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m=list(map(int, input().split()))
cor,wro=0,0
dic={}
for i in range(m):
  x,y=list(map(str, input().split()))
  if y=="AC" and x not in dic:
    cor+=1
    dic[x]="ok"
  else:
    if x not in dic:
      wro+=1
  
print(cor,wro)

Submission status: Wrong Answer

Solution code:
N, M = list(map(lambda x: int(x), input().split()))
cleared = [False for i in range(N+1)]
ac = 0
wa = 0
for i in range(M):
  p, s = input().split()
  p = int(p)
  if cleared[p]:
    continue
  if s == "AC":
    cleared[p] = True
    ac = ac + 1
  else:
    wa = wa + 1

print(ac, wa)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

def main():
    N, M = map(int, input().split())

    ans = [False for _ in range(N)]

    ac = 0
    wa = 0

    for _ in range(M):
        i, result = input().split()
        i = int(i)

        if ans[i-1] == False:
            if result == "AC":
                ac += 1
                ans[i-1] = True
            else:
                wa += 1
    print(ac, wa)
    return 0
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n,m = list(map(int, input().split()))
aclist=[]
ac=0
wa=0
for i in range(m):
    j = list(input().split())
    if int(j[0]) not in aclist:
        if j[1]=='AC':
            ac+=1
            aclist.append(int(j[0]))
        elif j[1]=='WA':
            wa+=1
print(ac,wa)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
ps = [[i for i in input().split()] for j in range(m)]

p = [0] * (n+1)

num_ac = 0
num_wa = 0

for i in range(m):
    mondai = int(ps[i][0])
    if p[mondai] == 0:
        if ps[i][1] == 'WA':
            num_wa += 1
        else:
            num_ac += 1
            p[mondai] = 1

print(num_ac,num_wa)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
cleared = [False] * N
n_ac, penalty = 0, 0
for i in range(M):
    p, s = input().split()
    p = int(p)
    if not cleared[p - 1]:
        if s == "AC":
            cleared[p - 1] = True
            n_ac += 1
        else:
            penalty += 1

print(n_ac, penalty)

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
PS= [[s for s in input().split()] for _ in range(M)]

def main():
    ac = 0
    wa = 0
    dic = {}
    for p,s in PS:
        if s == "AC":
            if p in dic:
                wa += dic[p]
            ac += 1
        else:
            if p in dic:
                dic[p] += 1
            else:
                dic[p] = 1
    print(ac,wa)
    return 


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N, M = [int(x) for x in input().split()]
p = []
S = []
for _ in range(M):
    temp = input().rstrip().split()
    p.append(int(temp[0]))
    S.append(temp[1])
dic = {}
for i in range(N):
    dic[i + 1] = []
for i, j in zip(p, S):
    dic[i].append(j)
AC = 0
WA = 0
for k in dic.keys():
    temp = dic[k]
    for j in temp:
        if j == "WA":
            WA += 1
        else:
            AC += 1
            break
print(AC, WA)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

N, M = MAP()
ac = [0] * N
pn = [0] * N
for i in range(M):
    p, s = input().split()
    p = int(p) - 1
    if s == 'AC':
        ac[p] = 1
    elif s == 'WA' and not ac[p]:
        pn[p] += 1

print(sum(ac), sum(pn))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
a = [0]*N
pena = 0
for i in range(M):
    p, s = input().split()
    if s == 'WA' and a[int(p)-1] == 0:
        pena += 1
        continue
    if s == 'AC' and a[int(p)-1] == 0:
        a[int(p)-1] = 1

print(sum(a),pena)

Submission status: Wrong Answer

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

print(str(sum(isfinish)) + " "+ str(sum(isfail)))

Submission status: Wrong Answer

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

ac_flag = [False]*n
wa_counts = [0]*n

for i in range(m):
  p,s = map(str,input().split())
  p = int(p)-1
  if s == 'AC':
    ac_flag[p] = True
  else:    
    if ac_flag[p] == False:
      wa_counts[p] += 1

print('{} {}'.format(sum(ac_flag), sum(wa_counts)))

Submission status: Wrong Answer

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

ans = set()
wa = 0
for p, s in ps:
    if s == 'AC':
        ans.add(p)
    if s == 'WA' and p not in ans:
        wa += 1

print(len(ans), wa)

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
Nstate = {str(i):0 for i in range(1,N+1)}
AC = 0
WA = 0
for _ in range(M):
    n,m = map(str,input().split())
    if Nstate[n] == 0:
        if m == 'AC':
            Nstate[n] = 1
            AC += 1
        elif m == 'WA':
            WA += 1
print(AC,WA)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
pS = [list(input().split()) for _ in range(M)]
lis = [0]*N
pena = 0
for p,S in pS:
    p = int(p)-1
    if S == "AC":
        lis[p] = 1
    else:
        if lis[p] == 0:
            pena += 1
print(sum(lis),pena)

Submission status: Wrong Answer

Solution code:
N, M = list(map(int, input().split()))
PM = []
for i in range(M):
    p, s = input().split()
    PM.append([int(p), s])

PM.sort(key=lambda x:x[0])
# print(PM)


ac = [0] * (N+10)
a_cnt = 0
w_cnt = 0
for p, m in PM:
    if ac[p] == 1:
        pass
    elif m == 'WA':
        w_cnt += 1
    elif m == 'AC':
        a_cnt += 1
        ac[p] = 1

print(a_cnt, w_cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
record = [0]*(n+1)
ans = 0
penalty = 0
for i in range(m):
    p, s = input().split()
    if record[int(p)] == 0:
        if s == "AC":
            ans += 1
            record[int(p)] = 1
        elif s == "WA":
            penalty += 1
    else:
        continue

print(ans, penalty)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
import itertools

N,M = map(int,input().split())
a=[tuple(map(str,input().split())) for _ in range(M)]
ac = [0]*N
wa = [0]*N
for i in range(M):
    q = int(a[i][0])-1
    res = a[i][1]
    if res == 'AC':
        ac[q] = 1
    else:
        if ac[q] == 0:
            wa[q] += 1
print("{} {}".format(sum(ac),sum(wa)))

Submission status: Wrong Answer

Solution code:
N,M = map(int, input().split())
table= [0]*N
pen = 0
score = 0
for i in range(M):
  p,S = input().split()
  p = int(p)-1
  if table[p] == 1:
    continue
  elif S == "WA":
    pen += 1
  else:
    score += 1
    table[p] = 1
print(score,pen)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
ac = [False for _ in range(N)]
wa = 0

for _ in range(M):
  p, S = input().split()
  p = int(p) - 1
  if S == "AC":
    ac[p] = True
  elif ac[p] == False:
    wa += 1
ans_ac = ac.count(True)
print("{} {}".format(ans_ac, wa))

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
PS = [list(input().split()) for _ in range(M)]
l = [False]*N
ans = 0
pena = 0
for p,s in PS:
  p = int(p)
  if s=='AC':
    if not l[p-1]:
      l[p-1]=True
      ans+=1
  if s=='WA':
    if not l[p-1]:
      pena+=1
      
print(ans,pena)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
P, S = [], []
AC = [0 for n in range(N)]
WA = [0 for n in range(N)]
for m in range(M):
    p, s = input().split()
    p = int(p) - 1
    if AC[p] != 1 and s == 'WA':
        WA[p] += 1
    if s == 'AC':
        AC[p] = 1
print(sum(AC), sum(WA))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(m):
    string = input().split()
    prob = int(string[0])
    res = string[1]
    if p[prob]:
        pass
    elif res == "AC":
        p[prob] = True
        ac += 1
    else:
        wa += 1

print(ac, wa)

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
ac = 0
wa = 0
ac_list = [0]*n

for _ in range(m):
    p,s=input().split()
    p = int(p) - 1
    if ac_list[p] == 'AC': continue
    ac_list[p] = s
    if s == 'AC':
        ac += 1
    else:
        wa += 1
print(ac,wa)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
lst1 = [list(input().split()) for i in range(m)]

lst2 = [0]*n #01
lst3 = [0]*n #pena

for i,j in lst1:
    i = int(i)-1
    if lst2[i] == 0:
        if j == "WA":
            lst3[i] += 1
        else:
            lst2[i] = 1
        
        

print(sum(lst2),sum(lst3))

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
ps = [input().split() for i in range(m)]

ans_ac = 0
ans_wa = 0
flag = 0
number = 0
ok = []
for i in range(m):
    if ps[i][0] not in ok:
        if ps[i][1] == "WA":
            ans_wa += 1
        else:
            ans_ac += 1
            ok.append(ps[i][0])
    
print(ans_ac,ans_wa)

Submission status: Wrong Answer

Solution code:
def main():
    N, M = map(int, input().split())
    cnt = 0
    answer_list = [[] for _ in range(N)]
    for i in range(M):
        p, S = input().split()
        p = int(p) - 1
        answer_list[p].append(S)

    ac = 0
    wa = 0
    for answers in answer_list:
        for a in answers:
            if a == 'AC':
                ac += 1
                break
            else:
                wa += 1
    
    print(ac, wa)

    

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
q = [[] for _ in range(N)]
for i in range(M):
    p, s = input().split()
    p = int(p) - 1
    q[p].append(s)

count = 1
ac = 0
wa = 0
for i in range(N):
    clear = False
    for s in q[i]:
        if not clear and s == 'AC':
            clear = True
            ac += 1
            break
        else:
            wa += 1

print(ac, wa)

Submission status: Wrong Answer

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

acwa = [[0, 0] for _ in range(N)]

for i in range(M):
    p, s = input().split()
    p = int(p) - 1
    if s == 'AC':
        acwa[p][0] = 1
    elif s == 'WA':
        if acwa[p][0] == 0:
            acwa[p][1] += 1

ac, wa = 0, 0
for i in range(N):
    ac += acwa[i][0]
    wa += acwa[i][1]

print(ac, wa)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m=list(map(int, input().split()))
cor,wro=0,0
dic={}
for i in range(m):
  x,y=list(map(str, input().split()))
  if y=="AC":
    cor+=1
    dic[x]="ok"
  else:
    if x not in dic:
      wro+=1
print(cor,wro)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
p = [list(map(str, input().split())) for _ in range(M)]
aclst = [0] * (N + 1)
cntw = 0
cnta = 0

for i in range(M):
    if aclst[int(p[i][0])] == 0:
        if p[i][1] == 'AC':
            cnta += 1
            aclst[int(p[i][0])] = 1
        else:
            cntw += 1

print(cnta, cntw)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
na = [0]*n
nw = [0]*n

for i in range(m):
    a,b = input().split()

    if b == "AC":
        na[int(a)-1] = 1
    elif b == "WA":
        if na[int(a)-1] == 0:
            nw[int(a)-1] += 1

print(sum(na),sum(nw))

Submission status: Wrong Answer

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

pena = 0
ac_prob = [0]*(10**5 + 10)
for i in range(M):
  p,S = input().split()
  p = int(p)
  if(S == 'AC'):
    ac_prob[p] = 1
  elif(S == 'WA'):
    if(ac_prob[p] == 0):
      pena += 1

ac = sum(ac_prob)
print(ac, pena)

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
ps_lis = []
for i in range(m):
    p, s = input().split()
    ps_lis.append([int(p), s])
ac_lis = [0] * (n + 1)
pe_lis = [0] * (n + 1)
for p, s in ps_lis:
    if s == 'WA' and ac_lis[p] == 0:
        pe_lis[p] += 1
    elif s == 'AC':
        ac_lis[p] = 1
print(sum(ac_lis), sum(pe_lis))

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
li=[input().split() for i in range(m)]

ac=set()
wa=0

for x,y in li:
  if y=="WA" and x not in ac:
    wa+=1
  elif y=="AC" and x not in ac:
    ac.add(x)

print(len(ac),wa)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
AC = [0 for _ in range(N)]
WC = [0 for _ in range(N)]

for _ in range(M):
    p, s = input().split()
    p = int(p) - 1
    if s == 'AC' and AC[p] == 0:
        AC[p] = 1
    else:
        if AC[p] == 0:
            WC[p] += 1

print(sum(AC), sum(WC))

Submission status: Wrong Answer

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

d = {}
count_AC = 0
count_WA = 0
for m in range(M):
  p, S = input().split()
  if p in d:
    continue
  else:
    if S == 'AC':
      d[p] = True
      count_AC += 1
    else:
      count_WA += 1
    
print(count_AC, count_WA)

Submission status: Wrong Answer

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

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

for _ in range(M):
    p, s = input().split()
    p = int(p) - 1

    if ac[p]:
        continue

    if s == 'AC':
        ac[p] = True
    else:
        pe[p] += 1

print(sum(ac), sum(pe))

Submission status: Wrong Answer

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

acs = [False] * (N + 1)
was = [0] * (N + 1)

for p, s in X:
    if s == "AC":
        acs[int(p)] = True
    elif not acs[int(p)]:
        was[int(p)] += 1
        
print(sum(acs), sum(was))