Problem:


Score : 300 points

Problem Statement

A company has N members, who are assigned ID numbers 1, ..., N.

Every member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.

When a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.

You are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.

Constraints

2 \leq N \leq 2 \times 10^5

1 \leq A_i < i

Input

Input is given from Standard Input in the following format:

N
A_2 ... A_N

Output

For each of the members numbered 1, 2, ..., N, print the number of immediate subordinates it has, in its own line.

Sample Input 1

5
1 1 2 2

Sample Output 1

2
2
0
0
0

The member numbered 1 has two immediate subordinates: the members numbered 2 and 3.

The member numbered 2 has two immediate subordinates: the members numbered 4 and 5.

The members numbered 3, 4, and 5 do not have immediate subordinates.

Sample Input 2

10
1 1 1 1 1 1 1 1 1

Sample Output 2

9
0
0
0
0
0
0
0
0
0

Sample Input 3

7
1 2 3 4 5 6

Sample Output 3

1
1
1
1
1
1
0



Sample input:
5
1 1 2 2


Sample output:
2
2
0
0
0

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
N = INT()
A = LIST()
CNT = [0]*N

for i in range(N-1):
	CNT[A[i]-1] += 1

for i in range(N-1):
	print(CNT[i])

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
import collections
c = collections.Counter(a)
x=list(c.values())
#print(x)
for i in range(len(x)):
  print(x[i])
for i in range(n-len(x)):
  print(0)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
out = []
for i in range(1, 5+1):
    if i not in A:
        out.append(0)
    else:
        out.append(A.count(i))
for a in out:
  print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = sorted(list(map(int, input().split())))
least = A[0]
count = 0
result = []
for a in A:
    if a == least:
        count += 1
    else:
        result.append(count)
        least += 1
        count = 1
result.append(count)

length = len(result)
for i in range(N-length):
    result.append(0)

for r in result:
    print(r)

Submission status: Wrong Answer

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

ans = [0]*N
for i in range(N-1):
    ans[A[i]] += 1
for i in range(1,N):
    print(ans[i])

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
import collections
c = collections.Counter(A)
for i in range(1,N+1):
    if not i in c.keys():
        c[i] = 0
for i in c.values():
    print(i)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
buka_num=[]
for i in range(1,len(a)):
  buka_num.append(a.count(i))
buka_num.append(0)
print(buka_num)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [0]+list(map(int, input().split()))
print(a)
ans = [0] * n
for i in range(n):
    if 0 < a[i]:
        ans[a[i]-1] += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[0]*(n)

for i in a:
  b[i]+=1

print(b for _ in range(n-1))

Submission status: Wrong Answer

Solution code:
n=int(input())
a_list=list(map(int,input().split()))
ans=[0]*n
for i in range(n-1):
    ans[i]=a_list.count(i+1)
    print(ans[i])

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(input().split())
for i in range(1,N+1) :
    ans = A.count(i)
    print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
for i in range(len(A)):
    print(A.count(A[i] + 1))

Submission status: Wrong Answer

Solution code:
N=int(input())

A=list(map(int, input().split()))

B=[0]*len(A)

for i in A:
  B[i-1]+=1
  
for i in B:
  print(i)

Submission status: Wrong Answer

Solution code:
n = int(input())
lis = list(map(int,input().split()))
x={};count=0
for i in lis:
    if i not in x:
        x[i] = 1
    else:
        x[i] += 1
for i in list(x.values()):
    print(i)
    count+=1
while(n-count!=0):
    print(0)
    count = count+1

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
tmp2 = 0
for i in range(N+1):
  if(i == 0):
    tmp=A.count(1)
    print(str(tmp))
  else:
    tmp2 = i + 1
    tmp=A.count(tmp2)
    print(str(tmp))

Submission status: Wrong Answer

Solution code:
import sys
from collections import Counter
from typing import Callable, NoReturn, Tuple


