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

Submission attempts (in order):
import sys

n, m = map(int, sys.stdin.readline().split())
pv = []
for _ in range(m):
    p, s = sys.stdin.readline().split()
    p = int(p) - 1
    v = 1 if s == 'AC' else 0
    pv.append((p, v))

def main():
    wa = [0] * n
    ac = [0] * n
    for p, c in pv:
        wa[p] += (ac[p] | v) ^ 1
        ac[p] |= v
    for p in range(n): wa[p] *= ac[p]
    print(sum(ac), sum(wa))

if __name__ ==  '__main__':
    main()

import sys

n, m = map(int, sys.stdin.readline().split())
pv = []
for _ in range(m):
    p, v = sys.stdin.readline().split()
    p = int(p)
    v = 1 if v == 'AC' else 0
    pv.append((p, v))

def main():
    return pv
    ac = [0] * (n + 1)
    wa = [0] * (n + 1)
    for p, v in pv:
        wa[p] += (ac[p] | v) ^ 1
        ac[p] |= v
    
    for p in range(1, n+1):
        wa[p] *= ac[p]

    return sum(ac), sum(wa)

if __name__ == '__main__':
    ans = main()
    print(*ans, sep=' ')

import sys

n, m = map(int, sys.stdin.readline().split())
pv = []
for _ in range(m):
    p, s = sys.stdin.readline().split()
    p = int(p) - 1
    v = 1 if s == 'AC' else 0
    pv.append((p, v))

def main():
    wa = [0] * n
    ac = [0] * n
    for p, v in pv:
        wa[p] += (ac[p] | v) ^ 1
        ac[p] |= v
    for p in range(n): wa[p] *= ac[p]
    print(sum(ac), sum(wa))

if __name__ ==  '__main__':
    main()

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
N, M = [int(i) for i in input().split()]
d = {}
for i in range(M):
    ps = tuple(input().split())
    if ps in d:
        d[ps] += 1
        if ps[1] == "WA" and (ps[0], "AC") in d:
            d[ps] -= 1
    else:
        d[ps] = 1
ans1 = 0
ans2 = 0
for i in range(N):
    if (str(i), "AC") in d:
        ans1 += 1
    if (str(i), "WA") in d:
        ans2 += d[(str(i), "WA")]
print(ans1, ans2)

N, M = [int(i) for i in input().split()]
AC = [0] * (N + 1)
WA = [0] * (N + 1)
for i in range(M):
    p, S = input().split()
    if S == "AC":
        AC[int(p)] = 1
    else:
        if AC[int(p)] == 0:
            WA[int(p)] += 1
ans0 = 0
ans1 = 0
for i in range(N):
    ans0 += AC[i+1]
    if AC[i + 1] == 1:
        ans1 += WA[i+1]
print(ans0, ans1)

Verdicts: Wrong Answer

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

Submission attempts (in order):
N, M = map(int, input().split())

ans_list = [0]*N+1
pen_num = 0
cor_num = 0

for i in range(M):
  p_i, S_i = input().split()
  p_i = int(p_i)
  
  if (ans_list[p_i] == 0):
    if(S_i == "WA"):
      pen_num += 1
    elif(S_i == "AC"):
      cor_num += 1
      ans_list[p_i] = 1
      
print("{} {}".format(cor_num,pen_num))
  
  


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

ans_list = [0]*N
pen_num = 0
cor_num = 0

for i in range(M):
  p_i, S_i = input().split()
  p_i = int(p_i)
  
  if (ans_list[p_i] == 0):
    if(S_i == "WA"):
      pen_num += 1
    elif(S_i == "AC"):
      cor_num += 1
      ans_list[p_i] = 1
      
print("{} {}".format(cor_num,pen_num))
  
  


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

ans_list = [0]*(N+1)
pen_list = [0]*(N+1)

for i in range(M):
  p_i, S_i = input().split()
  p_i = int(p_i)
  
  if (ans_list[p_i] == 0):
    if(S_i == "WA"):
      a = pen_list[p_i]
      a += 1
      pen_list[p_i] = a
    elif(S_i == "AC"):
      ans_list[p_i] = 1

pen_lis_ans = list(itertools.compress(pen_list, ans_list))
cor_num = sum(ans_list)
pen_num = sum(pen_lis_ans)
                   
print("{} {}".format(cor_num,pen_num))
  
  


Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
N, M = map(int, input().split())
PS = []
for i in range(M):
    p, s = input().split()
    PS += [(int(p),s)]

