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):

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

N = int(input())
for i in range(N):
  c[input().strip()] += 1

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

Solution (Python):
n = int(input())
dic = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}

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

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

Solution (Python):
N=int(input())
d={'AC':0,'WA':0,'TLE':0,'RE':0}
for _ 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']))

Solution (Python):
N = int(input())
s = []
for _ in range(N):
    s.append(input().strip())

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

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

print(f'AC x {ac}')
print(f'WA x {wa}')
print(f'TLE x {tle}')
print(f'RE x {re}')

Solution (Python):
N = int(input())
dic = {one:0 for one in ['AC', 'WA', 'TLE', 'RE']}
for _ in range(N):
    dic[input()]+=1
    
for key in ['AC', 'WA', 'TLE', 'RE']:
    print(key, 'x', dic[key])

Solution (Python):
n=int(input())
s=[input() for i in range(n)]
ct=[0]*4
for i in range(n):
  if s[i]=='AC':
    ct[0]+=1
  elif s[i]=='WA':
    ct[1]+=1
  elif s[i]=='TLE':
    ct[2]+=1
  else:
    ct[3]+=1
a1=['AC','x',str(ct[0])]
a2=['WA','x',str(ct[1])]
a3=['TLE','x',str(ct[2])]
a4=['RE','x',str(ct[3])]
print(' '.join(a1))
print(' '.join(a2))
print(' '.join(a3))
print(' '.join(a4))

Solution (Python):
import sys
from collections import Counter

def read_int():
    line = sys.stdin.readline().rstrip('\n')
    return int(line)

def read_int_list():
    line = sys.stdin.readline().rstrip('\n')
    return [int(e) for e in line.split(' ')]

N = read_int()
subs = []
for _ in range(N):
    subs.append(sys.stdin.readline().rstrip('\n'))

c = Counter(subs)

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

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
    elif s == "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 = [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):
n = int(input())

from collections import defaultdict

d = defaultdict(int)

for _ in range(n):
    s = input()
    d[s] += 1
print("AC x ", d["AC"])
print("WA x ", d["WA"])
print("TLE x ", d["TLE"])
print("RE x ", d["RE"])

Solution (Python):
n=int(input())
s=[input() for i in range(n)]
from collections import Counter
c=Counter(s)
print("AC","x",c["AC"])
print("WA","x",c["WA"])
print("TLE","x",c["TLE"])
print("RE","x",c["RE"])

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

d = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}
for _ in range(N):
    s = str(input())
    d[s] += 1

for key, value in d.items():
    print(f'{key} x {value}')

Solution (Python):
n = int(input())
li = [0]*4
lia = ["AC","WA","TLE","RE"]
for i in range(n):
    a = input()
    if a == "AC":
        li[0] += 1
    if a == "WA":
        li[1] += 1
    if a == "TLE":
        li[2] += 1
    if a == "RE":
        li[3] += 1
for i in range(4):
    print(str(lia[i])+" x "+str(li[i]))

Solution (Python):
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
cnt = Counter(S)
print("AC x {}".format(cnt['AC']))
print("WA x {}".format(cnt['WA']))
print("TLE x {}".format(cnt['TLE']))
print("RE x {}".format(cnt['RE']))

Solution (Python):
from collections import Counter 

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

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

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

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

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

for r in ['AC', 'WA', 'TLE', 'RE']:
    print('{} x {}'.format(r, S.count(r)))

Solution (Python):
from collections import Counter
N = int(input())
ct = Counter([input() for _ in range(N)])
print('AC x ' + str(ct['AC']))
print('WA x ' + str(ct['WA']))
print('TLE x ' + str(ct['TLE']))
print('RE x ' + str(ct['RE']))

Solution (Python):
import sys
sys.setrecursionlimit(10**8)
stdin = sys.stdin


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


def naa(N): return [na() for _ in range(N)]


def ns(): return stdin.readline().rstrip()  

N = ni()
status = ["AC","WA","TLE","RE"]
cnt = [0,0,0,0]
for _ in range(N):
    s = ns()
    for i in range(4):
        if s == status[i]:
            cnt[i] += 1


for i in range(4):
    print(status[i] + " x " + str(cnt[i]))

Solution (Python):
N = int(input())
ans = {"AC":0,"WA":0,"TLE":0,"RE":0}
for i in range(N):
    state = input()
    ans[state] += 1
for key,val in ans.items():
    print(f"{key} x {val}")

Solution (Python):
from collections import Counter

import sys
input = sys.stdin.readline

N = int(input())

S = []
for i in range(N):
    s = input()
    S.append(s[:-1])

cc = Counter(S)

for v in ('AC', 'WA', 'TLE', 'RE'):
    print('{} x {}'.format(v, cc[v]))