def main() -> NoReturn:
    scan: Callable[[], str] = sys.stdin.readline

    n: int = int(scan().rstrip())
    a: Tuple[int] = tuple(int(a_i) for a_i in scan().rstrip().split())

    count: Counter = Counter(a)

    for i in range(n):
        print(count[i])


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
A = list(map(int, input().split()))

c = collections.Counter(A)
print(c)

for i in range(N):
    print(c[i+1])

Submission status: Wrong Answer

Solution code:
n=int(input())
A=[int(y) for y in input().split()]

dic={}

for e in A:
    if e in dic:
        dic[e]+=1
    else:
        dic[e]=1
        
for r in A:
    if (r+1) in dic:
        print(dic[r+1])
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
out = []
for i in range(1, 5+1):
    print(i)
    if i not in A:
        out.append(0)
    else:
        out.append(A.count(i))
for a in out:
  print(a)

Submission status: Wrong Answer

Solution code:
import sys
 
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def get_array(): return list(get_ints())
def input(): return sys.stdin.readline().strip()

n = int(input())
Arr = get_array()

child = [0]*(n)

for index, value in enumerate(Arr, 2):
	child[value] += 1
   
for i in child:
	print(i)

Submission status: Wrong Answer

Solution code:
n,*a,=map(int,open(0).read().split())
d=[0]*n
for i in a:
  d[i-1]+=1
print(*d[1:],sep="\n")

Submission status: Wrong Answer

Solution code:
import collections
N=int(input())
A=list(map(int,input().split()))
a=collections.Counter(A)
for i in range(1,N+1):
  print(a["i"])

Submission status: Wrong Answer

Solution code:
N=int(input())

A=list(map(int, input().split()))

B=[0]*len(A)

for i in A:
  B[i-1]+=1
  
print([i for i in B])

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
import collections
c = collections.Counter(A)
for i in range(N):
    if not i in c.keys():
        c[i] = 0
for i in c.values():
    print(i)

Submission status: Wrong Answer

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

ans = [0 for _ in range(1, N + 1)]

for a in A:
    ans[a] += 1

for i in ans[1:]:
    print(i)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = [0] * (N - 1)
for a in A:
    ans[a-1] += 1
for x in ans:
    print(ans)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

res = defaultdict(list)
n = int(input())
for i, j in zip(range(2, 2+n), map(int, input().split())):
  res[j].append(i)

for k,v in res.items():
  if k != 1:
  	print(len(v))

Submission status: Wrong Answer

Solution code:
n = int(input())

a = list(map(int, input().split()))

import collections
c = collections.Counter(a)

for i in range(n-1):
    num = a[i]
    print(c[num+1])

Submission status: Wrong Answer

Solution code:
N = int(input())
A = sorted(list(map(int,input().split())))
L = [0]*(N+1)
for i in range(N-1):
  L[A[i]] += 1
for l in L:
  print(l)

Submission status: Wrong Answer

Solution code:
import collections

n = int(input())

l = list(map(int, input().split()))

c = collections.Counter(l)

print(c[1])
for i in l:
  print(c[i+1])

Submission status: Wrong Answer

Solution code:
#C
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
m=max(a)
a = Counter(a)
print(a)

for i in range(1, n + 1):
    if i <= m:
        print(a[i])
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
t = int(input())
A = list(map(int,input().split()))
B = [-1]*t
for i in range(t-1):
    B[A[i]-1] += 1
for i in range(t):
    if B[i]!= -1:
      print(B[i]) 
    else:
      print(0)

Submission status: Wrong Answer

Solution code:
import collections
N=int(input())
A=list(map(int,input().split()))
a=collections.Counter(A)
for i in range(N):
  print(a["i"])

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(input().split())
for m in range(1,n+1):
    print(l.count(m))

Submission status: Wrong Answer

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N = INT()
    A = LIST()

    ans = [0] * (N - 1)
    for a in A:
        ans[a-1] += 1

    print(*ans,  sep='\n')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
for i in range(1,len(a)):
  print(a.count(i))
