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())
s,p = [False]*N, [0]*N
for i in range(M):
  tmp = input().split()
  pi,Si = int(tmp[0])-1, tmp[1]
  s[pi] |= Si == "AC"
  p[pi] += 1 if not s[pi] else 0
print(sum(s), sum(p))

Submission status: Wrong Answer

Solution code:
tmp = input().split()
N = int(tmp[0])
M = int(tmp[1])

quiz_dict = {}
wa_dict = {}

for i in range(M):
  tmp = input().split()
  
  quiz = tmp[0]
  res = tmp[1]
  
  if res == "AC":
    quiz_dict[quiz] = 1
  if res == "WA":
    wa_dict[quiz] = 1

print(len(quiz_dict), len(wa_dict))

Submission status: Wrong Answer

Solution code:
import sys

def resolve():
    input = sys.stdin.readline
    N,M=map(int,input().rstrip().split())
    Q=[list(input().rstrip().split()) for _ in range(M)]

    c=[0 for _ in range(N)]
    flag=[0 for _ in range(N)]

    for i in range(M):
        if Q[i][1]=="WA" and flag[int(Q[i][0])-1]==0:
            c[int(Q[i][0])-1]+=1
        else:
            flag[int(Q[i][0])-1]=1
    
    #ans=sum(c)
    #ansAC=sum(flag)
    
    ans=0
    ansAC=0
    for i in range(N):
        ans+=c[i]
        ansAC+=flag[i]
    #print(int(ansAC), int(ans))
    print('{:.15g}'.format(ansAC),'{:.15g}'.format(ans))
import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """2 5
1 WA
1 AC
2 WA
2 AC
2 WA"""
        output = """2 2"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """100000 3