CA = 0
PN = 0
l = [True]*N
for i in range(len(PS)):
    if l[PS[i][0]]:
        if PS[i][1] == "WA":
            PN += 1
        elif PS[i][1] == "AC":
            CA += 1
            l[PS[i][0]] = False

print(CA, PN)

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

CA = 0
PN = 0
d = {key:0 for key in P}
for i in range(len(P)):
    if d[P[i]] >= 0:
        if S[i] == "WA":
            d[P[i]] += 1
        elif S[i] == "AC":
            PN += d[P[i]]
            CA += 1
            d[P[i]] = -1

print(CA, PN)


Verdicts: Runtime Error

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

Submission attempts (in order):
N,M = map(int,input().split())
arr = []
pre_idx = '-1'
pre_s = 'start'
cnt = 0
errors = 0
ans = 0
for i in range(M):
  idx,s = input().split()
  arr.append([int(idx),s])
  
arr = sorted(arr)

flag = False
for idx,s in arr:
  if pre_idx != idx:
    cnt = 0
    flag = False
  if flag:
    continue
  else:
    if s=='WA':
      cnt += 1
    else:
      errors += cnt
      ans += 1
      flag = True
  pre_idx = idx
  pre_s = s
    
print(ans,errors)


N,M = map(int,input().split())
errors = 0
ans = 0
error_arr = [0]*(N+1)
s_arr = ['WA']*(N+1)
for i in range(M):
  idx,s = input().split()
  idx = int(idx)
  if s_arr[idx]!='AC':
    if s=='WA':
      error_arr[idx] += 1
    else:
      s_arr[idx]='AC'
      ans += 1
      errors += error_arr[idx]
      s_arr[idx] = 'AC'

print(ans,errors)
    
  
  

Verdicts: Wrong Answer

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

Submission attempts (in order):
n,m=map(int,input().split())
ans = 0
wa = 0
li = [[i] for i in range(n)]
wa_list = [0] * n
for i in range(m):
  p,s=map(str,input().split())
  p=int(p)
  if "AC" not in li[p-1]:
    li[p-1].append(s)
    wa_list[p-1] += 1
    if s == "AC":
      ans += 1
      wa += wa_list[p-1]

print(ans,wa)

n,m=map(int,input().split())
ans = 0
wa = 0
li = [[i] for i in range(n)]
for i in range(m):
  p,s=map(str,input().split())
  p=int(p)
  if "AC" not in li[p-1]:
    li[p-1].append(s)
print(li)
for i in li:
  if "AC" in i:
    ans += 1
    wa += i.count("WA")

print(ans,wa)

n,m=map(int,input().split())
ans = 0
wa = 0
li = [[i] for i in range(n)]
wa_list = [0] * n
for i in range(m):
  p,s=map(str,input().split())
  p=int(p)
  if "AC" not in li[p-1]:
    li[p-1].append(s)
    wa_list[p-1] += 1
    if s == "AC":
      ans += 1
      wa += wa_list[p-1]

print(ans,wa)

n,m=map(int,input().split())
ans = 0
wa = 0
wa_list = [0] * n
ac_list = [0] * n
for i in range(m):
  p,s=map(str,input().split())
  p=int(p)-1
  if ac_list[p] == 0:
    if s == "AC":
      ac_list[p] += 1
    else:
      wa_list[p] += 1
a=0
for i in range(n):
  if ac_list[i]==0:
    wa_list[i]=0
print(sum(ac_list),sum(wa_list))
  


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
n, m = map(int, input().split())
ans = []
ans_0 = []
for i in range(m):
    ans_0 = list(map(str, input().split()))
    ans.append(ans_0)
list0 = []
for j in range(n):
    list0.append(0)
sei = 0
pen = 0
for lis in ans:
    if list0[int(lis[0])] == 0:
        if lis[1] == "AC":
            sei += 1
            list0[int(lis[0])] = 1
        else:
            pen += 1
    else:
        if lis[1] == "AC":
            pass
        else:
            pen += 1
print(str(sei)+" "+str(pen))



n, m = map(int, input().split())
ans = []
ans_0 = []
for i in range(m):
    ans_0 = list(map(str, input().split()))
    ans.append(ans_0)
list0 = []
listpen = []
for j in range(n):
    list0.append(0)
for k in range(n):
    listpen.append(0)
