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

Solution (Python):
N=int(input())
ans_list = [0]*4

for i in range(N):
    S = input()
    if(S=="AC"):
        ans_list[0]+=1
    elif(S=="WA"):
        ans_list[1]+=1
    elif(S=="TLE"):
        ans_list[2]+=1
    else:
        ans_list[3]+=1

print("AC x "+str(ans_list[0]))
print("WA x "+str(ans_list[1]))
print("TLE x "+str(ans_list[2]))
print("RE x "+str(ans_list[3]))

Solution (Python):

import sys


def solve(N: int, S: "List[str]"):
    r = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
    for s in S:
        r[s] += 1

    print(f'AC x {r["AC"]}')
    print(f'WA x {r["WA"]}')
    print(f'TLE x {r["TLE"]}')
    print(f'RE x {r["RE"]}')
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    S = [next(tokens) for _ in range(N)]  
    solve(N, S)

if __name__ == '__main__':
    main()

Solution (Python):


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

ac = 0
wa = 0
tle = 0
re = 0
for _ in range(N):
    s, = map(str, input().split())
    if s=='AC':
        ac += 1
    elif s=='WA':
        wa += 1
    elif s=='TLE':
        tle += 1
    elif s=='RE':
        re += 1

print("AC x {}".format(ac))
print("WA x {}".format(wa))
print("TLE x {}".format(tle))
print("RE x {}".format(re))

Solution (Python):
from collections import defaultdict


N = int(input())
ans = defaultdict(int)
for _ in range(N):
    ans[input()] += 1
for string in ("AC", "WA", "TLE", "RE"):
    print(f"{string} x {ans[string]}")

Solution (Python):
N = int(input())
D = {"AC":0, "WA":0, "TLE":0, "RE":0}

for _ in range(N):
  S = input()
  D[S] += 1

for i, x in D.items():
  print(i+" x "+str(x))

Solution (Python):
N = int(input())
c_ac = 0
c_wa = 0
c_tle = 0
c_re = 0

for _ in range(N):
    s = input()
    if s == 'AC':
        c_ac += 1
    elif s == 'WA':
        c_wa += 1
    elif s == 'TLE':
        c_tle += 1
    else:
        c_re += 1
        
print('AC x '+str(c_ac))
print('WA x '+str(c_wa))
print('TLE x '+str(c_tle))
print('RE x '+str(c_re))

Solution (Python):
n = int(input())
ss = [input() for _ in range(n)]
ans = {}
ans['AC'] = 0
ans['WA'] = 0
ans['TLE'] = 0
ans['RE'] = 0
for s in ss:
    ans[s] += 1

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