print(0)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
B=[0]*N
for i in range(N-1):
  B[A[i-1]]+=1
for j in B[1:]:
  print(j)

Submission status: Wrong Answer

Solution code:
import collections
n=int(input())
a=list(map(int, input().split()))
c=collections.Counter(a)
for i in range(n):
    print(c[i])

Submission status: Wrong Answer

Solution code:
# from fractions import gcd
# mod = 10 ** 9 + 7
# N = int(input())
# a = list(map(int,input().split()))
# a,b,c = map(int,input().split())
# ans = [0] * N
# math.ceilで切り上げ
# dp = [[0] * 4 for i in range(3)] #2次元配列初期化
# dp = [[[0] * 2 for i in range(3)] for j in range(5)]
# (ord('A'))でASCII出力 Aは65
import math
import numpy as np
import statistics
import string
import sys
from array import array
from collections import deque
from functools import wraps
import time

def intinput():
    return int(input())
def listintinput():
    return list(map(int, input().split()))
def splitintinput():
    return map(int, input().split())
def factorialsurplus(x, y, z):  # xからyまでの階乗をzで割ったあまりを求める
    ret = 1
    for i in range(x, y + 1):
        ret = (ret * i) % z
    return (ret)
def isprime(x):
    if x == 1:
        return False
    if x == 2:
        return True
    sq = int(math.sqrt(x))
    for i in range(2,sq+1):
        if x % i == 0:
            return False
    return True
def hcfnaive(a,b):#最大公約数 math.gcdが使えない時の手段として入れとく。pythonが更新されたらいらなくなるはず
    if(b==0):
        return a
    else:
        return hcfnaive(b,a%b)

N = intinput()
A = listintinput()

joushi = [0] * N
for i in range(N-1):
    joushi[A[i]] += 1
for w in joushi:
    print(w)

Submission status: Wrong Answer

Solution code:
N =int(input())
A = list(map(int, input().split()))
B=[0]*(N-1)
for i in range(1,N-1):
    B[i-1]=A.count(i)
for i in range(N-1):
    print(B[i])

Submission status: Wrong Answer

Solution code:
# C - management

import collections

n = int(input())
A = list(int(x) for x in input().split())

c = collections.Counter(A)

print(c)

for i in range(1, n+1):
    print(c[i])

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = {}
s = list(map(int, input().split()))
for i in range(1, n):
  arr[i] = arr.get(s[i-1], 0) + 1

for i in range(1, n+1):
  print(arr[i] if i in arr else 0)

Submission status: Wrong Answer

Solution code:
import collections
n=int(input())
a=list(map(int,input().split()))
ac=collections.Counter(a)
lac=list(ac.items())
for i in range(n):
    try:
        print(lac[i][1])
    except:
        print(0)

Submission status: Wrong Answer

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

import collections
c = collections.Counter(A)
values, counts = zip(*c.most_common())

ans=[]
for i in range(len(values)):
    ans.append([values[i],counts[i]])

ans.sort()
#print(ans)

t=0
for i in range(1,N+1):
    if t<len(ans):
        if ans[t][0]==i:
            print(ans[t][1])
            t+=1
    else:
        print(0)

Submission status: Wrong Answer

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

G = [0] * (N + 1)
for i, val in enumerate(A):
    G[val] += 1
print(G)

for i in range(1, N + 1):
    print(G[i])

Submission status: Wrong Answer

Solution code:
import collections
N=int(input())
L=list(map(int,input().split()))
for i in range(N):
	L.append(i+1)
S=collections.Counter(L)
#print(S)
for x,y in S.items():
	print(y-1)

Submission status: Wrong Answer

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

a = [0]*N
for i in range(len(A)):
    a[A[i]-1] += 1
    
for j in range(len(A)):
    print(a[A[j]-1])
print(0)

Submission status: Wrong Answer

Solution code:
import math

R = int(input())

ans = 2 * R * math.pi

print(ans)

Submission status: Wrong Answer

Solution code:
import collections 

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