sei = 0
pen = 0
for lis in ans:
    if list0[int(lis[0])-1] == 0:
        if lis[1] == "AC":
            sei += 1
            list0[int(lis[0])-1] = 1
        else:
            listpen[int(lis[0])-1] += 1
    else:
        pass
for l in range(n):
    if list0[l] == 1:
        pen += listpen[l]
print(str(sei)+" "+str(pen))


Verdicts: Runtime Error

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

Submission attempts (in order):
n,m=map(int,input().split())
l=[0]*(n+1)
miss=[0]*(n+1)
for _ in range(m):
    p,s=input().split()
    p=int(p)
    if l[p]==0:
        if s=='AC':
            l[p]+=1
        else:
            miss[p]+=1
for i in range(m):
    if l[i]==0 and miss[i]!=0:
        miss[i]=0
a=l.count(1)
b=sum(miss)
print(a,b)

n,m=map(int,input().split())
l=[0]*(n+1)
miss=[0]*(n+1)
for _ in range(m):
    p,s=input().split()
    p=int(p)
    if l[p]==0:
        if s=='AC':
            l[p]+=1
        else:
            miss[p]+=1
for i in range(1,n+1):
    if l[i]==0 and miss[i]!=0:
        miss[i]=0
a=l.count(1)
b=sum(miss)
print(a,b)

Verdicts: Runtime Error

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

Submission attempts (in order):
import sys, heapq
from collections import defaultdict
from itertools import product, permutations, combinations
from bisect import bisect_left 

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

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

ac_num = defaultdict(int) # number of AC : dict
wa_num = defaultdict(int) # number of WA : dict
wass = 0 # number of WA : int
for ps in pS:
    p, S = int(ps[0]), ps[1]
    
    if ac_num[p] == 1:
        continue
    else:
        if S == 'AC':
            ac_num[p] = 1
            
            wass += wa_num[p]
        elif S == 'WA':
            wa_num[p] += 1
    print(ac_num, wa_num)

print(sum(list(ac_num.values())), wass)

import sys, heapq
from collections import defaultdict
from itertools import product, permutations, combinations
from bisect import bisect_left 

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

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

ac_num = defaultdict(int) # number of AC : dict
wa_num = defaultdict(int) # number of WA : dict
wass = 0 # number of WA : int
for ps in pS:
    p, S = int(ps[0]), ps[1]
    
    if ac_num[p] == 1:
        continue
    else:
        if S == 'AC':
            ac_num[p] = 1
            
            wass += wa_num[p]
        elif S == 'WA':
            wa_num[p] += 1
    #print(ac_num, wa_num)

print(sum(list(ac_num.values())), wass)

Verdicts: Wrong Answer

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

Submission attempts (in order):
n, m = map(int,input().split())
cor, war = 0,0
c = [[0,0] for k in range(n)] 
for i in range(m):
  p,s = list(input().split())
  p = int(p)
  if s == "AC" and c[p][0] == 0: 
    cor += 1
    c[p][0] = 1
    war += c[p][1]
  if s == "WA" and c[p][0] == 0: 
    c[p][1] += 1
print(cor,war)    
    

n, m = map(int,input().split())
cor, war = 0,0
c = [[0,0] for k in range(n)] 
for i in range(m):
  p,s = list(input().split())
  p = int(p)-1
  if s == "AC" and c[p][0] == 0: 
    cor += 1
    c[p][0] = 1
    war += c[p][1]
  if s == "WA" and c[p][0] == 0: 
    c[p][1] += 1
print(cor,war)    

Verdicts: Runtime Error

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

Submission attempts (in order):
n, k = map(int, input().split())
l = [False] * n
ans = [0, 0]
for i in range(k):
  p, r = map(input().split())
  if l[int(p) - 1] == False:
    if r == "WA":
      c[0] += 1
    elif r == "AC":
      l[int(p) - 1] = True
      c[1] += 1
print(c[1], c[0])

n, m = map(int, input().split())
l = [False] * n
ans = [0, 0]
for i in range(n):
  p, r = map(input().split())
  if l[int(p) - 1] == False:
    if r == "WA":
      c[0] += 1
    elif r == "AC":
      l[int(p) - 1] = True
      c[1] += 1
print(c[1], c[0])

n, k = map(int, input().split())
l = [False] * n
c = [0, 0]
for i in range(k):
  p, r = map(input().split())
  if l[int(p) - 1] == False:
    if r == "WA":
      c[0] += 1
    elif r == "AC":
      l[int(p) - 1] = True
      c[1] += 1