Solution (Python):
def main():
    from builtins import int, map, list, print
    from collections import defaultdict
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = (lambda: (sys.stdin.readline()).rstrip())
    input_list = (lambda: input().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    d = defaultdict(lambda: 0)
    N = input_number()
    for i in range(N):
        s = input()
        d[s] += 1
    print(f"AC x {d['AC']}")
    print(f"WA x {d['WA']}")
    print(f"TLE x {d['TLE']}")
    print(f"RE x {d['RE']}")


if __name__ == '__main__':
    main()

Solution (Python):



import itertools

def main():
    n = int(input())
    ac = 0
    wa = 0
    tle = 0
    re = 0
    for _ in range(n):
        s = str(input())
        if s == "AC":
            ac += 1
        elif s == "WA":
            wa += 1
        elif s == "TLE":
            tle += 1
        elif s == "RE":
            re += 1
    print("AC x", ac)
    print("WA x", wa)
    print("TLE x", tle)
    print("RE x", re)

def count_tento(l, cur):
    count = 0
    for v in l:
        if v > cur:
            count += 1
    return count

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

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
ans = [0,0,0,0]
for i in range(n):
    s = input()
    if s == "AC":
        ans[0] += 1
    elif s == "WA":
        ans[1] += 1
    elif s == "TLE":
        ans[2] += 1
    else:
        ans[3] += 1
print("AC x",ans[0])
print("WA x",ans[1])
print("TLE x",ans[2])
print("RE x",ans[3])

Solution (Python):
from collections import defaultdict
N = int(input())
c = defaultdict(int)
for i in range(N):
    s = input().strip()
    c[s] += 1

print("AC x", c["AC"])
print("WA x", c["WA"])
print("TLE x", c["TLE"])
print("RE x", c["RE"])

Solution (Python):
def main():
    n, *s = open(0).read().split()
    ac, wa, tle = s.count('AC'), s.count('WA'), s.count('TLE')
    re = int(n) - (ac + wa + tle)
    print('AC x', ac)
    print('WA x', wa)
    print('TLE x', tle)
    print('RE x', re)


if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
AC=0
WA=0
TLE=0
RE=0
for i in range(n):
    a=input()
    if a=="AC":
        AC+=1
    elif a=="TLE":
        TLE+=1
    elif a=="WA":
        WA+=1
    else:
        RE+=1

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

Solution (Python):
import collections as cl

N = int(input())
S_list = []
for i in range(N) :
    S_list.append(input())

c = cl.Counter(S_list)

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

Solution (Python):
n = int(input())
d = {
    "AC": 0, 
    "WA": 0, 
    "TLE": 0, 
    "RE": 0, 
}
s = [input() for _ in range(n)]
for x in s:
    d[x] += 1

for k in d:
    print(k, "x", d[k])

Solution (Python):
from sys import stdin, setrecursionlimit

setrecursionlimit(10 ** 7)

from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict, Counter
from itertools import combinations, permutations, combinations_with_replacement
from itertools import accumulate
from math import ceil, sqrt, pi, radians, sin, cos

MOD = 10 ** 9 + 7
INF = 10 ** 18

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





cnt = [0] * 4
for s in S:
    if s == "AC":
        cnt[0] += 1
    elif s == "WA":
        cnt[1] += 1
    elif s == "TLE":
        cnt[2] += 1
    elif s == "RE":
        cnt[3] += 1

print("AC x", cnt[0])
print("WA x", cnt[1])
print("TLE x", cnt[2])
print("RE x", cnt[3])

Solution (Python):
from collections import OrderedDict
import sys
input = sys.stdin.readline



def main():
    N = int(input().strip())
    d = OrderedDict({
        "AC": 0,
        "WA": 0,
        "TLE": 0,
        "RE": 0
    })

    for _ in range(N):
        s = input().strip()
        d[s] += 1

    for k, v in d.items():
        print("{} x {}".format(k, v))
    return


if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
ac=0
wa=0
tle=0
re=0

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 {}'.format(ac))
print('WA x {}'.format(wa))
print('TLE x {}'.format(tle))
print('RE x {}'.format(re))

Solution (Python):
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(sys.stdin.readline())
def ria(): return list(map(int, sys.stdin.readline().split()))
def ws(s): sys.stdout.write(s); sys.stdout.write('\n')
def wi(n): sys.stdout.write(str(n)); sys.stdout.write('\n')
def wia(a, sep=' '): sys.stdout.write(sep.join([str(x) for x in a])); sys.stdout.write('\n')


def solve(n, s):
    c0 = sum(1 for si in s if si == 'AC')
    c1 = sum(1 for si in s if si == 'WA')
    c2 = sum(1 for si in s if si == 'TLE')
    c3 = sum(1 for si in s if si == 'RE')
    ws("AC x {0}".format(c0))
    ws("WA x {0}".format(c1))
    ws("TLE x {0}".format(c2))
    ws("RE x {0}".format(c3))


def main():
    n = ri()
    s = []
    for i in range(n):
        s.append(rs())
    solve(n, s)


if __name__ == '__main__':
    main()

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

for i in range(N):
  c = input()
  if(c=="AC"):
    ac += 1
  elif(c=="WA"):
    wa += 1
  elif(c=="TLE"):
    tle += 1
  elif(c=="RE"):
    re += 1

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

Solution (Python):
n = int(input())
s = [0]*n
for i in range(n):
    s[i] = input()
import collections
c = collections.Counter(s)
print(str("AC x ")+str(c["AC"]))
print(str("WA x ")+str(c["WA"]))
print(str("TLE x ")+str(c["TLE"]))
print(str("RE x ")+str(c["RE"]))

Solution (Python):
n = int(input())
L = list(str(input()) for _ in range(n))
print('AC x', L.count('AC'))
print('WA x', L.count('WA'))
print('TLE x', L.count('TLE'))
print('RE x', L.count('RE'))

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

a = 0
b = 0
c = 0
d = 0

for i in range(n):
    if s[i] == "AC":
        a += 1
    if s[i] == "WA":
        b += 1
    if s[i] == "TLE":
        c += 1
    if s[i] == "RE":
        d += 1

print("AC x", a)
print("WA x", b)
print("TLE x", c)
print("RE x", d)

Solution (Python):
from collections import Counter
import sys
def input():
	return sys.stdin.readline()[:-1]
n = int(input())
c = Counter([input() for _ in range(n)])

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

Solution (Python):
N = int(input())
from collections import defaultdict
S = defaultdict(int)
for _ in range(N):
    tmp = input()
    S[tmp] += 1
R = ['AC', 'WA', 'TLE', 'RE']
for r in R:
    ans = r + ' x ' + str(S[r])
    print(ans)

Solution (Python):
N = int(input())
S = [str(input()) for _ in range(N)]

A = 0
W = 0
T = 0
R = 0

for i in range(N):
    if S[i] == "AC":
        A += 1
    elif S[i] == "WA":
        W += 1
    elif S[i] == "TLE":
        T += 1
    elif S[i] == "RE":
        R += 1

print("AC x",A)
print("WA x",W)
print("TLE x",T)
print("RE x",R)

Solution (Python):
N=int(input())
S=[input() for _ in range(N)]
a=S.count("AC")
b=S.count("WA")
c=S.count("TLE")
d=S.count("RE")

print("AC","x",a)
print("WA","x",b)
print("TLE","x",c)
print("RE","x",d)

Solution (Python):
def resolve():
    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
        else:
            re += 1
    print("AC x", ac)
    print("WA x", wa)
    print("TLE x", tle)
    print("RE x", re)
resolve()

Solution (Python):
from sys import stdin
from sys import setrecursionlimit
import math
setrecursionlimit(10 ** 7)

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

a = s.count("AC")
b = s.count("WA")
c = s.count("TLE")
d = s.count("RE")

print("AC x {}".format(a))
print("WA x {}".format(b))
print("TLE x {}".format(c))
print("RE x {}".format(d))

Solution (Python):
import bisect
import sys
import math
from collections import deque
from heapq import heappush, heappop

def sRaw():
    return input().rstrip("\r")


def iRaw():
    return int(input())


def ssRaw():
    return input().split()


def isRaw():
    return list(map(int, ssRaw()))


INF = 1 << 29


DIV = 998244353

def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def CONV_TBL(max, mod=DIV):
    fac, finv, inv = [0]*max, [0]*max, [0]*max
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, max):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod - inv[mod % i] * (mod//i) % mod
        finv[i] = finv[i-1]*inv[i] % mod

    class CONV:
        def __init__(self):
            self.fac = fac
            self.finv = finv
            pass

        def ncr(self, n, k):
            if(n < k):
                return 0
            if(n < 0 or k < 0):
                return 0
            return fac[n]*(finv[k]*finv[n-k] % DIV) % DIV

    return CONV()


def cumsum(As):
    s = 0
    for a in As:
        s += a
        yield s


sys.setrecursionlimit(200005)


def dijkstra(G,start=0):
    heap = []
    cost = [INF]*len(G)
    heappush(heap,(0,start))
    while len(heap)!=0:
        c,n = heappop(heap)
        if cost[n] !=INF:
            continue
        cost[n]=c
        for e in G[n]:
            ec,v = e
            if cost[v]!=INF:
                continue
            heappush(heap,(ec+c,v))
    return cost


def main():
    N= iRaw()
    d= {}
    ks=["AC", "WA", "TLE", "RE"]
    for k in ks:
        d[k]=0
    for _ in range(N):
        s = sRaw()
        if s not in d:
            d[s]=0
        else:
            d[s]+=1
    for k in ks:
        print(k,"x",d[k])
main()

Solution (Python):
def main():
    n = int(input())
    verdicts = ['AC','WA','TLE','RE']
    count = [0]*4
    for i in range(n):
        s = input()
        count[verdicts.index(s)] += 1

    for i in range(4):
        print(verdicts[i],'x',count[i])

        

main()

Solution (Python):

import sys


def solve(N: int, S: "List[str]"):
    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 {0}".format(ac))
    print("WA x {0}".format(wa))
    print("TLE x {0}".format(tle))
    print("RE x {0}".format(re))
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    S = [next(tokens) for _ in range(N)]  
    solve(N, S)

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0

for i in range(n):
  hoge = input()
  if hoge == "AC":
    ac += 1
  elif hoge == "WA":
    wa += 1
  elif hoge == "TLE":
    tle += 1
  elif hoge == "RE":
    re += 1
    
print("AC x {}".format(ac))
print("WA x {}".format(wa))
print("TLE x {}".format(tle))
print("RE x {}".format(re))

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

ac = 0
wa = 0
tle = 0
re = 0
for si in s:
    if si == "AC":
        ac += 1
    elif si == "WA":
        wa += 1
    elif si == "TLE":
        tle += 1
    else:
        re += 1

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

Solution (Python):
from math import gcd

from math import factorial as f

from math import ceil, floor, sqrt
import math

import bisect
import re
import heapq

from copy import deepcopy
import itertools
from itertools import permutations

from sys import exit

ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(map(int, input().split()))

yes = "Yes"
no = "No"


def main():
    res = ['AC', 'WA', 'TLE', 'RE']
    n = ii()
    ans = [0 for i in range(4)]
    for i in range(n):
        tmp = input()
        for j in range(4):
            if tmp == res[j]:
                ans[j] += 1

    print('AC x ' + str(ans[0]))
    print('WA x ' + str(ans[1]))
    print('TLE x ' + str(ans[2]))
    print('RE x ' + str(ans[3]))


main()

Solution (Python):
from collections import Counter


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    N = read_int()
    counter = Counter()
    for _ in range(N):
        counter[input().strip()] += 1
    for verdict in ['AC', 'WA', 'TLE', 'RE']:
        print(f'{verdict} x {counter[verdict]}')


if __name__ == '__main__':
    solve()

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
li = [rr() for _ in range(n)]
a = 0
b = 0
c = 0
d = 0
for i in li:
  if i == 'AC':
    a += 1
  elif i == 'TLE':
    b += 1
  elif i == 'RE':
    c += 1
  else:
    d += 1
print(f'AC x {a}')
print(f'WA x {d}')
print(f'TLE x {b}')
print(f'RE x {c}')

Solution (Python):
N = int(input())
c = [0, 0, 0, 0]
for k in range(N):
    s = input()
    if s == 'AC':
        c[0] +=1
    elif s == 'WA':
        c[1] +=1
    elif s == 'TLE':
        c[2] +=1
    else:
        c[3] +=1

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

Solution (Python):
import sys
sys.setrecursionlimit(1000000000)
import math
from math import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations, chain
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp



class UnionFindEx:
    def __init__(self, size):
        
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    
        self.roots[r2] = r1
        return True

Yes = 'Yes'
No = 'No'


def main():
    d = defaultdict(int)
    for _ in range(ii()):
        d[input()] += 1
    for a in ('AC', 'WA', 'TLE', 'RE'):
        print(a, 'x', d[a])





main()

Solution (Python):
N = int(input())
num = [0,0,0,0]

for i in range(N):
  S = input()
  if(S == "AC"):
    num[0] += 1
  elif(S == "WA"):
    num[1] += 1
  elif(S == "TLE"):
    num[2] += 1
  else:
    num[3] += 1

print("AC x %d"%num[0])
print("WA x %d"%num[1])
print("TLE x %d"%num[2])
print("RE x %d"%num[3])

Solution (Python):
import math

n=int(input())
f=["AC","WA","TLE","RE"]
d=[0]*4
for i in range(n):
        s=input()
        if s=="AC":
                d[0]+=1
        elif s=="WA":
                d[1]+=1
        elif s=="TLE":
                d[2]+=1
        else:
                d[3]+=1
for i in range(len(f)):
        print(f[i],"x",d[i])

Solution (Python):
import sys
sys.setrecursionlimit(10**6)

n = int(input())




s = [input() for _ in range(n)]





d = {'AC':0,'WA':0,'TLE':0,'RE':0}

for i in s:
    d[i] = d.get(i,0) + 1

for k,v in d.items():
    print(k+' x '+str(v))

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

print("AC x "+str(dic["AC"]))
print("WA x "+str(dic["WA"]))
print("TLE x "+str(dic["TLE"]))
print("RE x "+str(dic["RE"]))

Solution (Python):
N = int(input())
c0 = 0
c1 = 0
c2 = 0
c3 = 0
for i in range(N):
    s = input()
    if s == "AC":
        c0 +=1
    elif s=="WA":
        c1 += 1
    elif s=="TLE":
        c2 += 1
    else:
        c3 += 1
print(f"AC x {c0}")
print(f"WA x {c1}")
print(f"TLE x {c2}")
print(f"RE x {c3}")

Solution (Python):
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
  else:
    RE += 1
print('AC','x', AC)
print('WA','x', WA)
print('TLE','x', TLE)
print('RE','x', RE)

Solution (Python):
n=int(input())

lis=[0,0,0,0]

for i in range(n):
    si=input()
    if si=="AC":
        lis[0]+=1
    elif si=="WA":
        lis[1]+=1
    elif si=="TLE":
        lis[2]+=1
    else:
        lis[3]+=1

print("AC x ",lis[0])
print("WA x ",lis[1])
print("TLE x ",lis[2])
print("RE x ",lis[3])

Solution (Python):



def main():
    N = int(input())
    S = [None] * N
    for i in range(N):
        S[i] = input()

    a, b, c, d = "AC", "WA", "TLE", "RE"
    dic = {x: 0 for x in [a, b, c, d]}

    for s in S:
        dic[s] += 1

    for k, v in dic.items():
        print(f"{k} x {v}")


main()

Solution (Python):















mod = int(1e9+7)

INF = 1<<50

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

def main():
    n = int(input())
    ans = {'AC':0,'WA':0,'TLE':0,'RE':0}
    for i in range(n):
        s = input()
        ans[s] += 1
    print('AC x',ans['AC'])
    print('WA x',ans['WA'])
    print('TLE x',ans['TLE'])
    print('RE x',ans['RE'])
    return

if __name__=='__main__':
    main()

Solution (Python):
import sys
input = sys.stdin.readline

N = int(input())

a, b, c, d = 0, 0, 0, 0

for _ in range(N):
    S = input().rstrip()
    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)

