Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter


def main():
    N = int(input()) # 5人
    An = list(map(int, input().split(' '))) # A2, A3,...
    
    # N = 10
    # An = [1,1, 1, 1, 1, 1, 1, 1, 1]
    
    start_index = 0
    
    for n in range(1, N+1):
        an = Counter(An[start_index:])
        start_index = an[n]
        print(start_index)
            


    
main()


Fixed submission:
from collections import Counter


def main():
    N = int(input()) # 5人
    An = list(map(int, input().split(' '))) # A2, A3,...
    
    # N = 10
    # An = [1,1, 1, 1, 1, 1, 1, 1, 1]
    
    # out = [0] *
    
    an = Counter(An)
    for n in range(1, N+1):  
        print(an[n])
            


    
main()

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter


def main():
    N = int(input()) # 5人
    An = list(map(int, input().split(' '))) # A2, A3,...
    
    # N = 10
    # An = [1,1, 1, 1, 1, 1, 1, 1, 1]
    
    counter = []
    count = 0
    start_index = 0
    
    for n in range(1, N+1):
        an = Counter(An[start_index:])
        print(an[n])
        
    
    # for i in counter:
    #     print(i)
            


    
main()


Fixed submission:
from collections import Counter


def main():
    N = int(input()) # 5人
    An = list(map(int, input().split(' '))) # A2, A3,...
    
    # N = 10
    # An = [1,1, 1, 1, 1, 1, 1, 1, 1]
    
    # out = [0] *
    
    an = Counter(An)
    for n in range(1, N+1):  
        print(an[n])
            


    
main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input()) # 5人
    An = list(map(int, input().split(' '))) # A2, A3,...
    
    # N = 5
    # An = [1, 1, 2, 2]
    
    # N = 7
    # An = [1, 2, 3, 4, 5, 6]

    # NUM = An.copy()
    # out = []
    # counter = []
    
    # start_index = 0
    
    # for n in range(1, N+1):
    #     count = 0
    #     for an in An[start_index:]:
    #         if n >= an:
    #             if len(NUM) > 0:
    #                 count += 1
    #                 start_index += 1
    #                 NUM = An[start_index:]
    #             # print(n, an, NUM)
    #     counter.append(count)
    #     # out.append(count)
        
    #     # print('counter:', counter, 'out:', out)
        
    # # print('counter:', counter)
    
    counter = []
    count = 0
    start_index = 0
    
    for n in range(1, N+1):
        an = An[start_index:]
        for a in an:
            a -= n
            if a == 0:
                count += 1        
        counter.append(count)
        count = 0
                
        
        
        
        
    
    
    for i in counter:
        print(i)
            


    
main()


Fixed submission:
from collections import Counter


def main():
    N = int(input()) # 5人
    An = list(map(int, input().split(' '))) # A2, A3,...
    
    # N = 10
    # An = [1,1, 1, 1, 1, 1, 1, 1, 1]
    
    # out = [0] *
    
    an = Counter(An)
    for n in range(1, N+1):  
        print(an[n])
            


    
main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input()) # 5人
    An = list(map(int, input().split(' '))) # A2, A3,...
    
    # N = 5
    # An = [1, 1, 2, 2]
    
    # N = 7
    # An = [1, 2, 3, 4, 5, 6]

    NUM = An.copy()
    out = []
    counter = []
    
    start_index = 0
    
    for n in range(1, N+1):
        count = 0
        # for an_i in range(start_index, len(An)):
        for an in An[start_index:]:
            if n >= an:
                if len(NUM) > 0:
                    count += 1
                    start_index += 1
                    NUM = An[start_index:]
                # print(n, an, NUM)
        counter.append(count)
        # out.append(count)
        
        # print('counter:', counter, 'out:', out)
        
    # print('counter:', counter)
    for i in counter:
        print(i)
            
    
main()

Fixed submission:
from collections import Counter


def main():
    N = int(input()) # 5人
    An = list(map(int, input().split(' '))) # A2, A3,...
    
    # N = 10
    # An = [1,1, 1, 1, 1, 1, 1, 1, 1]
    
    # out = [0] *
    
    an = Counter(An)
    for n in range(1, N+1):  
        print(an[n])
            


    
main()