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:
list1 = []
n,m = list(map(int, input().split()))
for i in range(m):
    a,b = input().split()
    c = [a,b]
    list1.append(c)
list2 = []
count = 0
for i in range(len(list1)):
    if list1[i][0] not in list2:
        if list1[i][1] == "WA":
            count = count + 1
        elif list1[i][1] == "AC":
            list2.append(list1[i][0])
print(len(list2),count)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
if m == 0:
    print(0, 0)
else:
    p = [0] * m
    s = [0] * m
    for i in range(m):
        p[i], s[i] = map(str, input().split())
    for i in range(m):
        p[i] = int(p[i])
    p.append(int(1e9))

    probcnt = p[0]
    ACval = False
    ACcnt = 0
    wa = 0
    pena = 0
    for i in range(m):
        if probcnt == p[i]:
            if ACval == False:
                if s[i] == 'WA':
                    wa += 1
                    if p[i] !=p[i+1]:
                        wa = 0
                else:
                    ACval = True
                    ACcnt += 1
                    pena += wa
                    wa = 0

        else:
            ACval = False
            probcnt = p[i]
            if ACval == False:
                if s[i] == 'WA':
                    wa += 1
                    if p[i] !=p[i+1]:
                        wa = 0
                else:
                    ACval = True
                    ACcnt += 1
                    pena += wa


    print(ACcnt, pena)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
if m == 0:
    print(0, 0)
else:
    p = [0] * m
    s = [0] * m
    for i in range(m):
        p[i], s[i] = map(str, input().split())
    for i in range(m):
        p[i] = int(p[i])

    probcnt = p[0]
    ACval = False
    ACcnt = 0
    wa = 0
    pena = 0
    for i in range(m):
        if probcnt == p[i]:
            if ACval == False:
                if s[i] == 'WA':
                    wa += 1
                else:
                    ACval = True
                    ACcnt += 1
                    pena += wa
        
        else:
            ACval = False
            probcnt = p[i]
            if ACval == False:
                if s[i] == 'WA':
                    wa += 1
                else:
                    ACval = True
                    ACcnt += 1
                    pena += wa
        wa = 0

    print(ACcnt, pena)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
if m == 0:
    print(0, 0)
else:
    p = [0] * m
    s = [0] * m
    for i in range(m):
        p[i], s[i] = map(str, input().split())
    for i in range(m):
        p[i] = int(p[i])

    probcnt = p[0]
    ACval = False
    ACcnt = 0
    wa = 0
    pena = 0
    for i in range(m):
        if probcnt == p[i]:
            if ACval == False:
                if s[i] == 'WA':
                    wa += 1
                else:
                    ACval = True
                    ACcnt += 1
                    pena += wa
            wa = 0
        else:
            ACval = False
            probcnt = p[i]
            if ACval == False:
                if s[i] == 'WA':
                    wa += 1
                else:
                    ACval = True
                    ACcnt += 1
                    pena += wa
            wa = 0

    print(ACcnt, pena)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
if m == 0:
    print(0, 0)
else:
    p = [0] * m
    s = [0] * m
    for i in range(m):
        p[i], s[i] = map(str, input().split())
    for i in range(m):
        p[i] = int(p[i])

    probcnt = p[0]
    ACval = False
    ACcnt = 0
    wa = 0
    pena = 0
    for i in range(m):
        if probcnt == p[i]:
            if ACval == False:
                if s[i] == 'WA':
                    wa += 1
                else:
                    ACval = True
                    ACcnt += 1
                    pena += wa
                wa = 0
        else:
            ACval = False
            probcnt = p[i]
            if ACval == False:
                if s[i] == 'WA':
                    wa += 1
                else:
                    ACval = True
                    ACcnt += 1
                    pena += wa
                wa = 0

    print(ACcnt, pena)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
if m == 0:
    print(0, 0)