c = collections.Counter(A)
c_s = sorted(c.items(), key=lambda x:x[0])

for i in range(N):
    if(i < len(c_s)):
        print(c_s[i][1])
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
import sys
from collections import Counter
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
c = Counter(A)
k = set(A)
r = set(range(1, N + 1))

for key in r - k:
    c[key] = 0

for v in c.values():
    print(v)

Submission status: Wrong Answer

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

answer_dic={}
for a in alist:
  if a in answer_dic:
    answer_dic[a]+=1
  else:
    answer_dic[a]=1
print(answer_dic)

for i in range(1,N+1):
  if i in answer_dic:
    print(answer_dic[i])
  else:
    print(0)

Submission status: Wrong Answer

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

ans = [0 for i in range(n)]

for i in range(n - 1):
  b = a[i]
  ans[b - 1] = ans[b-1] + 1

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a1=[0]*(n+1)
for i in range(n-1):
    a1[a[i]]+=1
print(a1)
for j in range(1,n+1):
    print(a1[j])

Submission status: Wrong Answer

Solution code:
from collections import Counter
N = int(input())
A = list(map(int, input().split()))

l = Counter(A)

for i in range(N):
  if i in l:
    print(l[i])
  else:
    print(0)

Submission status: Wrong Answer

Solution code:
import sys

n, *a = map(int, sys.stdin.read().split())
print(a)
graph = [[] for _ in range(n)]
for i in range(n - 1):
    graph[a[i]-1].append(i)
def main():
    for i in range(n):
        print(len(graph[i]))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n=int(input()) 
ans=n*6.28
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter

n = int(input())
A = list(map(int, input().split()))

c = Counter(A) 

for i in range(1, n):
  if i in c.keys():
    print(c[i])
  else:
    print(0)

Submission status: Wrong Answer

Solution code:
import sys
from math import factorial
from collections import Counter
from fractions import Fraction
import heapq, bisect, fractions
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
MOD = 10**9 + 7

R = INT()
print(R*2*math.pi)

Submission status: Wrong Answer

Solution code:
'''بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ'''
#codeforces
from collections import Counter
gi = lambda : list(map(int,input().split()))
n, = gi()
occ = Counter(gi())
for k in range(1, n + 1):
	if k not in occ:
		occ[k] = 0
for k in occ:
	print(occ[k])

Submission status: Wrong Answer

Solution code:
N = int(input())
D = {i: [] for i in range(N)}
A = list(map(int, input().split()))
for i in range(N-1):
  D[i].append(A[i]-1)
for i in range(N):
  print(len(D[i]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ki = [[] for i in range(n)]
for i in range(n-1):
    ki[a[i]-1].append(i+1)
    ki[i+1].append(a[i]-1)
for i in range(n):
    if i == 0:
        print(len(ki[i]))
        continue
    print(len(ki[i])-1)
print(ki)

Submission status: Wrong Answer

Solution code:
N=int(input())
X=[0]*N
for a in map(int,input().split()):
  X[a-1]+=1
for i in range(N-1):
  print(X[i])

Submission status: Wrong Answer

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]
N = int(input())
l = list(map(int, input().split()))
ANS = [0]*N

for i in range(N-1):
    k = l[i]
    ANS[k] += 1
for i in range(1,N):
    print(ANS[i])

Submission status: Time Limit Exceeded

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

for i in range(1,N+1):
    count = a.count(i)
    print(count)

Submission status: Time Limit Exceeded

Solution code:
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
for i in range(1,n+1):
  print(Counter(a)[i])

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
  print(a.count(i+1))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans_list = []
no = n + 1
num = list(range(no))
for i in num[1:]:
    ans = a.count(i)
    ans_list.append(ans)
    a = [n for n in a if n != i]
[print(i) for i in ans_list]

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans_list = []
no = n + 1
num = list(range(no))
for i in num[1:]:
    ans = a.count(i)
    ans_list.append(ans)
[print(i) for i in ans_list]

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A = list(map(int,input().split()))
for i in range(1,N+1):
    count = 0
    for j in A:
        if i == j:
            count += 1
    print(count)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A = list(map(int,input().split()))
B = []
for i in range(1,N+1):
    count = 0
    for j in A:
        if i == j:
            count += 1
    print(count)

Submission status: Time Limit Exceeded

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

for i in range(1, N+1):
  print(A.count(i))

Submission status: Time Limit Exceeded

Solution code:
def resolve():
    n = int(input())
    a = tuple(map(int,input().split()))
    for i in range(n):
        print(a.count(i+1))
resolve()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
for i in range(1, N + 1):
    print(A.count(i))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int,input().split()))
