Problem:


Score : 200 points

Problem Statement

Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.

The problem has N test cases.

For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively.

See the Output section for the output format.

Constraints

1 \leq N \leq 10^5

S_i is AC, WA, TLE, or RE.

Input

Input is given from Standard Input in the following format:

N
S_1
\vdots
S_N

Output

Let C_0, C_1, C_2, and C_3 be the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively. Print the following:

AC x C_0
WA x C_1
TLE x C_2
RE x C_3

Sample Input 1

6
AC
TLE
AC
AC
WA
TLE

Sample Output 1

AC x 3
WA x 1
TLE x 2
RE x 0

We have 3, 1, 2, and 0 test case(s) for which the verdict is AC, WA, TLE, and RE, respectively.

Sample Input 2

10
AC
AC
AC
AC
AC
AC
AC
AC
AC
AC

Sample Output 2

AC x 10
WA x 0
TLE x 0
RE x 0



Sample input:
6
AC
TLE
AC
AC
WA
TLE


Sample output:
AC x 3
WA x 1
TLE x 2
RE x 0

Submission status: Accepted

Solution code:
#B
n = int(input())
s = [input() for _ in range(n)]
ac = 0
wa = 0
tle = 0
re = 0

for i in s:
    if i == "AC":
        ac += 1
    if i == "WA":
        wa += 1
    if i == "TLE":
        tle += 1
    if i == "RE":
        re += 1

print('AC x' , ac)
print('WA x' , wa)
print('TLE x' , tle)
print('RE x' , re)

Submission status: Accepted

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

from collections import defaultdict
from heapq import heappush, heappop
import sys

sys.setrecursionlimit(10**6)
input = sys.stdin.buffer.readline
INF = 10 ** 9 + 1  # sys.maxsize # float("inf")


def debug(*x):
    print(*x, file=sys.stderr)


def solve(SOLVE_PARAMS):
    "void()"
    pass


def main():
    from collections import Counter
    N = int(input())
    XS = Counter([input().strip().decode("ascii") for i in range(N)])
    for key in "AC WA TLE RE".split():
        v = XS.get(key, 0)
        print(f"{key} x {v}")


T1 = """
6
AC
TLE
AC
AC
WA
TLE
"""


def test_T1():
    """
    >>> as_input(T1)
    >>> main()
    AC x 3
    WA x 1
    TLE x 2
    RE x 0

    """


def _test():
    import doctest
    doctest.testmod()


def as_input(s):
    "use in test, use given string as input file"
    import io
    global read, input
    f = io.StringIO(s.strip())

    def input():
        return bytes(f.readline(), "ascii")

    def read():
        return bytes(f.read(), "ascii")


USE_NUMBA = False
if (USE_NUMBA and sys.argv[-1] == 'ONLINE_JUDGE') or sys.argv[-1] == '-c':
    print("compiling")
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('solve', solve.__doc__.strip().split()[0])(solve)
    cc.compile()
    exit()
else:
    input = sys.stdin.buffer.readline
    read = sys.stdin.buffer.read

    if (USE_NUMBA and sys.argv[-1] != '-p') or sys.argv[-1] == "--numba":
        # -p: pure python mode
        # if not -p, import compiled module
        from my_module import solve  # pylint: disable=all
    elif sys.argv[-1] == "-t":
        _test()
        sys.exit()
    elif sys.argv[-1] != '-p' and len(sys.argv) == 2:
        # input given as file
        input_as_file = open(sys.argv[1])
        input = input_as_file.buffer.readline
        read = input_as_file.buffer.read

    main()

Submission status: Accepted

Solution code:
from collections import Counter

N = int(input())
S = [input() for i in range(N)]

C = Counter(S)

print('AC x',C['AC'])
print('WA x',C['WA'])
print('TLE x',C['TLE'])
print('RE x',C['RE'])

Submission status: Accepted

Solution code:
def solution(A):
	print('AC x ', A.count('AC'))
	print('WA x ', A.count('WA'))
	print('TLE x ', A.count('TLE'))
	print('RE x ', A.count('RE'))