else:
    p = [0] * m
    s = [0] * m
    for i in range(m):
        p[i], s[i] = map(str, input().split())
    for i in range(m):
        p[i] = int(p[i])

    probcnt = p[0]
    ACval = False
    ACcnt = 0
    wa = 0
    for i in range(m):
        if probcnt == p[i]:
            if ACval == False:
                if s[i] == 'WA':
                    wa += 1
                else:
                    ACval = True
                    ACcnt += 1
                    
        else:
            ACval = False
            probcnt = p[i]
            if ACval == False:
                if s[i] == 'WA':
                    wa += 1
                else:
                    ACval = True
                    ACcnt += 1

    print(ACcnt, wa)

Submission status: Wrong Answer

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

WA = [0] * N
AC = [0] * N

for i in range(M):
  pi, S = map(str,input().split())
  p = int(pi)
  
  if S == "AC":
    if AC[p-1] != 1:
      AC[p-1] = 1
  elif S == "WA":
    if AC[p-1] == 1:
      pass
    else:
      WA[p-1] += 1
else:
  ac = 0
  wa = 0
  
  for i in range(N):
    ac += AC[i-1]
    wa += WA[i-1]
  else:
    print(ac, wa)

Submission status: Wrong Answer

Solution code:
N, M = map(int,input().split())
p = []
S = []
for i in range(M):
  Pi, Si = map(str,input().split())
  p.append(int(Pi))
  S.append(Si)

a = [[]] * N
correct = 0
penalty = 0
for i in range(M):
  if S[i] == 'AC':
    a[p[i]-1].append(1)
  else:
    a[p[i]-1].append(0)
else:
  for i in range(N):
    if 1 in a[i]:
      correct += 1
      if 0 in a[i]:
        j = 0
        k = 0
        while j < 1:
          if a[i][k] == 1:
            break
          else:
            penalty += 1
            k += 1
  else:
    print(correct, penalty)

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] = map(str, input().split())
for i in range(m):
    p[i] = int(p[i])

probcnt = 1
ACval = False
ACcnt = 0
wa = 0
for i in range(m):
    if probcnt == p[i]:
        if ACval == False:
            if s[i] == 'WA':
                wa += 1
            else:
                ACval = True
                ACcnt += 1
    else:
        ACval = False
        probcnt += 1
        if ACval == False:
            if s[i] == 'WA':
                wa += 1
            else:
                ACval = True
                ACcnt += 1

print(ACcnt, 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] = map(str, input().split())
for i in range(m):
    p[i] = int(p[i])

probcnt = 1
ACcnt = False
wa = 0
for i in range(m):
    if probcnt == p[i]:
        if ACcnt == False:
            if s[i] == 'WA':
                wa += 1
            else:
                ACcnt = True
    else:
        ACcnt = False
        probcnt += 1
        if ACcnt == False:
            if s[i] == 'WA':
                wa += 1
            else:
                ACcnt = True
ans1 = s.count('AC')
print(ans1, wa)

Submission status: Wrong Answer

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

bango = set()
kekka = set()

ans1 = int(0)
ans2 = int(0)

for _ in range(m):
  b, a = input().split()
  b = {b}
  if b & bango:
    continue
  elif "AC" == a:
    bango = bango | b
    ans1 += 1
    continue
  else:
    ans2 += 1
    



print(ans1,ans2)

Submission status: Wrong Answer

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

bango = set()
kekka = set()

ans1 = int(0)
ans2 = int(0)

for i in range(m):
  b, a = input().split()
  if b in bango:
    continue
  if "AC" == a:
    b = {b}
    bango = bango | b
    ans1 += 1
    continue
  else:
    ans2 += 1
    



print(ans1,ans2)

Submission status: Wrong Answer

Solution code:
n,m = list(map(int,input().split()))
counter = 0
data = []
#入力処理
for i in range(m):
  data.append(input().split())
checkd = []
tmp = {}
for i in range(1,n+1):
  tmp[i] = 0

wa = 0
for i in range(m):
  if data[i][1] == "WA":
    tmp[int(data[i][0])] += 1
  elif ((data[i][1]) == "AC") and (int(data[i][0]) not in checkd):
    counter += 1
    checkd.append(data[i][0])
    wa += tmp[int(data[i][0])]
    