c = 0
i = 0
for i in range(N):
  if c < N:
    b = A.count(i + 1)
    print(b)
    c += b
  else:
    print(o)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int,input().split()))
for i in range(N):
  print(A.count(i + 1))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
    print(a.count(i+1))

Submission status: Time Limit Exceeded

Solution code:
import copy
n=int(input())
A=list(map(int,input().split()))

for i in range(n):
    print(A.count(i+1))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = [int(i) for i in input().split()]

for i in range(1, N):
    print(A.count(i))
print(0)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
B = sorted(A)
for i in range(N-1):
    print(B.count(i+1))
print(0)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = [int(i) for i in input().split()]

for i in range(N-1):
    print(A.count(i+1))
print(0)

Submission status: Time Limit Exceeded

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

for i in range(1,n+1):
    b = a.count(i)
    print(b)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

p = list(map(int,input().split()))

for x in range(1,n+1):
  print(p.count(x))

Submission status: Time Limit Exceeded

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

for i in range(1, n + 1):
    print(a.count(i))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
lst = list(map(int,input().split()))
for i in range(n):
  print(lst.count(i + 1))

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    N = int(input())
    A = list(map(int, input().split()))

    for i in range(N):
        print(A.count(i + 1))

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

ans=[]
for i in range(1,n+1):
    b=str(a.count(i))
    ans.append(b)

print('\n'.join(ans))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
B=list(range(1, N + 1))
import copy
for i in B:
    new_A=copy.copy(A)
    while i in new_A:
        new_A.remove(i)
    print(len(A)-len(new_A))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
B=list(range(1, N + 1))
for i in B:
    print(len([j for j in A if j == i]))
    while i in A:
        A.remove(i)

Submission status: Time Limit Exceeded

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

for i in range(1, N+1):
    print(A.count(i))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int, input().split()))
for i in range(1,n+1):
  print(a.count(i))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    print(a.count(i + 1))

Submission status: Time Limit Exceeded

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

for i in range(N):
    print(A.count(i + 1))

Submission status: Time Limit Exceeded

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

for i in range(n):
    print(a.count(i+1))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
for i in range(1, N+1):
  print(A.count(i))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))
for i in range(n):
    print(a.count(i+1))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
B=list(range(1,N+1))
for i in B:
    print(len([j for j in A if j == i]))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
for i in range(1,N+1):
    print(len([j for j in A if j == i]))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
i=1
while i < N+1:
    print(len([j for j in A if j == i]))
    i += 1

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
i=1
while i < N+1:
    if i in A:
        print(len([j for j in A if j == i]))
        A.remove(i)
        i += 1
    else:
        print(0)
        i += 1

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
for i in range(1,N+1):
    print(len([j for j in A if j == i]))
    while i in A:
        A.remove(i)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
for i in range(1,N+1):
    if i in A:
        print(len([j for j in A if j == i]))
        while i in A:
            A.remove(i)
    else:
        print(0)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
for i in range(1,N+1):
    print(len([j for j in A if j==i]))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
for i in range(1,N+1):
    if i in A:
        print(len([j for j in A if j==i]))
    else:
        print(0)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
for i in range(1,N+1):
    newA=list(A)
    if i in newA:
        while i in newA:
            newA.remove(i)
        print(N-1-len(newA))
    else:
        print(N-1-len(newA))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