Solution (Python):
n = int(input())
res = []

for _ in range(n):
    res.append(input())
    
print('AC x', res.count('AC'))
print('WA x', res.count('WA'))
print('TLE x', res.count('TLE'))
print('RE x', res.count('RE'))

Solution (Python):
n = int(input())
count = {"AC":0,"WA":0,"TLE":0,"RE":0}
for i in range(n):
    s = input()
    count[s] += 1
for i,j in count.items():
    print(i + " x " +str(j))

Solution (Python):

def main():
  n = int(input())

  D = {
    "AC": 0,
    "WA": 0,
    "TLE": 0,
    "RE": 0,
  }

  for _ in range(n):
    D[input()] += 1

  for k, c in D.items():
    print(f"{k} x {c}")


main()

Solution (Python):
import sys, os, math, bisect, itertools, collections, heapq, queue

from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    dict = defaultdict(int)
    dict['AC'] = 0
    dict['WA'] = 0
    dict['TLE'] = 0
    dict['RE'] = 0

    for n in range(N):
        S = iss()
        dict[S] += 1

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


if __name__ == '__main__':
    main()

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

Solution (Python):


n = int(input())
s = ["" for _ in range(n)]

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

nAC = s.count("AC")
nWA = s.count("WA")
nTLE = s.count("TLE")
nRE = s.count("RE")