print(counter,wa)

Submission status: Wrong Answer

Solution code:
n,m = list(map(int,input().split()))
counter = 0
data = []
#入力処理
for i in range(m):
  data.append(input().split())
checkd = []
tmp = {}
for i in range(1,n+1):
  tmp[i] = 0

wa = 0
for i in range(m):
  if data[i][1] == "WA":
    tmp[int(data[i][0])] += 1
  elif ((data[i][1]) == "AC") and (int(data[i][0]) not in checkd):
    counter += 1
    checkd.append(data[i][0])
    wa += tmp[int(data[i][0])]
    tmp[int(data[i][0])] = 0
print(counter,wa)

Submission status: Wrong Answer

Solution code:
n,m = list(map(int,input().split()))
counter = 0
data = []
#入力処理
for i in range(m):
  data.append(input().split())
num = [int(s) for s in range(1,n+1)]
checkd = []
tmp = 0
wa = 0
for i in range(m):
  if data[i][1] == "WA":
    tmp += 1
  elif data[i][1] == "AC" and data[i][0] not in checkd:
    counter += 1
    checkd.append(data[i][0])
    wa += tmp
    tmp = 0
print(counter,wa)

Submission status: Wrong Answer

Solution code:
# history :: {int : (int, bool)}
n, m = [int(x) for x in input().split()]
history = { i+1 : [0, False] for i in range(n)}

for _ in range(m):
  pi, result = input().split()
  translated_pi = int(pi)
  if result == 'WA' and not history[translated_pi][1]:
    history[translated_pi][0] += 1
  else:
    history[translated_pi][1] = True

ac_count = 0
penalty_count = 0
for result in history.values():
  if result[1]:
    ac_count += 1
  penalty_count += result[0]

print("{} {}".format(ac_count, penalty_count))

Submission status: Wrong Answer

Solution code:
# C - Welcome to AtCoder
from collections import defaultdict


def main():
    N, M, *PS = open(0).read().split()
    is_correct = [0] * (int(N) + 1)
    wa_count = defaultdict(int)
    for p, s in zip(*[iter(PS)] * 2):
        p = int(p)
        if s == "AC":
            is_correct[p] = 1
        else:
            if not is_correct[p]:  # not yet AC and get WA -> +1 penalty
                wa_count[p] += 1
    print(sum(is_correct), sum(wa_count.values()))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
lines = []
_, N = input().split()
N = int(N)

lines = [input() for _ in range(N)]

correct = 0
penalty = 0
solved = set()
unsolved = set()

for line in lines:
    problem, response = line.split()
    if problem in solved:
        pass
    elif problem in unsolved:
        if response == 'AC':
            correct += 1
            solved.add(problem)
            unsolved.remove(problem)
    else:
        if response == 'WA':
            penalty += 1
            unsolved.add(problem)
        elif response == 'AC':
            correct += 1
            solved.add(problem)
            if problem in unsolved:
                unsolved.remove(problem)

print("{} {}", correct, penalty)

Submission status: Wrong Answer

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

for i in range(M):
  p,s=input().split()
  p=int(p)
  if AC[p]==0:
    if s=='WA':
      cnt_WA+=1
    if s=='AC':
      AC[p]=1
cnt_AC=sum(AC)
print(cnt_AC,cnt_WA)

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
WA = [0] * (N + 1)
AC = [0] * (N + 1)
for _ in range(M):
  i,s = input().split()
  i = int(i)
  if AC[i] == 0:
    if s == 'WA':
      WA[i] += 1
    elif s == 'AC':
      AC[i] = 1

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

Submission status: Wrong Answer

Solution code:
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 _[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)

Submission status: Wrong Answer

Solution code:
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
        
print(int(sum(jdg_ac)), int(sum(jdg_wa)))

Submission status: Wrong Answer

Solution code:
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
        
print('{} {}'.format(sum(jdg_ac), sum(jdg_wa)))

Submission status: Wrong Answer

Solution code:
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 _[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)

Submission status: Wrong Answer