print(c[1], c[0])

n, m = map(int, input().split())
l = [False] * n
ans = [0, 0]
for i in range(n):
  p, r = map(input().split())
  if l[int(p) - 1] == False:
    if r == "WA":
      c[0] += 1
    elif r == "AC":
      l[int(p) - 1] == True
      c[1] += 1
print(c[1], c[0])

n, m = map(int, input().split( ))
wa = [0] * (n + 1)
acsum = 0
wasum = 0
for i in range(m):
    no_s, res = map(str, input().split( ))
    no = int(no_s)
    if wa[no] != -1 and res == "AC":
      	acsum += 1
        wasum += wa[no]
        wa[no] = -1
    elif wa[no] != -1 and res == "WA":
        wa[no] += 1
print(str(acsum) + " " + str(wasum))


n, m = map(int, input().split())
l = [False] * n
c = [0] * n
ans = [0, 0]
for i in range(m):
  p, r = map(str, input().split())
  if l[int(p) - 1] == False:
    if r == "WA":
      c[int(p) - 1] += 1
    elif r == "AC":
      l[int(p) - 1] = True
      ans[0] += c[int(p) - 1]
      ans[1] += 1
print(ans[1], ans[0])

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
# input
N, M = map(int, input().split())


AC_cnt = 0
WA_cnt = 0
AC_questions = []
AC_append = AC_questions.append
for i in range(M):
    P, S = map(str, input().split())

    if not AC_questions or P in AC_questions:
        continue

    if S == "AC":
        AC_cnt += 1
        AC_append(P)
    else:
        WA_cnt += 1

print(AC_cnt, WA_cnt)

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


AC_questions = {}
for i in range(M):
    P, S = map(str, input().split())

    if P not in AC_questions:
        AC_questions[P] = {
            "wa_cnt": 0,
            "ac": False
        }

    if AC_questions[P]["wa_cnt"] is True:
        continue
    elif S == "AC":
        AC_questions[P]["ac"] = True
    # S == "WA"
    else:
        AC_questions[P]["wa_cnt"] += 1
        
AC_cnt = sum([1 for a in AC_questions if a['ac'] is True])
WA_cnt = sum([a["wa_cnt"] for a in AC_questions if a["ac"] is True])

print(AC_cnt, WA_cnt)

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


AC_questions = {}
for i in range(M):
    P, S = map(str, input().split())

    if P not in AC_questions:
        AC_questions[P] = {
            "wa_cnt": 0,
            "ac": False
        }

    if AC_questions[P]["ac"] is True:
        continue
    elif S == "AC":
        AC_questions[P]["ac"] = True
    # S == "WA"
    else:
        AC_questions[P]["wa_cnt"] += 1



target_keys = [key for key in AC_questions.keys() if AC_questions[key]['ac'] is True]
AC_cnt = sum([1 for key in target_keys])
WA_cnt = sum([AC_questions[key]["wa_cnt"] for key in target_keys])

print(AC_cnt, WA_cnt)

Verdicts: Wrong Answer

Runtime Error

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

Submission attempts (in order):
N, M = map(int, input().split())

prob = [[0] * 2 for _ in range(N + 1)]
# print(prob)
ps_list = [[0, 0]]

for i in range(1, M + 1):
    p, s = input().split()
    p = int(p)
    ps_list.append([p, s])
    if s == "AC" and prob[p] != [0, 0]:
        prob[p] = [1, i]


# print(prob)

ac = 0
for item in prob:
    if item[0] == 1:
        ac += 1

penalty = 0
for i in range(1, M + 1):
    p = ps_list[i][0]
    s = ps_list[i][1]
    if s == "WA" and i < prob[p][1]:
        penalty += 1

print(ac, penalty)


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

prob = [[0] * 2 for _ in range(N + 1)]
# print(prob)
ps_list = [[0, 0]]

for i in range(1, M + 1):
    p, s = input().split()
    p = int(p)
    ps_list.append([p, s])
    if s == "AC" and prob[p] == [0, 0]:
        prob[p] = [1, i]


# print(prob)

ac = 0
for item in prob:
    if item[0] == 1:
        ac += 1

penalty = 0
for i in range(1, M + 1):
    p = ps_list[i][0]
    s = ps_list[i][1]
    if s == "WA" and i < prob[p][1]:
        penalty += 1