print("AC x", nAC)
print("WA x", nWA)
print("TLE x", nTLE)
print("RE x", nRE)

Solution (Python):
n = int(input())
a = 0
w = 0
t = 0
r = 0
for _ in range(n):
    s = str(input())
    if s == 'AC':
        a += 1
    elif s == 'WA':
        w += 1
    elif s == 'TLE':
        t += 1
    else:
        r += 1
print('AC x', a)
print('WA x', w)
print('TLE x', t)
print('RE x', r)

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
import random
from decimal import *

input = sys.stdin.readline

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007




def main():
	N = inputInt()

	ans = {}
	ans["AC"] = 0
	ans["WA"] = 0
	ans["TLE"] = 0
	ans["RE"] = 0

	for i in range(N):
		s = inputStr()
		ans[s] += 1

	print("AC x {}".format(ans["AC"]))
	print("WA x {}".format(ans["WA"]))
	print("TLE x {}".format(ans["TLE"]))
	print("RE x {}".format(ans["RE"]))



if __name__ == "__main__":
	main()

Solution (Python):
n = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0

for i in range(n):
    data = input()
    if data == 'AC':
        AC += 1
    elif data == 'WA':
        WA += 1
    elif data == 'TLE':
        TLE += 1
    elif data == 'RE':
        RE += 1