Solution code:
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
        
print(sum(jdg_ac),sum(jdg_wa))

Submission status: Wrong Answer

Solution code:
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] == 0:
        jdg_wa[idx] += 1
    if _[1] == 'AC' and jdg_ac[idx] == 0:
        jdg_ac[idx] = 1

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

Submission status: Wrong Answer

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

try_flags = [True] * N  # まだacceptされてない=続けるフラグ
wa_list = [0] * N
ac_cnt = 0

for _ in range(M):
    i, result = input().split()
    i = int(i) - 1
    if result == 'WA' and try_flags[i]:
        wa_list[i] += 1
    if result == 'AC' and try_flags[i]:
        ac_cnt += 1
        try_flags[i] = False

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

N, M = map(lambda x: int(x), input().split())

Pdict = {}
for i in range(M):
    p_i, S_i = input().split()
    Pdict[p_i] = Pdict.get(p_i, []) + [S_i]

PenaltyNum=0
for i in Pdict.values():
    for j in i:
        if j=="AC":
            break
        else:
            PenaltyNum+=1
            continue

print(len(Pdict), PenaltyNum)

Submission status: Wrong Answer

Solution code:
N, M = list(map(int, input().split()))
a = []

for i in range(M):
    a.append(map(str, input().split()))

p_sum = 0
s_sum = 0

pre_s_sum = 0
p_dict = {}
for k in range(M):
    ps = list(a[k])

    if (ps[0] in p_dict) == True:
        if p_dict[ps[0]] == True:
            continue
    if ps[1] == "WA":  
        pre_s_sum += 1
    else:
        p_dict[ps[0]] = True
        p_sum += 1
        s_sum += pre_s_sum
        pre_s_sum = 0

print(str(p_sum) + " " + str(s_sum))

Submission status: Wrong Answer

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

check = [0 for i in range(N + 1)]
pAC = 0
pWA = 0
for p in Pn:
    if check[int(p[0])] == 0:
        if p[1] == 'WA':
            pWA += 1
        elif p[1] == 'AC':
            pAC += 1
            check[int(p[0])] = 1

print(pAC, pWA)

Submission status: Wrong Answer

Solution code:
# N問出題, M回提出
N, M = map(int, input().split())

p_S_list = []

WA = 'WA'
AC = 'AC'

question_list = [False] * N

count_AC = 0
count_WA = 0

for i in range(M):
    p, S = input().split()
    int_p = int(p)
    
    if S == WA and question_list[int_p - 1] == False:
        count_WA += 1

    if S == AC and question_list[int_p - 1] == False:
        count_AC += 1
        question_list[int_p - 1] = True

print(str(count_AC) + ' ' + str(count_WA))

Submission status: Wrong Answer

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

wa_count, ac_count = 0, 0
WA = 0  # {prob_id: wa_count}
AC_list = []  # [prob_id]

for i in range(M):
    id = A_list[i][0]
    if A_list[i][1] == 'AC':
        if not id in AC_list:
            wa_count += WA
            ac_count += 1
            AC_list.append(id)
    else:
        WA += 1

print(ac_count, wa_count)

Submission status: Wrong Answer

Solution code:
N, M = list(map(int, input().split()))
a = []

for i in range(M):
    a.append(map(str, input().split()))

p_sum = 0
s_sum = 0

p_count = 0
s_count = 0
pre_s_sum = 0
for k in range(M):
    ps = list(a[k])
    if p_count != ps[0]:
        s_count = 0
        p_count = ps[0]
    if s_count == 0:    
        if ps[1] == "WA":  
            pre_s_sum += 1
        else:
            p_sum += 1
            s_sum += pre_s_sum
            pre_s_sum = 0
            s_count = 1

print(str(p_sum) + " " + str(s_sum))

Submission status: Wrong Answer

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

num = {}
now = "1"
countAC = 0
countWA = 0
flag = False