print(ac, penalty)


Verdicts: Wrong Answer

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

Submission attempts (in order):
n, m = map(int, input().split())
p, s = [], []
for i in range(n):
    pi, si = input().split()
    p.append(int(pi))
    s.append(si)

lst_ac = [0 for i in range(n+1)]
for i in range(n):
    if s[i] == 'AC':
        lst_ac[p[i]] = 1
ans_ac = sum(lst_ac)

out = 0
for i in range(n):
    if s[i] == 'WA' and lst_ac[p[i]] == 1:
        out += 1

print(ans_ac, out)

n, m = map(int, input().split())
p, s = [], []
for i in range(m):
    pi, si = input().split()
    p.append(int(pi))
    s.append(si)

lst_ac = [0 for i in range(n+1)]
for i in range(m):
    if s[i] == 'AC':
        lst_ac[p[i]] = 1
ans_ac = sum(lst_ac)

out = 0
for i in range(m):
    if s[i] == 'WA' and lst_ac[p[i]] == 1:
        out += 1
    if s[i] == 'AC' and lst_ac[p[i]] == 1:
        lst_ac[p[i]] = 2

print(ans_ac, out)

Verdicts: Runtime Error

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

Submission attempts (in order):
a,b=(int(x) for x in input().split())
list = []
t_cnt = 0
f_cnt = 0
for i in range(b):
  s = input().split()
  if s[1] == 'AC':
    if not (s[0] in list):
    	list.append(s[0])
        t_cnt += 1
  else:
    if not (s[0] in list):
      f_cnt += 1
print("{} {}".format(t_cnt, f_cnt))

a,b=map(int,input().split())
list = [0]*a
t_cnt = 0
f_cnt = 0
for i in range(b):
  c, d = map(str,input().split())
  if d == 'AC':
    if list[c-1] == 0:
      list[c-1] = 1
      t_cnt += 1
  else:
    if list[c-1] == 0:
      f_cnt += 1
print("{} {}".format(t_cnt, f_cnt))


a,b=map(int,input().split())
list = [0]*a
t_cnt = 0
f_cnt = 0
for i in range(b):
  c, d = map(str,input().split())
  if d == 'AC':
    if list[c] == 0:
      list[c] = 1
      t_cnt += 1
  else:
    if list[c] == 0:
      f_cnt += 1
print("{} {}".format(t_cnt, f_cnt))

a,b=map(int,input().split())
list = [0]*a
t_cnt = 0
f_cnt = [0]*a
for i in range(b):
  c, d = map(str,input().split())
  x = int(c) - 1
  if list[x] == 0:
    if d == 'AC':
        list[x] = 1
        t_cnt += 1
    else:
        f_cnt[x] += 1
for i in range(a):
  if list[i] ==0:
    f_cnt[i] = 0
print("{} {}".format(t_cnt, sum(f_cnt)))

Verdicts: Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
n, m = map(int, input().split())
p = []
s = []

for i in range(0, m):
    pi, si = map(str, input().split())
    p.append( int(pi) )
    s.append( si )


done = []
for i in range(0,n):
    done.append(False)

wa = 0
ac = 0
for i in range(0, m):
    if not done[p[i]]:
        if s[i] == 'WA':
            wa += 1
        else: # 'AC':
            ac += 1
            done[p[i]] = True

print(ac, wa)


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

for i in range(0, m):
    pi, si = map(str, input().split())
    p.append( int(pi) )
    s.append( si )


done = []
for i in range(0,n):
    done.append(False)
wa_num = []
for i in range(0,n):
    wa_num.append(0)

ac = 0
for i in range(0, m):
    num = p[i] - 1
    if not done[num]:
        if s[i] == 'WA':
            wa_num[num] += 1
        else: # 'AC':
            ac += 1
            done[num] = True

wa = 0
for i in range(0,n):
    if done[i]:
        wa += wa_num[i]

print(ac, wa)


Verdicts: Runtime Error

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

Submission attempts (in order):
N,M= [int(i) for i in input().split()]
tmp=[]
scr=[0]*2
rec=[0]*N
r=0
ts=0
for i in range(M):
        tmp = ([x for x in input().split()])
        q=int(tmp[0])
        if q!=r: ts=0
        if rec[q-1] == 1:
                continue
        else:
                if tmp[1] == 'AC':
                        rec[q-1]=1
                        scr[0]+=1
                        scr[1]+=ts
                        ts=0
                elif tmp[1]=='WA':
                        ts+=1
        r=q