7777 AC
7777 AC
7777 AC"""
        output = """1 0"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """6 0"""
        output = """0 0"""
        self.assertIO(input, output)

if __name__ == "__main__":
    #unittest.main()
    resolve()

Submission status: Wrong Answer

Solution code:
ac = 0
wa = 0
check = []

n, m = map(int, input().split())
for _ in range(m) :
    p, s = map(str, input().split())
    if not int(p) in check :
        if s == "WA" :
            wa += 1
        else :
            ac += 1
            check += [int(p)]

print(ac, wa)

Submission status: Wrong Answer

Solution code:
N, M = [int(s) for s in input().split()]
AC_list = [0 for i in range(N)]
n_WA = 0 
for i in range(M):
  Ai = input().split()
  n_problem = int(Ai[0])-1
  if Ai[1] == "WA" and AC_list[n_problem] == 0:
    n_WA += 1
  elif Ai[1] == "AC" and AC_list[n_problem] == 0:
    AC_list[n_problem] = 1
print(int(sum(AC_list)), int(n_WA))

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
num=[]
TF=[]
for i in range(M):
    tmp_num,tmp_TF=input().split()
    num.append(int(tmp_num))
    TF.append(tmp_TF)

accurate_num=[]
WA_num=0
for i,k in zip(num,TF):
    if k=="AC":
        accurate_num.append(i)
    if (k=="WA")&(i not in accurate_num):
        WA_num+=1
accurate_num=list(set(accurate_num))


print(len(accurate_num),WA_num)

Submission status: Wrong Answer

Solution code:
N, M = map(int,input().split())
tasks = []
for i in range(M):
  a, b = map(str,input().split())
  tasks.append([int(a),b])
AC = 0
WA = 0

try:
  for i in range(len(tasks)):
    num = tasks[i][0]
    if tasks[i][1]=="AC":
      AC += 1
      for j in range(i+1,len(tasks)):
        if tasks[j][0]==tasks[i][0]: del tasks[j]
    else: WA += 1
except IndexError: pass
print(AC, WA)

Submission status: Wrong Answer

Solution code:

N,M=map(int, input().split())
P=[]
S=[]
for i in range(M):
    p,s=input().split()
    P.append(int(p))
    S.append(s)


import numpy as np
P=np.array(P)
S=np.array(S)

if M>0:
    ans=P[S=="AC"]

    wa=0
    ac=[]
    for i in range(M):
        if P[i] in ans and P[i] not in ac and S[i]=="WA":
            wa+=1
        else:
            ac.append(P[i])
    
    
    print(len(ans),wa)
else:
    print(0,0)

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys
input = sys.stdin.readline

N, M = list(map(int, input().split()))
arr = np.zeros(N, dtype=np.int)
ac = 0
wa = 0
for _ in range(M):
    p, S = input().split()
    p = int(p)
    if arr[p-1] == 1:
        continue
    if S == 'AC':
        ac += 1
        arr[p-1] = 1
    else:
        wa += 1
ans = str(ac) + ' ' + str(wa)
print(ans)

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
WA = 0
lis = []
if M == 0:
  print(0,0)
else:
  for i in range(M):
    A = list(input().split())
    if A[0] not in lis:
      if A[1] == 'AC':
        lis.append(A[0])
      else:
        WA += 1
  print(len(lis), WA)

Submission status: Wrong Answer

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

ans = []
if M > 0:
  for _ in range(M):
    ans.append(input().split())
else:
  print(0," ",0)
  exit()

ac = 0
wa = 0
l = ['', '']

for i in range(M):
  if l[0] != ans[i][0]: # 異なる問題の場合
    l = ans[i]
    if l[1] == 'AC':
      ac += 1
    else:
      wa += 1
  else: # 同じ問題の場合
    if l[1] == 'AC': # すでにACを出している場合
      continue # ACでもWAでもカウントしない
    else:
      l = ans[i]
      if l[1] == 'AC':
        ac += 1
      else:
        wa += 1

print(ac, " ", wa)

Submission status: Wrong Answer

Solution code:
buf=input().split(" ")
 
N=int(buf[0])
M=int(buf[1])
p=[]
clear=[]
ac=0
wa=0

for i in range(M):
  buf=input().split(" ")
  if clear.count(int(buf[0])) == 0:
    if buf[1] == "AC":
      clear.append(int(buf[0]))
      ac=ac+1
    elif buf[1] == "WA":
      wa=wa+1
print(str(ac)+" "+str(wa))

Submission status: Wrong Answer

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

ac_set = set()
ac = 0
wa = 0

for i in range(m):
  p, s = input().split()
  
  if s == 'WA':
    if (p not in ac_set):
      wa += 1
      
  ac_set.add(p)

print(len(ac_set), wa)

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
ac = "AC"
wa = "WA"
ac_num = {}
wa_num = 0
for _ in range(m):
  p, s = input().split()
  if s == ac:
    ac_num[p] = 1
  elif not(p in ac_num) and s == wa:
    wa_num += 1
ans = len(ac_num)
if ans >= n:
  ans = n
print(ans, wa_num)

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
ps = [input() for _ in range(m)]
p = [0] * m
s = [''] * m
for i in range(m):
  x, y = ps[i].split()
  p[i] = int(x)
  s[i] = y
ac_flag = [0]*n # AC出したかどうかのflag
ac_count = 0
wa_count = 0
for j in range(m):
  if s[j] == 'AC' and ac_flag[p[j]-1] != 1:
    ac_count+=1
    ac_flag[p[j]-1] = 1
  elif s[j] == 'WA' and ac_flag[p[j]-1] != 1:
    wa_count+=1
print(sum(ac_flag),wa_count)

Submission status: Wrong Answer

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

p = []
s = []
for i in range(M):
    a, b = input().split()
    p.append(int(a))
    s.append(b)
    
from collections import defaultdict
correct = defaultdict(bool)

ac = 0
wa = 0

for pp in p:
    correct[pp] = False
for pp, ss in zip(p,s):
    if correct[pp]:
        pass
    else:
        if ss == 'AC':
            correct[pp] = True
            ac += 1
        elif ss == 'WA':
            wa += 1
print(ac, wa)

Submission status: Wrong Answer

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

L = []
search_n_list = [i for i in range(N)]
p_list = [0 for i in range(N)]
ac_list = [0 for i in range(N)]

for i in range(M):
    L_ = list(input().split())
    p = int(L_[0]) - 1
    w = L_[1]
    
    if p in search_n_list:
        if w == 'AC':
            ac_list[p] = 1
            search_n_list.remove(p)
        else:
            p_list[p] += 1

print("{} {}".format(sum(ac_list), sum(p_list)))

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
x = []
y = []
z = []
for i in range(1, m+1):
    p, s = input().split()
    if s == 'AC':
        x.append(p)
    else:
        y.append(p)
for i in y:
    if i in x:
        z.append(i)
z = len(z)
x = len(set(x))
print(x, z)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
Alist = [[]]*M
for i in range(M):
  Alist[i] = list(map(str, input().split()))
collect = [False]*N
NP = 0
NAC = 0
for j in range(M):
  if collect[int(Alist[j][0])-1] == False and Alist[j][1] == 'WA':
    NP += 1
  elif collect[int(Alist[j][0])-1] == False and Alist[j][1] == 'AC':
    NAC += 1
    collect[int(Alist[j][0])-1] = True
print(collect)
print(NAC, " ", NP)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
quest = []
if m == 0:
    pass
else:
    for i in range(m):
        a,b=input().split()
        quest.append([int(a), b])
wa = 0
ac = 0
ans = [0]*n
for j in range(m):
    if quest[j][1] == "AC":
      if  ans[int(quest[j][0]-1)] != 1:
        ac += 1
        ans[int(quest[j][0]-1)] = 1
    else:
        if ans[int(quest[j][0]-1)] == 1:
            pass
        else:
            wa+=1

Submission status: Wrong Answer

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

grid = []

for i in range(M-1):
    array = list(map(str, input().strip().split()))
    grid.append(array)

ac_list = [0]*N
wa_list = [0]*N

for a in grid:
    if a[1] == 'AC':
        ac_list[int(a[0]) - 1] = 1
    else:
        wa_list[int(a[0]) - 1] = 1

print(str(sum(ac_list)) + ' ' + str(sum(wa_list)))

Submission status: Wrong Answer

Solution code:
hist = []
nm = list(map(int, input().split()))
for i in range(nm[1]):
    a,b=input().split()
    hist.append((int(a), b))

ac = [0] * nm[0]
wa = [0] * nm[0]

for i in range(nm[1]):
    if hist[i][1] == "AC":
        if ac[hist[i][0]-1] != 1:
            ac[hist[i][0]-1] = 1
    else:
        if ac[hist[i][0]-1] != 1:
            wa[hist[i][0]-1] = wa[hist[i][0]-1] + 1

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
resultList = [[0 for i in range(2)] for j in range(n)]
#print(resultList)
for i in range(m) :
    result = input().split()
    prob = int(result[0]) - 1
    #print(resultList, result[1])
    if result[1] == 'AC' and resultList[prob][0] == 0 :
        resultList[prob][0] = 1
    if result[1] == 'WA' and resultList[prob][0] == 0 :
        resultList[prob][1] += 1

#print(resultList)

ansAC = 0
ansWA = 0
for i in range(n) :
    ansAC += resultList[i][0]
    ansWA += resultList[i][1]

print(ansAC, ansWA)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
dic ={}
c = 0
miss = 0
miss_re = 0

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

    if p in dic and dic[p] == 'WA':
        if S == 'WA':
            miss += 1
        
        else :
            dic[p] = S
            c += 1
            miss_re = miss  
    elif p in dic and dic[p] == 'AC':
        pass

    else :
        dic[p] = S
        if S == 'WA' :
            miss += 1
        else :
            c += 1

print('{0} {1}'.format(c, miss_re))

Submission status: Wrong Answer

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

flag=0
ac=0
pt=0
for k in range(len(ps)):
  if ps[k][1]=="WA" and flag!=int(ps[k][0]):
    pt+=1
  elif ps[k][1]=="AC" and flag<int(ps[k][0]):
    ac+=1
    flag=int(ps[k][0])

print(ac,pt)

Submission status: Wrong Answer

Solution code:
#coding:utf-8
n, m = map(int, input().split())
ac = 0
wa = 0
quest = 0
result = 'WA'
flag = 0


for i in range(m):
    p, s = map(str, input().split())
    if quest == p and flag == 1:
        pass
    elif quest == p and s == 'WA' and flag == 0:
        wa += 1
    elif quest == p and s == 'AC' and flag == 0:
        ac += 1
        flag = 1
    elif quest != p and s == 'WA':
        wa += 1
        flag = 0
    elif quest != p and s == 'AC':
        ac += 1
        flag = 1

    quest = p
    result = s

print(ac, wa)

Submission status: Wrong Answer

Solution code:
n, m = input().split(" ")
n, m = int(n), int(m)
p_s = []
for i in range(m):
    inp = input().split(" ")
    p_s.append(list(inp))

ans_list = [0 for n in range(n)]
failure_list = [0 for n in range(n)]
for p,s in p_s:
    p = int(p)
    if s == "AC":
        if ans_list[p-1] == 0:
            ans_list[p-1] = 1
        else:
            pass
    elif s == "WA":
        if ans_list[p-1] == 0:
            failure_list[p-1] += 1
        else:
            pass
print(sum(ans_list),sum(failure_list))

Submission status: Wrong Answer

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

############### TESTCASE ###############
test = ""
#test = \
"""
2 5
1 WA
1 AC
2 WA
2 AC
2 WA
ans 2 2
"""

"""
100000 3
7777 AC
7777 AC
7777 AC
ans 1 0
"""

"""
6 0
ans 0 0
"""

"""
3 3
1 AC
2 AC
3 AC
ans 3 0
"""
########################################
test = list(reversed(test.strip().splitlines()))
if test:
    def input2():
        return test.pop()
else:
    def input2():
        return input()
################# MAIN ################# 

n, m = map(int, input2().split())
ps = [None] * m
for i in range(m):
    tmp = input2().split()
    ps[i] = int(tmp[0]), tmp[1]

aced = [0] * (n + 1)
wabfac = [0] * (n + 1)

for item in ps:
    if item[1] == "AC":
        aced[item[0]] = 1
    else:
        if aced[item[0]] == 0:
            wabfac[item[0]] += 1


print(aced.count(not 0), sum(wabfac))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys
import random
import itertools
import math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt


def LI(): return list(map(int, input().split()))


def LF(): return list(map(float, input().split()))


def LI_(): return list(map(lambda x: int(x)-1, input().split()))


def II(): return int(input())


def IF(): return float(input())


def LS(): return list(map(list, input().split()))


def S(): return list(input().rstrip())


def IR(n): return [II() for _ in range(n)]


def LIR(n): return [LI() for _ in range(n)]


def FR(n): return [IF() for _ in range(n)]


def LFR(n): return [LI() for _ in range(n)]


def LIR_(n): return [LI_() for _ in range(n)]


def SR(n): return [S() for _ in range(n)]


def LSR(n): return [LS() for _ in range(n)]


def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x % y)


def my_index_multi(l, x):
    return [i for i, _x in enumerate(l) if _x == x]


def sosu(x):
    for i in range(2, int(sqrt(x)+1)):
        if x % i == 0:
            return False
    return True


mod = 1000000007
inf = float('INF')


def A():
    A = 'abcdefghijklmnopqrstuvwxyz'
    C = input().rstrip()
    p = 0
    for i in A:
        if C == i:
            p = 1
            continue
        if p == 1:
            print(i)
            return

    return

# B


def B():
    N,K,M = LI()
    A = LI()
    ans=M*N- sum(A)
    if ans>K:
        print(-1)
    elif ans<0:
        print(0)
    else:
        print(ans)


    return

# C


def true():
    S = input()
    S = S[:-1]

    tmp = 0
    for x in range(1 << (len(S)-1)):
        func = S[-1]
        for i in range(len(S)-1):
            if(x & (1 << i)):
                tmp += int(func)
                func = S[-2-i]
            else:
                func = S[-2-i]+func
        tmp += int(func)
    print(tmp)

    return


def C():
    N, M = LI()
    P=[]
    S=[]
    count=set([])
    ans=[0]*100000
    realans=0
    for i in range(M):
        p,s=input().split()
        p=int(p)
        if s=='AC':
            realans+=ans[p]
            count.add(p)
            ans[p]=0
        if s=='WA':
            
            ans[p]+=1
  


    
    print(len(count),realans)
    

        


        

# D


def D():

    a, b, x = LI()
    BIG = a*a*b/2
    if x > BIG:
        y = 2*b-(2*x/a/a)
        print(math.degrees(math.atan(y/a)))
    else:
        y = 2*x/a/b
        print(math.degrees(math.atan(b/y)))
    return

# E


def E():
    N, K = LI()
    A = LI()
    F = LI()
    A.sort(reverse=True)
    F.sort()
    cost = []
    for i in range(len(N)):
        cost.append(A[i]*F[i])

    a = F[cost.index(max(cost))]

    return

# F


def F():
    N, M = LI()

    value = [0] * M
    power = [0] * M
    for i in range(M):
        a, b = LI()
        value[i] = a
        c = LI()
        L = ['0'] * N
        for k in c:
            L[k - 1] = '1'
        bint = ''.join(L)
        power[i] = int(bint, 2)
    bint = ''.join(list(['1'] * N))
    dp = [inf] * (int(bint, 2)+1)
    t = 0
    cost = 0

    dp[0] = 0
    for s in range(int(bint, 2) + 1):
        for i in range(M):
            t = s | power[i]
            cost = dp[s] + value[i]
            dp[t] = min(dp[t], cost)
    print(-1) if(dp[-1] == inf) else print(dp[-1])

    return

    # you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")


def solution(S):
    # write your code in Python 3.6
    N = len(S)

    pass


# Solve
if __name__ == '__main__':

    C()

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
ans = 0
pena = 0
clear = ['']
for i in range(M):
    s = input().split()
    if s[0] not in clear:
        if s[1] == 'AC':
            ans += 1
            clear.append(str(s[0]))
        else:
            pena += 1
print('{} {}'.format(ans, pena))

Submission status: Wrong Answer

Solution code:
H, W = map(int, input().split())
A = [input().split() for _ in range(W)]

a=0
b=0
c=0
d=0
for i in range(W):
    if A[i][0]!=c:
        c=A[i][0]
        b+=1
        if A[i][1]=="AC":
            a+=1
        elif A[i][1]=="WA":
            d+=1
print(a,d)

Submission status: Wrong Answer

Solution code:
input_arg = list(map(int, input().split()))
ac_list = []
wa_list = []

for i in range(input_arg[1]):
  rec_input_arg = input().split()
  if rec_input_arg[1] == 'AC' and not rec_input_arg[0] in ac_list:
    ac_list.append(rec_input_arg[0])
  elif rec_input_arg[1] == 'WA' and not rec_input_arg[0] in ac_list:
    wa_list.append('WA')
    
print("{0} {1}".format(len(ac_list), len(wa_list)))

Submission status: Wrong Answer

Solution code:
n,m=map(int,input().split())
l=[0]*n
p=0
for i in range(m):
  li=input().split()
  if li[1]=='AC':
    l[int(li[0])-1]=1
  if li[1]=='WA' and l[int(li[0])-1]==0:
    p+=1
print('%d %d' % (sum(l), p))

Submission status: Wrong Answer

Solution code:
n=list(map(int,input().split()))
x=[list(input().split())for i in range(n[1])]
wwa,wa,ac=0,0,0
notused=[]
for i in range(n[1]):
  if(x[i][0] not in notused):
    if(x[i][1]=="WA"):
      wwa+=1
    else:
      ac+=1
      wa=wa+wwa
      wwa=0
      notused.append(x[i][0])
print('{0} {1}'.format(ac, wa))

Submission status: Wrong Answer

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

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

print(ac, wa)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
P = [0 for _ in range(N+1)]
S = [0 for _ in range(N+1)]

for _ in range(M):
  p, s = input().split()
  p = int(p)
  if not S[p]:
    if s == 'WA':
      P[p] += 1
    elif s == 'AC':
      S[p] = 1

print(sum(S), sum(P))

Submission status: Wrong Answer

Solution code:
import sys

class problem():
  def __init__(self, n, s):
    self.num = n
    self.result = s


n, m = map(int, input().split())
l = []

for i in sys.stdin:
  pm, c = i.split()
  l.append(problem(int(pm), c))

ck = []
fac = 0
swa = 0
acflag = 0

for i in l:
  if i.result == 'WA':
    if not(i.num in ck):
      swa += 1
    if acflag == 0:
      fac += 1
  else:
    if not(i.num in ck):
      ck.append(i.num)
      if acflag == 0:
        acflag += 1
if len(ck) == 0:
  fac = -1
  
print(fac + 1, swa)

Submission status: Wrong Answer

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

nAC = 0
nWA = 0
result_dic = {}

for i in range(M):
    pi, si = input().split()
    
    if pi not in result_dic.keys():
#         result_dic[pi] = si
        if si == "AC":
            result_dic[pi] = [si,0]
            nAC += 1
        else:
            result_dic[pi] = [si,1]
    else:
        pi_res = result_dic[pi][0]
        if pi_res == "AC":
            pass
        elif pi_res == "WA":
            if si == "AC":
                nWA += result_dic[pi][1]
                nAC += 1
                result_dic[pi] = [si,0]
            elif si == "WA":
                result_dic[pi][1] += 1
    print(result_dic)

print(nAC,nWA)

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
sub = [list(input().split()) for _ in range(M)]
A = 0
W = 0
num = []
for k in range(M):
    if sub[k][0] in num:
        continue
    if sub[k][1] == "AC":
            A += 1
            num.append(sub[k][0])
    elif sub[k][1] == "WA":
            W += 1
print(A,end=" ")
print(W)

Submission status: Wrong Answer

Solution code:
a=list(map(int,input().split()))
n=a[0]
m=a[1]
li=[]
li2=[]
seikai=[]
p=0
for i in range(m):
    li.append(input().split())
for j in li:
    if j[1]=="AC":
        seikai.append(int(j[0]))
    if int(j[0]) in seikai==False:
        li2.append(int(j[0]))
se=list(set(seikai))
for k in li2:
    if k in seikai==True:
        p+=1
print(str(len(se))+" "+str(p))

Submission status: Wrong Answer

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

li = ['WA'] * n
ac = 0
wa = 0

for p,s in ps:
    if s == 'AC':
        if li[int(p)-1] == 'WA':
            li[int(p)-1] = 'AC'
            ac += 1
    else:
        if li[int(p)-1] == 'WA':
            wa += 1

ac = li.count('AC')

print(ac, wa)

Submission status: Wrong Answer

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

x = []
for i in range(m):
  x.append(list(map(str,input().split())))
  
qu,ju = [],[]
AC,WA = 0,0
for i in x:
  qu.append(i[0])
  ju.append(i[1])

qu = list(set(qu))
for i in qu:
  x_target = [j for j in x if j[0] == i]
  
  #ACがあるかどうか、あった場合そのインデックス
  if [i,"AC"] in x_target:
    index = x_target.index([i,"AC"])
    WA += index
    AC += 1
  else:
    WA += len(x_target)
  
print(AC, WA)

Submission status: Wrong Answer

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

wa_ct = 0
ac_ct = 0
ac_l = [False] * (n+1)

for item in l:
    if ac_l[int(item[0])] == True:
        continue
    else:
        if item[1] == 'WA':
            wa_ct += 1
        else:
            ac_ct += 1
            ac_l[int(item[0])] = True

print(ac_ct, wa_ct)

Submission status: Wrong Answer

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

ACList = []
WAcnt = 0
for i in range(M):
    s = input().split()
    if s[1] == 'AC' and s[0] not in ACList:
        ACList.append(s[0])
        # N問と決まっているので、N問目のACが出た時点でループを終えて良い
        if int(s[0]) == N:
            break
    elif s[1] == 'WA' and s[0] not in ACList:
        WAcnt += 1

print("{} {}".format(len(ACList), WAcnt))

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
ac = 0
wa = 0
aclist = {}
for i in range(100000):
    aclist[i + 1] = 0

for i in range(m):
    a,b = input().split()
    a = int(a)
    if aclist[a] == 0:
        if b == 'WA':
            wa += 1
        if b == 'AC':
            aclist[a] += 1
            ac += 1
print(ac, wa, end="")

Submission status: Wrong Answer

Solution code:
import itertools

n, m = input().split(" ")
submit = list()
for i in range(0, int(m)):
    submit.append((input().split(" ")))

wa = list()
ac = list()
for i in submit:
    if i[1] == "WA":
        wa.append(i)
    else:
        ac.append(i)

ac.sort()
ac = list(ac for ac,_ in itertools.groupby(ac))
wa.sort()
wa = list(wa for wa,_ in itertools.groupby(wa))
print(len(wa),len(ac))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# INPUT
head = list(map(int, input().split()))

n = head[0]
m = head[1]

submit = [input() for i in range(m)]

ac = 0
wa = 0
finished = []

for i in range(m):
    s = submit[i].split()
    if s[1] == "WA":
        if s[0] not in finished:
            wa = wa + 1
            print("WA")

    if s[1] == "AC":
        if s[0] not in finished:
            finished.append(s[0])
            ac = ac + 1

print("{0} {1}".format(ac,wa))

Submission status: Wrong Answer

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


li = []

for i in range(m):
    p,q = map(str, input().split())
    li.append((int(p),q))

wa = 0

se = {i for i in li if i[1]=='AC'}
ac = len(se)

flag = False
for i in range(m-1):
    if li[i][0]!=li[i+1][0]:
        flag = False
    elif li[i][0]==li[i+1][0] and li[i][1]=='AC':
        flag = True
    elif li[i][0]==li[i+1][0] and li[i][1]=='WA':
        wa += 1

print(ac, wa)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
seikai = 0
matigai = 0
list = []
oklist = []
for i in range(m):
    a,b=input().split()
    list.append((int(a), b))
    
for i in range(m):
    if list[i][1] == "WA" and list[i][0] not in oklist:
        matigai += 1
    elif list[i][1] == "AC" and list[i][0] not in oklist:
        seikai += 1
        oklist.append(list[i][0])
            
print(str(seikai)+" "+str(matigai))

Submission status: Wrong Answer

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


a=[]
count_AC=0
count_WA=0
for i in range(M):
    a.append(input().split())
now=[]
owa=[]
see=[]
for i in a:
    if (i[0] in see):
        if not(i[0] in owa):
            if i[1]=="AC":
                count_AC+=1
                owa.append(i[0])

            else:
                count_WA+=1

    #初見
    else:
        if i[1]=="AC":
            count_AC+=1

            owa.append(i[0])
        else:
            count_WA+=1
            now.append(i[0])
        see.append(i[0])


print(count_AC,count_WA,sep=" ")

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys
input = sys.stdin.readline

def main():
    NM = [int(i) for i in input().split(" ")]
    if NM[1] == 0:
        ans = "0 0"
    else:
        pss = np.array([np.array(input().split(" ")) for j in range(NM[1])])

        probs = pss[:,0]
        answs = pss[:,1]

        #print(probs)
        #print(answs)
        ans_ac = 0
        ans_wa = 0

        probs_uniq = list(set(probs))
        print(probs_uniq)
        for p in probs_uniq:
            #print(p)
            res = list(answs[probs == p])
            #print(res)
            if "AC\n" in res:
                ind_ac = res.index("AC\n")
                ans_ac += 1
                ans_wa += ind_ac
            else:
                pass
        ans = str(ans_ac) + " " + str(ans_wa)
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


	num = []
	ans = []
	for i in range(m):
		na,a = input().split()
		num.append(na)
		ans.append(str(a))
	
	ac = 0
	wa = 0
	ac_temp = 0
	wa_temp = 0
	for i in range(m):
		if ans[i] == "WA":
			if i > 0 and num[i] != num[i-1]:
				wa_temp = 1
			else:
				wa_temp += 1
		if ans[i] == "AC" and ac_temp != num[i]:
			if num[i] != num[i-1] and ans[i-1] == "WA" and i >0:
				ac += 1
				ac_temp = num[i]
				wa_temp = 0
			else:
				ac += 1
				wa += wa_temp
				wa_temp = 0
				ac_temp = num[i]

		# print("i = {}".format(i),ac,wa,"wa_temp = {}".format(wa_temp))

	print(ac,wa)






 
if __name__ == '__main__':
	main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
N, M = map(int, input().split())
L = []
for _ in range(M) :
  L.append(list(map(str, input().split())))
#print(L)

ACsum = 0
WAsum = 0
ACList = []
for i in range(M) :
  
  if L[i][0] not in ACList and L[i][1] == "AC" :
    ACsum += 1
    ACList.append(L[i][0])
  
  if L[i][0] not in ACList and L[i][1] == "WA" :
    WAsum += 1
    
print(str(ACsum) + " " + str(WAsum))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=list(map(int,input().split()))
x=[list(input().split())for i in range(n[1])]
wwa,wa,ac=0,0,0
notused=[]
for i in range(n[1]):
  if(x[i][0] not in notused):
    if(x[i][1]=="WA"):
      wwa+=1
    else:
      ac+=1
      wa=wa+wwa
      notused.append(x[i][0])
print('{0} {1}'.format(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()
import numpy as np
p = [int(s) for s in p]
p1 = np.array(p)
S1 = [1 if i=="AC" else 0 for i in S]
N1 = list(set(p1 * S1))

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
lis = [input().split() for l in range(m)]
wa = 0
ac = 0
aclist = []
for i in range(m):
    if lis[i][0] in aclist:
        pass
    elif lis[i][1] == "WA":
        wa += 1
    else:
        ac += 1
        aclist.append(lis[i][0])
print(ac, wa)

Submission status: Wrong Answer

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

wa = 0
ac = 0

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

print(ac, wa)