for x in range(M):
  p, re = input().split()
  #print(p, re)
  if p not in num:
	  num[p] = True
  
  
    
 
  
  if re == "WA" and num[p]:
    countWA += 1
    #print("wa")
    
  if re == "AC" and num[p]:
    countAC += 1
    flag = True
    #print("ac")
  
  if flag:
    num[p] = False
    flag = False
  

print(countAC, countWA)

Submission status: Wrong Answer

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

num = {}
now = "1"
countAC = 0
countWA = 0
flag = False

for x in range(M):
  p, re = input().split()
  #print(p, re)
  if p not in num:
	  num[p] = True
  
  if now != p:
    now = p
    flag = False
    
 
  
  if re == "WA" and num[p]:
    countWA += 1
    #print("wa")
    
  if re == "AC" and num[p]:
    countAC += 1
    flag = True
    #print("ac")
  
  if flag:
    num[p] = False
  

print(countAC, countWA)

Submission status: Wrong Answer

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

num = {}
now = "1"
countAC = 0
countWA = 0
flag = False

for x in range(M):
  p, re = input().split()
  #print(p, re)
  num[p] = True
  
  if now != p:
    now = p
    flag = False
    
  if flag:
    num[p] = False
  
  if re == "WA" and num[p]:
    countWA += 1
    #print("wa")
    
  if re == "AC" and num[p]:
    countAC += 1
    flag = True
    #print("ac")
    
  

print(countAC, countWA)

Submission status: Wrong Answer

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

now = 1
countAC = 0
countWA = 0
flag = True

for x in range(M):
  p, re = input().split()
  #print(p, re)
  
  if now != p:
    now = p
    flag = True
  
  if re == "WA" and flag:
    countWA += 1
    #print("wa")
    
  if re == "AC" and flag:
    countAC += 1
    flag = False
    #print("ac")
    
  

print(countAC, countWA)

Submission status: Wrong Answer

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

now = 1
countAC = 0
countWA = 0
flag = True

for x in range(M):
  p, re = input().split()
  print(p, re)
  
  if now != p:
    now = p
    flag = True
  
  if re == "WA" and flag:
    countWA += 1
    print("wa")
    
  if re == "AC" and flag:
    countAC += 1
    flag = False
    print("ac")
    
  

print(countAC, countWA)

Submission status: Wrong Answer

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

list = [[] for i in range(N)]
# print(list)

for i in range(M):
    p, S = input().split(" ")
    p = int(p)
    if "AC" not in list[p-1]:
        list[p-1].append(S)
    else:
        pass
pe = 0
cl = 0
for l in list:
    for i in l:
        if i == "AC":
            cl += 1
        else:
            pe += 1
print(cl, pe)

Submission status: Wrong Answer

Solution code:
N, M = list(map(int, input().split()))
a = []

for i in range(M):
    a.append(map(str, input().split()))

p_sum = 0
s_sum = 0

p_count = 0
s_count = 0
for k in range(M):
    ps = list(a[k])
    if p_count != ps[0]:
        s_count = 0
        p_count = ps[0]
    if s_count == 0:    
        if ps[1] == "WA":  
            s_sum += 1
        else:
            p_sum += 1
            s_count = 1

print(str(p_sum) + " " + str(s_sum))

Submission status: Wrong Answer

Solution code:
n , m = map(int,input().split())
a,w = 0,0
As = []
for _ in range(m):
  t, k = input().split()
  t = int(t)
  if t in As:
    continue
  if k == "AC":
    As.append(t)
    a += 1
  if k == "WA":
    w += 1
print(a,w)

Submission status: Wrong Answer

Solution code:
n , m = map(int,input().split())
a,w = 0,0
As = []
for _ in range(m):
  t, k = input().split()
  t = int(t)
  if t in As:
    print(t)
    continue
  if k == "AC":
    As.append(t)
    a += 1
  if k == "WA":
    w += 1
print(a,w)

Submission status: Wrong Answer

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

now = 0
seikai = 0
penalty = 0
state = ""
for i in range(M):
    p, S = input().split(" ")
    p = int(p)

    if p > now:
        now = p
        state = ""

    if state != "AC":
        if S == "AC":
            seikai += 1
            state = "AC"
        else:
            penalty += 1
    else:
        pass