N,M= [int(i) for i in input().split()]
tmp=[]
scr=[0]*2
rec=[0]*N
eec=[0]*N

ts=0
for i in range(M):
        tmp = ([x for x in input().split()])
        q=int(tmp[0])

        if rec[q-1] == 1:
                continue
        else:
                if tmp[1] == 'AC':
                        rec[q-1]=1
                        scr[0]+=1
                        scr[1]+=eec[q-1]
                elif tmp[1]=='WA':
                        eec[q-1]+=1
        
        
print(scr[0],scr[1])


Verdicts: Wrong Answer

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

Submission attempts (in order):
import numpy as np

def solve():
    dp = np.zeros((2, N+1))
#    print(dp)
    ac = 0
    wa = 0
    for i in range(M): 
        if (dp[0][S[i][0]] == 0):
            if(S[i][1] == "WA"):
                dp[1][S[i][0]] += 1
            elif(S[i][1] == "AC"):
                ac += 1
                dp[0][S[i][0]] = 1
                wa += dp[1][S[i][0]]
    print(ac, wa)

if __name__=="__main__":

    N, M = list(map(int, input().split()))
    S = []
    for i in range(M):
        a,b = input().split()
        S.append([int(a), b])
#    print(S)
    
    solve()
    





def solve():
    dp = [0]*(N+1)
    ac = 0
    wa = 0
    for i in range(M):
        if ps[i][1] == "AC":
            if dp[int(ps[i][0])] == 0:
                dp[int(ps[i][0])] = 1
        else:
            if dp[int(ps[i][0])] == 0:
                wa += 1
#    print(dp)
    print(ac, wa)


if __name__ == "__main__":
    N,M = list(map(int, input().split()))
    ps  = [list(map(str, input().split())) for _ in range(M)]  
    solve()


import numpy as np

def solve():
    dp = np.zeros((2, N+1))
#    print(dp)
    ac = 0
    wa = 0
    for i in range(M): 
        if (dp[0][S[i][0]] == 0):
            if(S[i][1] == "WA"):
                dp[1][S[i][0]] += 1
            elif(S[i][1] == "AC"):
                ac += 1
                dp[0][S[i][0]] = 1
                wa += dp[1][S[i][0]]
    print(ac, int(wa))

if __name__=="__main__":

    N, M = list(map(int, input().split()))
    S = []
    for i in range(M):
        a,b = input().split()
        S.append([int(a), b])
#    print(S)
    solve()
    




Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
N, M = [int(i) for i in input().split()]
p_S = [[i for i in input().split()] for _ in range(M)]

ans=[]
AC=0
WA=0

for i in p_S:
  if i[1]=='WA' and i[0] not in ans:
    WA+=1
  elif i[1]=='AC' and i[0] not in ans:
    AC+=1
    ans.append(i[0])

print(ans)

print(AC, WA)

N, M = [int(i) for i in input().split()]
p_S = [[i for i in input().split()] for _ in range(M)]

ans={}
for i in range(1, N+1):
  ans[str(i)]=False

AC=0
WA=0

for i in p_S:
  if i[1]=='WA' and not ans[i[0]]:
    WA+=1
  elif i[1]=='AC' and not ans[i[0]]:
    AC+=1
    ans[i[0]]=True

print(ans)
print(AC, WA)

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

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

print(sum(AC), sum( [AC[i] * WA[i] for i in range(N)] ) )


Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
N, M = map(int, input().split())
A = [input().split for i in range(M)]
cac = 0
cwa = 0

for i in range(1, N + 1):
    for a in A:
        while a[0] == str(i):
            if a[1] == 'WA':
                cwa += 1
            else:
                cac += 1
                break
        while a[0] == str(i):
            A.remove(a)
print(cac, cwa)

n, m = map(int, input().split())
a = [input().split() for i in range(m)]
wa =[0]*n 
ac = [0]*n

for i in range(m):
    if a[i][1] == 'AC':
      ac[int(a[i][0])-1] = 1
    else:
      if ac[int(a[i][0])-1]==0:
        wa[int(a[i][0])-1] +=1
cnt1, cnt2= 0,0
for i in range(n):
  if ac[i] ==1:
    cnt1 += ac[i]
    cnt2 += wa[i]
        
print(cnt1, cnt2)

Verdicts: Runtime Error

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