print('AC', 'x', AC)
print('WA', 'x', WA)
print('TLE', 'x', TLE)
print('RE', 'x', RE)

Solution (Python):

import sys


def solve(N: int, S: "List[str]"):
    result = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
    for s in S:
        result[s] += 1
    print('AC x %d' % result['AC'])
    print('WA x %d' % result['WA'])
    print('TLE x %d' % result['TLE'])
    print('RE x %d' % result['RE'])
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    S = [next(tokens) for _ in range(N)]  
    solve(N, S)

if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
a=[input() for i in range(n)]
print('AC','x',str(a.count('AC')))
print('WA','x',str(a.count('WA')))
print('TLE','x',str(a.count('TLE')))
print('RE','x',str(a.count('RE')))

Solution (Python):
n = int(input())
a = 0
w = 0
t = 0
r = 0
l = []
for i in range(n):
    l.append(input())

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

Solution (Python):


def LI():return list(map(int,input().split()))
def I(): return int(input())
from collections import deque, Counter, defaultdict
from heapq import heappop, heappush



n=I()
s=[input() for _ in range(n)]
sc=Counter(s)
print("AC x {}".format(sc["AC"]))
print("WA x {}".format(sc["WA"]))
print("TLE x {}".format(sc["TLE"]))
print("RE x {}".format(sc["RE"]))