for i in range(1,N+1):
    newA=list(A)
    if i in newA:
        while i in newA:
            newA.remove(i)
        print(len(A)-len(newA))
    else:
        print(len(A)-len(newA))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
for i in range(1,N+1):
    print(A.count(i))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
l=list(map(int,input().split()))
for i in range(1,n+1):
    print(l.count(i))

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))

ans = []
n = ini()
a = inl()
count = 0
for i in range(1, n+1):
    ans.append(a.count(i))
out(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
number = [a.count(i) for i in range(1,n)]
for j in range(n-1):
  print(number[j])
print(0)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
number = []
for i in range(1,n):
  number.append(a.count(i))
  print(number[i-1])
print(0)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
number = []
for i in range(1,n):
  number.append(a.count(i))
for i in range(n-1):
  print(number[i])
print(0)

Submission status: Time Limit Exceeded

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

b = sorted(a)
for i in range(1, n+1):
    print(b.count(i))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
j = -1
num = 0
for i in range(1,n+1):
    if num != n:
        b = a.count(i)
        print(b)
        num += b
    else:
        j = i
        break
if j != -1:
    for h in range(n-j):
        print(0)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
for i in range(1,n+1):
    print(a.count(i))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))
b = [0]*n
for i in range(n):
    for j in range(len(a)):
        if i + 1 == a[j]:
            b[i] += 1
    print(b[i])

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))
for i in range(1,n + 1):
    print(a.count(i))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
# li=[0]*n
a.sort()
cnt=0

for i in range(n):
    print(a.count(i+1))

Submission status: Time Limit Exceeded

Solution code:
a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(1, a[0]+1):
  print(b.count(i))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
for i in range(1, n+1):
    if i in a:
        print(a.count(i))
    else:
        print(0)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
for i in range(1, n+1):
    print(a.count(i))

Submission status: Time Limit Exceeded

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

for i in range(N):
    print(A.count(i+1))

Submission status: Time Limit Exceeded

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

for i in range(N):
    print(A.count(i+1))

Submission status: Time Limit Exceeded

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

for i in range(1,len(A)+2):
    print(A.count(i))

Submission status: Time Limit Exceeded

Solution code:
a = int(input())
num_list = list(map(int, input().split()))
ori_list = set(num_list)
for i in range(a):
    if i+1 in ori_list:
        print(num_list.count(i+1))
    else:
        print(0)

Submission status: Time Limit Exceeded

Solution code:
a = int(input())
num_list = list(map(int, input().split()))
for i in range(a):
    print(num_list.count(i+1))

Submission status: Time Limit Exceeded

Solution code:
k=int(input())
a=list(map(int,input().split()))

for i in range(1,k):
  print(a.count(i))
print(0)

Submission status: Time Limit Exceeded

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

cnt=0
for i in range(1,N+1):
    for j in range(len(A)):
        if i == A[j]:
            cnt+=1
    print(cnt)
    cnt=0

Submission status: Time Limit Exceeded

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

ans = []
start = 0
for i in range(1, N+1):
    cnt = 0
    if i > max(A) :
        ans.append(0)
        continue
    for a in range(start, N-1):
        if A[a] == i:
            cnt += 1
        if A[a] > i:
            start = a
            ans.append(cnt)
            break
    else:
        ans.append(cnt)

print(*ans, sep='\n')

Submission status: Time Limit Exceeded

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

ans = []
for i in range(1, N+1):
    x = A.count(i)
    ans.append(x)

print(*ans, sep='\n')

Submission status: Time Limit Exceeded

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


for i in range(1, N+1):
    x = A.count(i)
    print(x)

Submission status: Time Limit Exceeded

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

for i in range(1, N+1):
	print(A.count(i))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=[int(x) for x in input().split()]
for i in range(N):
  print(A[i:].count(i+1))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=[int(x) for x in input().split()]
for i in range(N):
  print(A.count(i+1))
  A = A[1:]