Solution (Python):
import sys
read = sys.stdin.read
readline = sys.stdin.readline
from itertools import accumulate
from collections import deque
from math import sqrt
from collections import defaultdict
def main():
    n = int(input())
    cnt = defaultdict(int)
    for _ in range(n):
        s = input()
        cnt[s] += 1
    print('AC x ', end='')
    print(cnt['AC'])
    print('WA x ', end='')
    print(cnt['WA'])
    print('TLE x ', end='')
    print(cnt['TLE'])
    print('RE x ', end='')
    print(cnt['RE'])
if __name__ == '__main__':
    main()

Solution (Python):
N=int(input())
ac,wa,tl,re=0,0,0,0
for n in range(N):
  s=input()
  if s=='AC':
    ac+=1
  elif s=='WA':
    wa+=1
  elif s=='TLE':
    tl+=1
  else:
    re+=1
print('AC x {0}'.format(ac))
print('WA x {0}'.format(wa))
print('TLE x {0}'.format(tl))
print('RE x {0}'.format(re))

Solution (Python):
from collections import Counter
import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10**8)


def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split())


def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip())


def main():
    n = gete(int)
    s = []
    for _ in range(n):
        s.append(gete())

    c = Counter(s)

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


if __name__ == "__main__":
    main()

Solution (Python):
from collections import defaultdict
dic = defaultdict(lambda:0)

N = int(input())

for _ 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):
import math
import collections
import fractions
import itertools
import functools
import operator

def solve():
    n = int(input())
    s = [input() for i 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")))
    return 0

if __name__ == "__main__":
    solve()

Solution (Python):
N = int(input())
S = []
for i in range(N):
    S.append(str(input()))
from collections import Counter

c = Counter(S)
print('AC x',c['AC'])
print('WA x',c['WA'])
print('TLE x',c['TLE'])
print('RE x',c['RE'])

Solution (Python):


import copy
import random
import bisect 
import fractions 
import math
import sys
import collections
from decimal import Decimal 

mod = 10**9+7
sys.setrecursionlimit(mod) 

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

N = int(input())
S = [0 for i in range(N)]
ans = {
    "AC":0,
    "WA":0,
    "TLE":0,
    "RE":0
}
for i in range(N):
    S[i] = str(input())
    ans[S[i]] += 1

for key in ans.keys():
    print(key + " x " + str(ans[key]))

Solution (Python):



import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

N = int(input())
d = Counter()
for n in range(N):
    tmp = input()
    d[tmp] += 1
for key in ['AC', 'WA', 'TLE', 'RE']:
    print("{} x {}".format(key, d[key]))

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

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

    ac = 0
    wa = 0
    tle = 0
    re = 0
    for i in range(n):
        if s[i] == 'AC':
            ac += 1
        elif s[i] == 'WA':
            wa += 1
        elif s[i] == 'TLE':
            tle += 1
        elif s[i] == 'RE':
            re += 1

    print(f'AC x {ac}')
    print(f'WA x {wa}')
    print(f'TLE x {tle}')
    print(f'RE x {re}')


if __name__ == '__main__':
    main()

Solution (Python):
from collections import Counter
N = int(input())
c = Counter()
for _ in range(N):
    s = input()
    c[s] += 1

for i in ["AC", "WA", "TLE", "RE"]:
    print(i, "x", c[i])

Solution (Python):
N=int(input())
from collections import defaultdict
dic=defaultdict(int)
for _ in range(N):
    dic[input()]+=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())
S = [input() for _ in range(N)]

C_ac = 0
C_wa = 0
C_tle = 0
C_re = 0
for s in S:
    if s == 'AC':
        C_ac += 1
    elif s == 'WA':
        C_wa += 1
    elif s == 'TLE':
        C_tle += 1
    elif s == 'RE':
        C_re += 1

print(f'AC x {C_ac}')
print(f'WA x {C_wa}')
print(f'TLE x {C_tle}')
print(f'RE x {C_re}')

Solution (Python):
n=int(input())
ans=[0]*4
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):


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

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

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

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

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 " + str(ac))
print("WA x " + str(wa))
print("TLE x " + str(tle))
print("RE x " + str(re))

Solution (Python):
import sys
input = sys.stdin.readline
from collections import Counter
N = int(input())
S = [input().strip() for i in range(N)]

cnt = Counter(S)

print('AC x '+str(cnt['AC']))
print('WA x '+str(cnt['WA']))
print('TLE x '+str(cnt['TLE']))
print('RE x '+str(cnt['RE']))

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 {}'.format(ans[0]))
print('WA x {}'.format(ans[1]))
print('TLE x {}'.format(ans[2]))
print('RE x {}'.format(ans[3]))

Solution (Python):
def main():
    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(f"AC x {ac}")
    print(f"WA x {wa}")
    print(f"TLE x {tle}")
    print(f"RE x {re}")