Submission attempts (in order):
n, m = map(int, input().split())
p, s = [], []
cor, pen = 0, 0
for _ in range(m):
    li = input().split()
    p.append(int(li[0]))
    s.append(li[1])
for j in range(n):
    corFlag = False
    for i in range(m):
        if (p[i] == j + 1):
            if (s[i] == 'WA' and (not corFlag)):
                pen += 1
            else:
                cor += 1
                corFlag = True
print(cor, pen)

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

hasAC, pena = [0] * n, [0] * n

for i in range(m):
    li = input().split()
    p = int(li[0]) - 1
    s = li[1]
    if hasAC[p]: continue
    if s == 'AC': hasAC[p] = 1
    else: pena[p] += 1
AC, pena_sum = 0, 0
for i in range(n):
    AC += hasAC[i]
    if hasAC[i]: pena_sum += pena[i]
print(AC, pena_sum)

Verdicts: Wrong Answer

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

Submission attempts (in order):
N, M = map(int, input().split())
p = [list(map(str, input().split())) for _ in range(M)]
aclst = [0] * (N + 1)
cntw = 0
cnta = 0
tmpw = 0
for i in range(M):
    if aclst[int(p[i][0])] == 0:
        if p[i][1] == 'WA':
            tmpw += 1
        else:
            cnta += 1
            cntw += tmpw
            aclst[int(p[i][0])] = 1
            

print(cnta, cntw)

N, M = map(int, input().split())
p = [list(map(str, input().split())) for _ in range(M)]
aclst = [0] * (N + 1)
walst = [0] * (N + 1)
cntw = 0
cnta = 0
for i in range(M):
    if aclst[int(p[i][0])] == 0:
        if p[i][1] == 'WA':
            walst[int(p[i][0])] += 1
        else:
            cnta += 1
            cntw += walst[int(p[i][0])]
            aclst[int(p[i][0])] = 1


print(cnta, cntw)

Verdicts: Wrong Answer

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

Submission attempts (in order):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

acCount = 0
waCount = 0
check = [0] * n
waCheck = [0] * n

for i in range(m):
    p, s = map(str, input().split())
    # print(p,s)
    p = int(p)
    if (check[p - 1] == 0):
        if (s == 'WA'):
            waCheck[p - 1] += 1

        else:
            acCount += 1
            waCheck += waCheck[p - 1]

            check[p - 1] = 1
    else:
        continue

print(acCount, waCount)


import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

acCount = 0
waCount = 0
check = [0] * n
waCheck = [0] * n

for i in range(m):
    p, s = map(str, input().split())
    # print(p,s)
    p = int(p)
    if (check[p - 1] == 0):
        if (s == 'WA'):
            waCheck[p - 1] += 1

        else:
            acCount += 1
            waCount += waCheck[p - 1]

            check[p - 1] = 1
    else:
        continue

print(acCount, waCount)


Verdicts: Runtime Error

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

Submission attempts (in order):
import sys


def resolve(in_):
    N, M = map(int, next(in_).split())
    PS = tuple(line.strip().split() for line in in_)
    
    ac = set()
    wa = {}

    for p, s in PS:
        if s == 'AC':
            ac.add(p)
        if s == 'WA' and p not in ac:
            wa[p] = wa.setdefault(p, 0) + 1

    penalties = 0
    for k, v in wa.items:
        if k in ac:
            penalties += v
    
    return '{} {}'.format(len(ac), penalties)


def main():
    answer = resolve(sys.stdin)
    print(answer)


if __name__ == '__main__':
    main()


import sys


def resolve(in_):
    N, M = map(int, next(in_).split())
    PS = tuple(line.strip().split() for line in in_)
    
    ac = set()
    wa = {}

    for p, s in PS:
        if s == 'AC':
            ac.add(p)
        if s == 'WA' and p not in ac:
            wa[p] = wa.setdefault(p, 0) + 1

    penalties = 0
    for k, v in wa.items:
        if k in ac:
            penalties += v
    
    return '{} {}'.format(len(ac), penalties)


def main():
    answer = resolve(sys.stdin)
    print(answer)


if __name__ == '__main__':
    main()


import sys


def resolve(in_):
    N, M = map(int, next(in_).split())
    PS = tuple(line.strip().split() for line in in_)
    
    ac = set()
    wa = {}

    for p, s in PS:
        if s == 'AC':
            ac.add(p)
        if s == 'WA' and p not in ac:
            wa[p] = wa.setdefault(p, 0) + 1

    penalties = 0
    for k, v in wa.items():
        if k in ac:
            penalties += v
    
    return '{} {}'.format(len(ac), penalties)