Solution (Python):
N = int(input())
S = [input() for _ in range(N)]

Ans = [0] * 4

for s in S:
    if s == 'AC':
        Ans[0] += 1
    elif s == 'WA':
        Ans[1] += 1
    elif s == 'TLE':
        Ans[2] += 1
    else:
        Ans[3] += 1

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

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    from collections import Counter
    n = int(readline())
    cnt = Counter()
    for i in range(n):
        s = input()
        cnt[s] += 1

    print("AC x {}".format(cnt["AC"]))
    print("WA x {}".format(cnt["WA"]))
    print("TLE x {}".format(cnt["TLE"]))
    print("RE x {}".format(cnt["RE"]))


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
s = [input() for _ in range(n)]
print('AC x '+str(s.count('AC')))
print('WA x '+str(s.count('WA')))
print('TLE x '+str(s.count('TLE')))
print('RE x '+str(s.count('RE')))

Solution (Python):
from collections import defaultdict
N=int(input())

ans_dic=defaultdict(int)
for _ in range(N):
  s=input()
  ans_dic[s]+=1

print("AC x " + str(ans_dic["AC"]))
print("WA x " + str(ans_dic["WA"]))
print("TLE x " + str(ans_dic["TLE"]))
print("RE x " + str(ans_dic["RE"]))