if __name__ == "__main__":
    main()

Solution (Python):
from collections import defaultdict
n = int(input())
smap = defaultdict(lambda:0)
for _ in range(n):
  s = input()
  smap[s]+=1
for s in ["AC","WA","TLE","RE"]:
  print(s+" x "+str(smap[s]))

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

def solve():
    codes = ['AC', 'WA', 'TLE', 'RE']
    N = int(readline())
    count = {code: 0 for code in codes}
    for i in range(N):
        a = readline().rstrip()
        count[a] += 1
    
    for code in codes:
        print(f'{code} x {count[code]}')


solve()

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

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

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

Solution (Python):

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

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

Solution (Python):
import math

n = int(input())
d = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
for i in range(n):
    inp = input()
    if inp in d:
        d[inp] += 1

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

Solution (Python):

from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right

def main():
    N = int(input())
    ans = [0,0,0,0]
    for _ 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 '+str(ans[0]))
    print('WA x '+str(ans[1]))
    print('TLE x '+str(ans[2]))
    print('RE x '+str(ans[3]))


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
a = list(input() for i in range(n))
ac = 0
wa = 0
tle = 0
re = 0

for i in range(n):
    if a[i] == 'AC':
        ac += 1
    elif a[i] == 'WA':
        wa += 1
    elif a[i] == '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))

Solution (Python):
ac = 0
wa = 0
tle = 0
re = 0

n = int(input())

for _ in range(n):
    result = input()
    if result == "AC":
        ac += 1
    if result == "WA":
        wa += 1
    if result == "TLE":
        tle += 1
    if result == "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 Counter

def main():
    n = int(input())
    lst = []
    for _ in range(n):
        lst.append(input())
    c = Counter(lst)

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

if __name__ == "__main__":
    main()

Solution (Python):
from collections import defaultdict
d = defaultdict(int)
for _ in range(int(input())):
    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"]))

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

Solution (Python):









def solve():
    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(f'AC x {ac}')
    print(f'WA x {wa}')
    print(f'TLE x {tle}')
    print(f'RE x {re}')


def main():
    solve()


if __name__ == "__main__":
    main()

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

def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
    AC = WA = TLE = RE = 0
    N = Z()
    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))

    return

if __name__ == '__main__':
    main()

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

c=Counter(S)

print('AC x {}'.format(c['AC']))

print('WA x {}'.format(c['WA']))
print('TLE x {}'.format(c['TLE']))
print('RE x {}'.format(c['RE']))

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
    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))

Solution (Python):
import math
import sys
from itertools import permutations
input = sys.stdin.readline

arr=[0]*4
N=int(input())
for i in range(N):
    s=input()
    if s[-1]=="\n":
        s=s[:-1]
    if s=='AC':
        arr[0]+=1
    elif s=='WA':
        arr[1]+=1
    elif s=='TLE':
        arr[2]+=1
    elif s=='RE':
        arr[3]+=1

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

Solution (Python):
from collections import Counter
N = int(input())
C = Counter()
for i in range(N):
    si = input()
    C[si] += 1
for s in ['AC', 'WA', 'TLE', 'RE']:
    print(s, 'x', C[s])

Solution (Python):
n = int(input())
s = [input() for _ in range(n)]
ans = [0,0,0,0]
for i in s:
    if i=="AC":
        ans[0] += 1
    elif i=="WA":
        ans[1] += 1
    elif i=="TLE":
        ans[2] += 1
    else:
        ans[3] += 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]))

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

S = [input() for _ in [0]*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"))

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

for k,v in d.items():
  print(k, "x",v)

Solution (Python):
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
c = Counter(S)


print(f'AC x {c.get("AC", 0)}')
print(f'WA x {c.get("WA", 0)}')
print(f'TLE x {c.get("TLE", 0)}')
print(f'RE x {c.get("RE", 0)}')

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

print("AC x {}".format(s.count("AC")))
print("WA x {}".format(s.count("WA")))
print("TLE x {}".format(s.count("TLE")))
print("RE x {}".format(s.count("RE")))

Solution (Python):
import sys
from collections import defaultdict, Counter, namedtuple, deque
import itertools
import functools
import bisect
import heapq
import math


MOD = 10 ** 9 + 7




n = int(input())
d = defaultdict(int)
for i in range(n):
    s = input()
    d[s] += 1

for a in ["AC", "WA", "TLE", "RE"]:
    print(f"{a} x {d[a]}")

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
  elif s=="RE":
    re+=1
print("AC x",ac)
print("WA x",wa)
print("TLE x",tle)
print("RE x",re)

Solution (Python):
def resolve():
    N = int(input())
    S = [input() for _ in range(N)]
    ans = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
    for s in S:
        ans[s] += 1
    for key in ans:
        print(key + " x " + str(ans[key]))


resolve()

Solution (Python):
N = int(input())
S = []
dic = { "AC": 0, "WA":0, "TLE": 0, "RE": 0}
for _ in range(N):
    i = input()
    dic[i] += 1
print(f"AC x {dic['AC']}")
print(f"WA x {dic['WA']}")
print(f"TLE x {dic['TLE']}")
print(f"RE x {dic['RE']}")

Solution (Python):



from collections import Counter, deque, defaultdict






import sys

def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]