def main():
    answer = resolve(sys.stdin)
    print(answer)


if __name__ == '__main__':
    main()


Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
n,m = map(int, input().split())

ac = [False]*n
c_ac = 0
c_wa = 0

for _ in range(m):
    pi,si = input().split()
    pi = int(pi)
    
    if ac[pi] == False:
        if si == 'WA':
            c_wa += 1
        elif si == 'AC':
            c_ac += 1
            ac[pi] = True

print(c_ac, c_wa)

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

ac = [False]*n
c_ac = 0
c_wa = 0
wa = [0]*n
for _ in range(m):
    pi,si = input().split()
    pi = int(pi) - 1
    
    if ac[pi] == False:
        if si == 'WA':
            wa[pi] += 1
        elif si == 'AC':
            c_ac += 1
            c_wa += wa[pi]
            ac[pi] = True

print(c_ac, c_wa)

Verdicts: Runtime Error

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

Submission attempts (in order):
N,M=map(int,input().split())
A=[[] for i in range(N)]
for i in range(M):
    Pi,Si=map(str,input().split())
    Pi=int(Pi)
    A[Pi-1].append(Si)

nAC=0
nWA=0
for i in range(N):
    if len(A[i])==0:
        pass
    else:
        j=0 
        while A[i][j]=="WA":
            nWA+=1
            j+=1
            if j>len(A[i]):
                break
            else:
                pass
        if A[i][j]=="AC":
            nAC+=1
        else:
            pass
print("{:1},{:2}".format(nAC,nWA))



print("<input>") #
N,M=map(int,input().split())
A=[[] for i in range(N)]
for i in range(M):
    Pi,Si=map(str,input().split())
    Pi=int(Pi)
    A[Pi-1].append(Si)

print("<test>") #
print("A=",A) #

nAC=0
nWA=0
inWA=0
for i in range(N):
    if len(A[i])==0:
        pass
    else:
        j=0 
        while A[i][j]=="WA":
            inWA+=1
            nWA+=1
            if j==len(A[i])-1:
                nWA-=inWA
                break
            else:
                pass
            j+=1
        if A[i][j]=="AC":
            nAC+=1
        else:
            pass
        inWA=0
        
print("<ans>") #
print("{:1}{:2}".format(nAC,nWA))



#print("<input>") #
N,M=map(int,input().split())
A=[[] for i in range(N)]
for i in range(M):
    Pi,Si=map(str,input().split())
    Pi=int(Pi)
    A[Pi-1].append(Si)

#print("<test>") #
#print("A=",A) #

nAC=0
nWA=0
inWA=0
j=0
for i in range(N):
    #print("i=",i) #
    if len(A[i])==0:
        pass
    else: 
        while A[i][j]=="WA":
            inWA+=1
            nWA+=1
            #print("j=",j) #
            #print("inWA=",inWA) #
            #print("nWA=",nWA) #
            if j==len(A[i])-1:
                nWA-=inWA
                break
            else:
                pass
            j+=1
        if A[i][j]=="AC":
            nAC+=1
        else:
            pass
        inWA=0
        j=0
        #print("inWA=",inWA) #
        #print("nWA=",nWA) #
        

#print("<ans>") #
print("{0} {1}".format(nAC,nWA))

Verdicts: Runtime Error

Wrong Answer

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

Submission attempts (in order):
N,M = map(int,input().split())
box = [0]*N
cor = 0
fal = 0

for i in range(M):
  p,s = input().split()
  p = int(p)
  s = str(s)
  
  if s == "WA":
    if box[p-1] != -1:
      box[p-1] += 1
  else:
    if box[p-1] != -1:
      cor += 1
      fal = box[p-1]
      box[p-1] = -1

print(cor,fal)
     

  

N,M = map(int,input().split())
box = [0]*N
cor = 0
fal = 0

for i in range(M):
  p,s = input().split()
  p = int(p)
  s = str(s)
  
  if s == "WA":
    if box[p-1] != -1:
      box[p-1] += 1
  else:
    if box[p-1] != -1:
      cor += 1
      fal += box[p-1]
      box[p-1] = -1

print(cor,fal)
     

Verdicts: Wrong Answer

Accepted