print(seikai, penalty)

Submission status: Wrong Answer

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

wa_count, ac_count = 0, 0
WA_List = {}  # {prob_id: wa_count}
AC_list = []  # [prob_id]

for i in range(M):
    id = A_list[i][0]
    if A_list[i][1] == 'AC':
        if not id in AC_list:
            if id in WA_List:
                wa_count += WA_List[id]
            ac_count += 1
            AC_list += id
    else:
        if id in WA_List:
            WA_List[id] += 1
        else:
            WA_List[id] = 1

print(ac_count, wa_count)

Submission status: Wrong Answer

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

wa_count, ac_count = 0, 0
WA_List = {}  # {prob_id: wa_count}
AC_list = []  # [prob_id]

for i in range(M):
    if A_list[i][1] == 'AC':
        id = A_list[i][0]
        if not id in AC_list:
            if id in WA_List:
                wa_count += WA_List[id]
            ac_count += 1
            AC_list.append(id)
    else:
        if id in WA_List:
            WA_List[id] += 1
        else:
            WA_List[id] = 1

print(ac_count, wa_count)

Submission status: Wrong Answer

Solution code:
number,submit=input().rstrip().split()
result=[input().rstrip().split() for i in range(int(submit))]
#print(result)
good=[]
bad=[]
stocK=[]
for i in range(int(submit)):
    if result[i][1]=='WA':       
        bad.append(result[i][0])
    elif result[i][1]=='AC' and result[i][0] not in good:
        good.append(result[i][0])
        stocK.append(len(bad))
        
        bad.clear()


print(str(len(good))+' '+str(sum(stocK)))

Submission status: Wrong Answer

Solution code:
number,submit=input().rstrip().split()
result=[input().rstrip().split() for i in range(int(submit))]
#print(result)
good=[]
bad=[]
stocK=[]
for i in range(int(submit)):
    if result[i][1]=='WA':       
        bad.append(result[i][0])
    elif result[i][1]=='AC':
        good.append(result[i][0])
        stocK.append(bad.count(result[i][0]))