def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))

sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1

INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)


N = iIn()
S = sInLV(N)

n_ac = 0
n_wa = 0
n_tle = 0
n_re = 0
for i in range(N):
    if S[i] == 'AC':
        n_ac += 1
    elif S[i] == 'WA':
        n_wa += 1
    elif S[i] == 'TLE':
        n_tle += 1
    else:
        n_re += 1

print('AC x', n_ac)
print('WA x', n_wa)
print('TLE x', n_tle)
print('RE x', n_re)

Solution (Python):

import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub


import sys


buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()

def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, S):
    c = Counter(S)
    print('AC x %d'% c['AC'])
    print('WA x %d' % c['WA'])
    print('TLE x %d' % c['TLE'])
    print('RE x %d' % c['RE'])


def main():
    N = read_int()
    S = [read_str() for _ in range(N)]
    (slv(N, S))


if __name__ == '__main__':
    main()

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

N = int(input())
Sss = [input().rstrip() for _ in range(N)]

cnt = Counter(Sss)


ress = ['AC', 'WA', 'TLE', 'RE']
for res in ress:
    print(res + ' x ' + str(cnt[res]))

Solution (Python):
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"))

Solution (Python):
N = int(input())
c = [0,0,0,0]
for i 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(10**7) 
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right

from collections import deque, defaultdict


from collections import Counter

from itertools import accumulate,combinations,permutations

from heapq import heapify,heappop,heappush


from functools import reduce,lru_cache

from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printe(*x):print("
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def main():
    mod = 1000000007
    

    N = int(input())
    
    
    L = tuple(input() for i in range(N)) 
    
    s=Counter(L)
    print("AC x "+str(s["AC"]))
    print("WA x "+str(s["WA"]))
    print("TLE x "+str(s["TLE"]))
    print("RE x "+str(s["RE"]))






if __name__ == "__main__":
    main()

Solution (Python):
import sys
from collections import defaultdict

def solve():
    input = sys.stdin.readline
    N = int(input())
    C = defaultdict(int)
    for _ in range(N):
        s = input().strip("\n")
        C[s] += 1
    P = ["AC", "WA", "TLE", "RE"]

    for p in P:
        print(p + " x " + str(C[p]))
    return 0

if __name__ == "__main__":
    solve()

Solution (Python):
n = int(input())
a,w,t,r = 0,0,0,0
for i in range(n):
    s = 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):
n = int(input())
l = []
for _ 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):
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 ans:
  print("{} x {}".format(s, ans[s]))

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

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

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


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

Solution (Python):



from collections import Counter

def ri():
    return int(input())

def rl():
    return list(input().split())

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

def main():
    n = ri()
    cnt = Counter()
    for i in range(n):
        s = input()
        cnt[s] += 1
    for st in ["AC", "WA", "TLE", "RE"]:
        print("{} x {}".format(st, cnt[st]))
    


if __name__ == '__main__':
    main()

Solution (Python):
import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
INF = 10 ** 18
MOD = 10**9+7

Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()

n = int(ri())
dic = {'AC': 0,'WA': 0,'TLE': 0,'RE': 0}
for i in range(n):
    s = ri()
    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())
d = {'AC': 0, 'WA': 0, 'TLE': 0, 'RE': 0}
for i 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']))

Solution (Python):
n=int(input())
account=0
wacount=0
tlecount=0
recount=0
for i in range(n):
  s=input()
  if s=='AC':
    account+=1
  if s=='WA':
    wacount+=1
  if s=='TLE':
    tlecount+=1
  if s=='RE':
    recount+=1
print('AC x',account)
print('WA x',wacount)
print('TLE x',tlecount)
print('RE x',recount)

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

cnt = [0] * 4

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

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

Solution (Python):
N = int(input())
s = []
for i in range(N):
    s.append(input())
ans = [0 for _ in range(4)]
for i in range(N):
    if s[i] == "AC":  ans[0] += 1
    elif s[i] == "WA":  ans[1] += 1
    elif s[i] == "TLE":   ans[2] += 1
    else:  ans[3] += 1
print("AC x {}".format(ans[0]))
print("WA x {}".format(ans[1]))
print("TLE x {}".format(ans[2]))
print("RE x {}".format(ans[3]))