if __name__ == "__main__":
	t = int(input())
	A = []
	for _ in range(t):
		A.append(input())
	solution(A)

Submission status: Accepted

Solution code:
n = int(input())
s = []
for i in range(n):
  s_ = input()
  s.append(s_)
  
res = ['AC', 'WA', 'TLE', 'RE']
for i in res:
  print(i,'x', s.count(i))

Submission status: Accepted

Solution code:
N = int(input())
dict = {}
dict['AC'] = 0
dict['WA'] = 0
dict['TLE'] = 0
dict['RE'] = 0

for i in range(N):
  s = input()
  dict[s] += 1
  
print('AC x',dict['AC'])
print('WA x',dict['WA'])
print('TLE x',dict['TLE'])
print('RE x',dict['RE'])

Submission status: Accepted

Solution code:
n = int(input())
l = [input() for _ in range(n)]

a = ["AC", "WA", "TLE", "RE"]
b = []

for s in a:
    b.append(l.count(s))

d = ["AC x ", "WA x ", "TLE x ", "RE x "]

for i, di in enumerate(d):
    print("{}{}".format(d[i], b[i]))

Submission status: Accepted

Solution code:
n=int(input())
a=0
b=0
c=0
d=0
for i in range(n):
    s=input()
    if s=='AC':
        a+=1
    elif s=='WA':
        b+=1
    elif s=='TLE':
        c+=1
    else:
        d+=1
print('AC x',a)
print('WA x',b)
print('TLE x',c)
print('RE x',d)

Submission status: Accepted

Solution code:
N = int(input())
d = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
for _ in range(N):
    S = input()
    d[S] += 1
print('AC x ' + str(d['AC']))
print('WA x ' + str(d['WA']))
print('TLE x ' + str(d['TLE']))
print('RE x ' + str(d['RE']))

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    res=[]
    ac=0
    wa=0
    tl=0
    re=0
    for i in range(n):
        s=STR()
        if s=='AC':
            ac+=1
        elif s=='WA':
            wa+=1
        elif s=='TLE':
            tl+=1
        else:
            re+=1
    print('AC x '+str(ac))
    print('WA x '+str(wa))
    print('TLE x '+str(tl))
    print('RE x '+str(re))
    
if __name__ == '__main__':
    do()

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
S = Counter(S)
for key in ['AC', 'WA', 'TLE', 'RE']:
    if key not in S:
        print(f'{key} x 0')
    else:
        print(f'{key} x {S[key]}')

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    N = int(input())
    num_dict = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}
    for i in range(N):
        num_dict[input()] += 1
    for k, v in num_dict.items():
        print(f'{k} x {v}')

Submission status: Accepted

Solution code:
from sys import stdin
from collections import Counter
N = int(stdin.readline().rstrip())
S = []
for i in range(N):
    s = (stdin.readline().rstrip())
    S.append(s)

c = Counter(S)
print("AC x " + str(c["AC"]))
print("WA x " + str(c["WA"]))
print("TLE x " + str(c["TLE"]))
print("RE x " + str(c["RE"]))

Submission status: Accepted

Solution code:
N = int(input())
S = [input() for i in range(N)]
ans = {'AC':0, 'WA': 0, 'TLE':0, 'RE': 0,}

for i in S:
    ans[i] += 1

for i, j in zip(ans.keys(), ans.values()):
    print(i + ' x ' + str(j))

Submission status: Accepted

Solution code:
n = int(input())
s = [input() for _ in range(n)]

import collections
cnt = collections.Counter(s)
for t in ['AC', 'WA', 'TLE', 'RE']:
    print(t, 'x', cnt[t])

Submission status: Accepted

Solution code:
N = int(input())
result = [0, 0, 0, 0]
for _ in range(N):
    S = input()
    if S == "AC":
        result[0] += 1
    elif S == "WA":
        result[1] += 1
    elif S == "TLE":
        result[2] += 1
    elif S == "RE":
        result[3] += 1
tag = ["AC", "WA", "TLE", "RE"]
for i in range(4):
    print("{0} x {1}".format(tag[i], result[i]))

Submission status: Accepted