print(str(len(good))+' '+str(sum(stocK)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

temp_wa_count, wa_count, ac_count, prob_id = 0, 0, 0, 0
WA_List = {}  # {prob_id: wa_count}
AC_list = []  # [prob_id]

for i in range(M):
    if A_list[i][1] == 'AC':
        if not A_list[i][0] in AC_list:
            if A_list[i][0] in WA_List:
                wa_count += WA_List[A_list[i][0]]
            ac_count += 1
            AC_list.append(A_list[i][0])
    else:
        if A_list[i][0] in WA_List:
            WA_List[A_list[i][0]] += 1
        else:
            WA_List = {A_list[i][0]: 1}

print(ac_count, wa_count)

Submission status: Wrong Answer

Solution code:
N,M = [int(x) for x in input().split()]
sub = []
subAC = []
ansAC = 0
ansWA = 0
for i in range(M):
    sub.append([x for x in input().split()])
for i in range(M):
    if sub[i][0] not in subAC and sub[i][1] == 'AC':
        ansAC +=1
        subAC.append(sub[i][0])
    elif sub[i][0] not in subAC and sub[i][1] == 'WA':
        ansWA +=1
print(ansAC,ansWA)

Submission status: Wrong Answer

Solution code:
number,submit=input().rstrip().split()
result=[input().rstrip().split() for i in range(int(submit))]
#print(result)
good=[]
bad=[]
for i in range(int(submit)):
    if result[i][1]=='AC':
        if result[i][0] not in good:
            good.append(result[i][0])
    else:       
        if result[i][0] not in good:
            bad.append(result[i][0])
print(str(len(good))+' '+str(len(bad)))

Submission status: Wrong Answer

Solution code:
number,submit=input().rstrip().split()
result=[input().rstrip().split() for i in range(int(submit))]
#print(result)
good=[]
bad=[]
for i in range(int(submit)):
    if result[i][1]=='AC':
        if len(good)==0:
            good.append(result[i][0])
        else:
            if result[i][0] not in good:
                good.append(result[i][0])
    else:
        
        if result[i][0] not in good:
            bad.append(result[i][0])
print(str(len(good))+' '+str(len(bad)))

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
problems = [False] * (N+1)
penalty = 0
for i in range(M):
    p, S = input().split()
    if S == 'AC':
        problems[int(p)] = True
    elif S == 'WA' and problems[int(p)] is False:
        penalty += 1
print(sum(1 if p is True else 0 for p in problems), penalty)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
problems = [False] * (N+1)
penalty = 0
for i in range(M):
    p, S = input().split()
    if S == 'AC':
        problems[int(p)] = True
    elif S == 'WA'and problems[int(p)] == False:
        penalty += 1
print(sum(1 if p is True else 0 for p in problems), penalty)

Submission status: Wrong Answer

Solution code:
number,submit=input().rstrip().split()
result=[input().rstrip().split() for i in range(int(submit))]
#print(result)
good=[]
bad=[]
for i in range(int(submit)):
    if result[i][1]=='AC':
        if len(good)==0:
            good.append(result[i][0])
        else:
            if result[i][0] not in good:
                good.append(result[i][0])
    else:
        if len(good)==0:
            bad.append(result[i][0])
        else:
            if result[i][0] not in good:
                bad.append(result[i][0])
#print(good)

# print(bad)
print(str(len(good))+' '+str(len(bad)))

Submission status: Wrong Answer

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

temp_wa_count, wa_count, ac_count, prob_id = 0, 0, 0, 0
AC_list = []

for i in range(M):
    if prob_id == A_list[i][0]:
        # 前回と同じ問題だった場合の処理
        if A_list[i][1] == 'AC':
            AC_list += A_list[i][0]
            if not 'AC' in AC_list:
                wa_count = temp_wa_count
                ac_count += 1
        else:
            temp_wa_count += 1
    else:
        # 前回と違う問題だった場合の処理
        if A_list[i][1] == 'AC':
            ac_count += 1
        else:
            temp_wa_count += 1
    prob_id = A_list[i][0]

print(ac_count, wa_count)

Submission status: Wrong Answer

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

temp_wa_count, wa_count, ac_count, prob_id = 0, 0, 0, 0

for i in range(M):
    if prob_id == A_list[i][0]:
        # 前回と同じ問題だった場合の処理
        if A_list[i][1] == 'AC':
            if not A_list[i - 1][1] == 'AC':
                wa_count = temp_wa_count
                ac_count += 1
        else:
            temp_wa_count += 1
    else:
        # 前回と違う問題だった場合の処理
        if A_list[i][1] == 'AC':
            ac_count += 1
        else:
            temp_wa_count += 1
    prob_id = A_list[i][0]

print(ac_count, wa_count)

Submission status: Wrong Answer

Solution code:
N, M = [int(x) for x in input().split()]
A, AC, WA, tmp = [], 0, 0, []
for _ in range(M):
    T = [x for x in input().split()]
    if T[1] == 'WA':
        if int(T[0]) in tmp: continue
        else: WA += 1
    else:
        if int(T[0]) in tmp: continue
        else:
            AC += 1
            tmp.append(int(T[0]))
print(AC, WA)

Submission status: Wrong Answer

Solution code:
N, M = [int(x) for x in input().split()]
A,  AC, WA, tmp = [], 0, 0, []
for _ in range(M): A.append([x for x in input().split()])
for _ in range(M):
    if A[_][1] == 'WA' and not int(A[_][0]) in tmp:
        WA += 1
    if A[_][1] == 'AC' and not int(A[_][0]) in tmp:
        AC += 1
        tmp.append(int(A[_][0]))
print(AC, WA)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
ac = set()
wa_count = 0
tmp = 0
for i in range(M):
  p, S = map(str, input().split())
  if S == "AC":
    ac.add(p)
    wa_count += tmp
    tmp = 0
  elif S == "WA" and not p in ac:
    tmp += 1
print(len(ac), wa_count - tmp)