Solution (Python):
N = int(input())

ans = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}

for i in range(N):
    s = input()
    ans[s] += 1

for s in ["AC", "WA", "TLE", "RE"]:
    print(s, " x ", ans[s])

Solution (Python):
def main():
    from collections import Counter
    n = int(input())
    s = []
    for i in range(n):
        t = input()
        s.append(t)

    c = Counter(s)

    for t in ['AC','WA','TLE','RE']:
        print(t,'x',c[t])



main()

Solution (Python):


import sys
input=sys.stdin.readline

def main():
    N=int(input())
    r=["AC","WA","TLE","RE"]
    c=[0]*4
    for i in range(N):
        s=input().strip("\n")
        c[r.index(s)]+=1
    for i in range(4):
        print(r[i],"x",c[i])
    
    
    
if __name__=="__main__":
    main()

Solution (Python):
N = int(input())

li = ["AC","WA", "TLE" , "RE"]
ans = [0 for _ in range(4)]

for i in range(N):
    S = input()
    for j in range(4):
        if li[j]==S:
            ans[j] += 1

for i in range(4):
    print("{} x {}".format(li[i], ans[i]))

Solution (Python):
import sys
input = sys.stdin.readline
from collections import Counter


def read():
    N = int(input().strip())
    S = []
    for i in range(N):
        s = input().strip()
        S.append(s)
    return N, S


def solve(N, S):
    AC = "AC"
    WA = "WA"
    TLE = "TLE"
    RE = "RE"
    D = Counter(S)
    print(AC , "x", D[AC])
    print(WA , "x", D[WA])
    print(TLE , "x", D[TLE])
    print(RE , "x", D[RE])


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Solution (Python):
from collections import Counter
N = int(input())
A = []
for _ in range(N):
  A.append(input())
  
C = Counter(A)

print("AC x " + str(C["AC"]))
print("WA x " + str(C["WA"]))
print("TLE x " + str(C["TLE"]))
print("RE x " + str(C["RE"]))

Solution (Python):
N = int(input())
A = [input() for _ in range(N)]

print('AC x {}'.format(len([x for x in A if x == 'AC'])))
print('WA x {}'.format(len([x for x in A if x == 'WA'])))
print('TLE x {}'.format(len([x for x in A if x == 'TLE'])))
print('RE x {}'.format(len([x for x in A if x == 'RE'])))

Solution (Python):
n = int(input())
d = [0]*4
for _ in range(n):
    s = input()
    if s == 'AC':
        d[0] += 1
    elif s == 'WA':
        d[1] += 1
    elif s == 'TLE':
        d[2] += 1
    else:
        d[3] += 1
print(f"AC x {d[0]}")
print(f"WA x {d[1]}")
print(f"TLE x {d[2]}")
print(f"RE x {d[3]}")