Solution code:
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan,sqrt
import cmath as cma
import copy as cp
import sys
import re
import bisect as bs
sys.setrecursionlimit(10**7)
EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf
MOD = 10**9 + 7

def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def barr(n): return [False for _ in range(n)]
def adj(n): return [[] for _ in range(n)]

n = iinput()
arr = [sinput() for i in range(n)]
cnt = col.Counter(arr)
print("AC x",cnt["AC"])
print("WA x",cnt["WA"])
print("TLE x",cnt["TLE"])
print("RE x",cnt["RE"])

Submission status: Accepted

Solution code:
n = int(input())

ac = 0
wa = 0
tle = 0
re = 0

for i in range(n):
    s = input()

    if s == 'AC':
        ac += 1
    elif s == 'WA':
        wa += 1
    elif s == 'TLE':
        tle += 1
    elif s == 'RE':
        re += 1

print('AC x ' + str(ac))
print('WA x ' + str(wa))
print('TLE x ' + str(tle))
print('RE x ' + str(re))

Submission status: Accepted

Solution code:
import sys
import numpy as np
import random
from decimal import Decimal
import itertools
import re
import bisect
from collections import deque, Counter
from functools import lru_cache
from numba import jit

sys.setrecursionlimit(10**9)
INF = 10**13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
def SERIES(n): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ')
def GRID(h,w): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ').reshape(h,-1)[:,:w]
def GRIDfromString(h,w): return np.frombuffer(sys.stdin.buffer.read(), 'S1').reshape(h,-1)[:,:w]
MOD = 1000000007

def main():
	n = I()
	counts = [0,0,0,0]
	for _ in range(n):
		s = S()
		if s == 'AC':
			counts[0] += 1
		elif s == 'WA':
			counts[1] += 1
		elif s == 'TLE':
			counts[2] += 1
		elif s == 'RE':
			counts[3] += 1
	print('AC x '+str(counts[0]))
	print('WA x '+str(counts[1]))
	print('TLE x '+str(counts[2]))
	print('RE x '+str(counts[3]))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
S = [input() for i in range(n)]
scores = ["AC", "WA", "TLE", "RE"]

for score in scores:
    print(f"{score} x {S.count(score)}")

Submission status: Accepted

Solution code:
AC = 0
WA = 0
TLE = 0
RE = 0

N = int(input())
for _ in range(N):
    S = input()
    if S == 'AC':
        AC += 1
    elif S == 'WA':
        WA += 1
    elif S == 'TLE':
        TLE += 1
    else:
        RE += 1

print('AC' + ' x ' + str(AC))
print('WA' + ' x ' + str(WA))
print('TLE' + ' x ' + str(TLE))
print('RE' + ' x ' + str(RE))

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
s = [input() for _ in range(n)]

count = Counter(s)
m = ["AC","WA","TLE","RE"]
for i in m:
  print(i,"x",count[i])

Submission status: Accepted

Solution code:
count = {'AC':0,'WA':0,'TLE':0,'RE':0}
N = int(input())
for _ in range(N):
    S = str(input())
    count[S] += 1
print('AC x {}'.format(count['AC']))
print('WA x {}'.format(count['WA']))
print('TLE x {}'.format(count['TLE']))
print('RE x {}'.format(count['RE']))

Submission status: Accepted

Solution code:
N = int(input())


judge = { j: 0 for j in ['AC', 'WA', 'TLE', 'RE' ]}

for i in range(N):
  j = input()
  judge[j] += 1

for (j, n) in judge.items():
  print(j, 'x', n)

Submission status: Accepted

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


def solve(N: int, S: "List[str]"):
    ac, wa, re, tle = 0, 0, 0, 0
    for s in S:
        if s == "AC":
            ac += 1
        elif s == "WA":
            wa += 1
        elif s == "RE":
            re += 1
        else:
            tle += 1
    
    print("AC x " + str(ac))
    print("WA x " + str(wa))
    print("TLE x " + str(tle))
    print("RE x " + str(re))

    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = [next(tokens) for _ in range(N)]  # type: "List[str]"
    solve(N, S)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
ac = 0
wa = 0
tle = 0
re = 0

for _ in range(N):
    s = input()
    if s == 'AC':
        ac+=1
    if s == 'WA':
        wa+=1
    if s == 'TLE':
        tle+=1
    if s == 'RE':
        re+=1

print('AC x '+str(ac))
print('WA x '+str(wa))
print('TLE x '+str(tle))
print('RE x '+str(re))

Submission status: Accepted

Solution code:
d={'AC':0,'WA':0,'TLE':0,'RE':0}
n=int(input())
for i in range(0,n):
    d[input()]+=1
for j in d:
    print(j,"x",d[j])

Submission status: Accepted

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

N = int(input())
S = [0] * N
for i in range(N):
    S[i] = input()

lst = ['AC', 'WA', 'TLE', 'RE']
ans = [0, 0, 0, 0]

for i in range(N):
    ans[lst.index(S[i])] += 1

for s, a in zip(lst, ans):
    print(s, 'x', a)

Submission status: Accepted

Solution code:
import collections
N = int(input())
counter = collections.defaultdict(lambda: 0)
for _ in range(N):
  counter[input()] += 1
for t in ['AC', 'WA', 'TLE', 'RE']:
  print('%s x %d' % (t, counter[t]))

Submission status: Accepted

Solution code:
n = int(input())
S = [input() for _ in range(n)]
ac = 0
wa = 0
tle = 0
re = 0
for s in S:
  if s == "AC":
    ac += 1
  elif s == "WA":
    wa += 1
  elif s == "TLE":
    tle += 1
  else:
    re += 1 

print("AC x", ac)
print("WA x", wa)
print("TLE x", tle)
print("RE x", re)

Submission status: Accepted

Solution code:
n = int(input())
s = [input() for i in range(n)]

print("AC x",s.count("AC"))
print("WA x",s.count("WA"))
print("TLE x",s.count("TLE"))
print("RE x",s.count("RE"))

Submission status: Accepted

Solution code:
n = int(input())
ans = [0]*4
for i in range(n):
	s = input()
	if s == 'AC':
		ans[0] += 1
	if s == 'WA':
		ans[1] += 1
	if s == 'TLE':
		ans[2] += 1
	if s == 'RE':
		ans[3] += 1
print('AC x',ans[0])
print('WA x',ans[1])
print('TLE x',ans[2])
print('RE x',ans[3])

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
cnt = Counter(S)
print('AC x', cnt['AC'])
print('WA x', cnt['WA'])
print('TLE x', cnt['TLE'])
print('RE x', cnt['RE'])

Submission status: Accepted

Solution code:
n = int(input())
j = [0]*4

for i in range(n):
    s = input()
    if s == 'AC':
        j[0] += 1
    elif s == 'WA':
        j[1] += 1
    elif s == 'TLE':
        j[2] += 1
    else:
        j[3] += 1

print('AC x', j[0])
print('WA x', j[1])
print('TLE x', j[2])
print('RE x', j[3])

Submission status: Accepted

Solution code:
X = open(0).read().split()
d = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
for x in X[1:]:
    d[x] += 1
print('AC x ' + str(d['AC']))
print('WA x ' + str(d['WA']))
print('TLE x ' + str(d['TLE']))
print('RE x ' + str(d['RE']))

Submission status: Accepted

Solution code:
dic = {"AC":0,"TLE":0,"WA":0,"RE":0}
N = int(input())
for i in range(N):
    s = input()
    dic[s]+=1

for an in["AC","WA","TLE","RE"]:
    print("{} x {}".format(an,dic[an]))

Submission status: Accepted

Solution code:
n = int(input())

lst = []

for i in range(n): lst.append(input())

print('AC','x',lst.count('AC'))
print('WA','x',lst.count('WA'))
print('TLE','x',lst.count('TLE'))
print('RE','x',lst.count('RE'))

Submission status: Accepted

Solution code:
n=int(input())
d={"AC":0,"WA":0,"TLE":0,"RE":0}
for i in range(n):
    d[input()]+=1
print("AC x "+str(d["AC"]))
print("WA x "+str(d["WA"]))
print("TLE x "+str(d["TLE"]))
print("RE x "+str(d["RE"]))