Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math

def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def ris(): return list(input())
def pli(a): return "".join(list(map(str, a)))


n, k = rli()
a = rli()
if(max(a) < k):
    print("IMPOSSIBLE")
else:
    g = a[0]
    for i in a[1:]:
        g = math.gcd(g, i)
    if(k % g == 0):
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")


Fixed submission:
import fractions

def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def ris(): return list(input())
def pli(a): return "".join(list(map(str, a)))


n, k = rli()
a = rli()
if(max(a) < k):
    print("IMPOSSIBLE")
else:
    g = a[0]
    for i in a[1:]:
        g = fractions.gcd(g, i)
    if(k % g == 0):
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")

Buggy python submission (verdict: Runtime Error):
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def ris(): return list(input())
def pli(a): return "".join(list(map(str, a)))

import math

n, k = rli()
a = rli()
if(max(a) < k):
    print("IMPOSSIBLE")
else:
    g = a[0]
    for i in a[1:]:
        g = math.gcd(g, i)
    if(k % g == 0):
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")


Fixed submission:
import fractions

def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def ris(): return list(input())
def pli(a): return "".join(list(map(str, a)))


n, k = rli()
a = rli()
if(max(a) < k):
    print("IMPOSSIBLE")
else:
    g = a[0]
    for i in a[1:]:
        g = fractions.gcd(g, i)
    if(k % g == 0):
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")
Buggy python submission (verdict: Time Limit Exceeded):
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(input())
def pli(a): return "".join(list(map(str, a)))


R, C, N = rli()
lis = []
idx = 0
i = 0
for j in range(N):
    x1, y1, x2, y2 = rli()
    if((x1 % R == 0 or y1 % C == 0) and (x2 % R == 0 or y2 % C == 0)):
        i += 1
        for _ in range(2):
            if(y1 == 0):
                lis.append([x1, i])
            elif(x1 == R):
                lis.append([R+y1, i])
            elif(y1 == C):
                lis.append([2*R+C-x1, i])
            elif(x1 == 0):
                lis.append([2*R+2*C-y1, i])
            x1 = x2
            y1 = y2
lis.sort()
stack = []
ans = True
for k in range(2*i):
    if(lis[k][1] in stack):
        if(lis[k][1] != stack.pop()):
            ans = False
            break
    else:
        stack.append(lis[k][1])

if(ans):
    print("YES")
else:
    print("NO")


Fixed submission:
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(input())
def pli(a): return "".join(list(map(str, a)))


R, C, N = rli()
lis = []
idx = 0
i = 0
for j in range(N):
    x1, y1, x2, y2 = rli()
    if((x1 % R == 0 or y1 % C == 0) and (x2 % R == 0 or y2 % C == 0)):
        i += 1
        for _ in range(2):
            if(y1 == 0):
                lis.append([x1, i])
            elif(x1 == R):
                lis.append([R+y1, i])
            elif(y1 == C):
                lis.append([2*R+C-x1, i])
            elif(x1 == 0):
                lis.append([2*R+2*C-y1, i])
            x1 = x2
            y1 = y2
lis.sort()
stack = []
exist = [False for _ in range(2*i)]
ans = True
for k in range(2*i):
    if(exist[lis[k][1]]):
        if(lis[k][1] != stack.pop()):
            ans = False
            break
        exist[lis[k][1]] = False
    else:
        stack.append(lis[k][1])
        exist[lis[k][1]] = True
if(ans):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
def rren(): return list(map(int, input().split()))


a = set()
b = dict()
N, K = rren()

for i in range(N):
    a_t, b_t = rren()
    if(a_t not in a):
        a.add(a_t)
        b[a_t] = b_t
    else:
        b[a_t] += b_t

count = K
for i in range(K-1):
    mn = min(a)
    nu = b[mn]
    a.discard(mn)
    count -= nu
    if(count <= 0):
        print(mn)
        break


Fixed submission:
def rren(): return list(map(int, input().split()))


a = set()
b = dict()
N, K = rren()

for i in range(N):
    a_t, b_t = rren()
    if(a_t not in a):
        a.add(a_t)
        b[a_t] = b_t
    else:
        b[a_t] += b_t

li_a = list(a)
li_a.sort()
count = K
for i in range(K):
    count -= b[li_a[i]]
    if(count <= 0):
        print(li_a[i])
        break

Buggy python submission (verdict: Time Limit Exceeded):
def rren(): return list(map(int, input().split()))


a = []
b = []
N, K = rren()

for i in range(N):
    a_t, b_t = rren()
    a.append(a_t)
    b.append(b_t)

count = K
for i in range(K-1):
    mn = min(a)
    ind = a.index(min(a))
    nu = b[ind]
    del a[ind]
    del b[ind]
    count -= nu
    if(count <= 0):
        print(mn)
        break


Fixed submission:
def rren(): return list(map(int, input().split()))


a = set()
b = dict()
N, K = rren()

for i in range(N):
    a_t, b_t = rren()
    if(a_t not in a):
        a.add(a_t)
        b[a_t] = b_t
    else:
        b[a_t] += b_t

li_a = list(a)
li_a.sort()
count = K
for i in range(K):
    count -= b[li_a[i]]
    if(count <= 0):
        print(li_a[i])
        break
Buggy python submission (verdict: Time Limit Exceeded):
def rren(): return list(map(int, input().split()))
n, m = rren()
x = rren()
y = rren()
ans = 0
for now_x in range(n-1):
    for now_y in range(m-1):
        S = (x[now_x+1]-x[now_x])*(y[now_y+1]-y[now_y])
        count = (now_x+1)*(n-now_x-1)*(now_y+1)*(m-now_y-1)
        ans = (ans + S*count) % 1000000007

print(ans)

Fixed submission:
def rren(): return list(map(int, input().split()))
n, m = rren()
x = rren()
y = rren()
ans = 0
x_sum = 0
y_sum = 0
for now_x in range(n):
    x_sum += x[now_x] * (now_x - (n-1 - now_x))
for now_y in range(m):
    y_sum += y[now_y] * (now_y - (m-1 - now_y))

print(x_sum * y_sum % 1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
def rren(): return list(map(int, input().split()))
n, m = rren()
x = rren()
y = rren()
ans = 0
for now_x in range(n-1):
    for now_y in range(m-1):
        S = (x[now_x+1]-x[now_x])*(y[now_y+1]-y[now_y])
        count = (now_x+1)*(n-now_x-1)*(now_y+1)*(m-now_y-1)
        ans += S*count

print(ans%1000000007)

Fixed submission:
def rren(): return list(map(int, input().split()))
n, m = rren()
x = rren()
y = rren()
ans = 0
x_sum = 0
y_sum = 0
for now_x in range(n):
    x_sum += x[now_x] * (now_x - (n-1 - now_x))
for now_y in range(m):
    y_sum += y[now_y] * (now_y - (m-1 - now_y))

print(x_sum * y_sum % 1000000007)
Buggy python submission (verdict: Runtime Error):
N = int(input())
t = list(input())
Ans = ['n' for _ in t]

def judge(prevSW, SW, ox):
    if SW == 'S':
        if ox == 'o':
            return prevSW
        else:
            if prevSW == 'S':
                return 'W'
            else: return 'S'
    elif SW == 'W':
        if ox == 'x':
            return prevSW
        else:
            if prevSW == 'S':
                return 'W'
            else: return 'S'

def decideorder(startSW):
    Ans[1] = startSW
    for i in range(2,N):
        Ans[i] = judge(Ans[i-2], Ans[i-1], t[i-1])


Ans[0] = 'S'
decideorder('S')
if judge(Ans[-1], Ans[0], t[0]) is Ans[0]:
    print("".join(Ans))
else:
    decideorder('W')
    if judge(Ans[-1], Ans[0], t[0]) is Ans[0]:
        print("".join(Ans))
    else:
        Ans[0] = 'W'
        decideorder('S')
        if judge(Ans[-1], Ans[0], t[0]) is Ans[0]:
            print("".join(Ans))
        else:
            decideorder('W')
            if judge(Ans[-1], Ans[0], t[0]) is Ans[0]:
                print("".join(Ans))
            else:
                print(-1)

Fixed submission:
N = int(input())
dis = (N//15)*200
print(N*800-dis)
Buggy python submission (verdict: Time Limit Exceeded):
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(input())
def pli(a): return "".join(list(map(str, a)))

s = rls()
a = 0
z = 0
for i in range(len(s)):
    if(s[i] == "A"):
        a = i
        break
for i in range(len(s[::-1])):
    if(s[::-1][i] == "Z"):
        z = len(s) - i
        break
print(z-a)

Fixed submission:
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(input())
def pli(a): return "".join(list(map(str, a)))

s = rls()
t = s[::-1]
a = 0
z = 0
for i in range(len(s)):
    if(s[i] == "A"):
        a = i
        break
for i in range(len(t)):
    if(t[i] == "Z"):
        z = len(s) - i
        break
print(z-a)
Buggy python submission (verdict: Runtime Error):
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def ris(): return list(input())
def pli(): return "".join(list(map(str, ans)))

print(len(set(rli()))

Fixed submission:
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def ris(): return list(input())
def pli(): return "".join(list(map(str, ans)))

print(len(set(rli())))
Buggy python submission (verdict: Runtime Error):
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(input())
def pli(a): return "".join(list(map(str, a)))

n = ri()
print(n(n+1)/2)

Fixed submission:
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(input())
def pli(a): return "".join(list(map(str, a)))

n = ri()
print(n*(n+1)//2)
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
H=[-1]
H.extend(list(map(int,input().split())))

lst=list(range(1,N+1))

left=[]
for h in lst:
    left.append(h)

for _ in range(M):
    A,B=map(int,input().split())
    if H[A]<H[B] and A in left:
        n = left.index(A)
        left.pop(n)
    elif H[A]>H[B] and B in left:
        n = left.index(B)
        left.pop(n)
    elif H[A]==H[B]:
        if A in left:
            n = left.index(A)
            left.pop(n)
        if B in left:
            n = left.index(B)
            left.pop(n)

print(len(left))

Fixed submission:
N,M=map(int,input().split())
H=[-1]
H.extend(list(map(int,input().split())))

lose = set()

for _ in range(M):
    A,B=map(int,input().split())
    if H[A]<H[B]:
        lose.add(A)
    elif H[A]>H[B]:
        lose.add(B)
    elif H[A]==H[B]:
        lose.add(A)
        lose.add(B)

print(N-len(lose))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(i) for i in input().split()]

for i in range(1,N+1):
    print(A.index(i)+1,end=" ")


Fixed submission:
N=int(input())
A=[int(i) for i in input().split()]

B=[]
for i in range(N):
    B.append([A[i]])

for i in range(N):
    B[i].append(i+1)

B.sort()

for i in range(N):
    print(B[i][1],end=" ")
Buggy python submission (verdict: Time Limit Exceeded):
import math

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

def func(n):
    num=1
    for i in range(2,int(math.sqrt(n) + 1e-9) +3):
        if n%i==0 and n!=i:
            num=0
            break
        else:
            continue
    return num

p=min(A,B)
q=max(A,B)

ans=0
for i in range(1, p+1):
    if p%i==0 and q%i==0:
        ans+=func(i)
        
print(ans)

Fixed submission:
import math

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

def func(n):
    num=1
    for i in range(2,int(math.sqrt(n) + 1e-9) +3):
        if n%i==0 and n!=i:
            num=0
            break
        else:
            continue
    return num

p=min(A,B)
q=max(A,B)

ans=0
check=[]
for i in range(1, int(math.sqrt(p)+ 1e-9)+3):
    if p%i==0:
        if i not in check:
            check.append(i)
        if p//i not in check:
            check.append(p//i)

for i in check:
    if q%i==0:
        ans+=func(i)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A=[int(i) for i in input().split()]

A.sort()

def discount(A,M,N):
    cost=0
    for i in range(len(A)):
        cost+=A[i]
    while M>0:
        cost=cost-A[N-1]+A[N-1]//2
        M-=1
        A[N-1]//=2
        A.sort()
    return cost

print(discount(A,M,N))

Fixed submission:
import heapq

N,M=map(int,input().split())
A=[int(i) for i in input().split()]

cost=[]
heapq.heapify(cost)

for i in range(N):
    heapq.heappush(cost,-A[i])

min_cost=sum(A)

while M>0:
    max_cost=(-1)*heapq.heappop(cost)
    cut_cost=max_cost-max_cost//2
    min_cost-=cut_cost
    max_cost-=cut_cost
    heapq.heappush(cost,(-1)*max_cost)
    M-=1

print(min_cost)
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input())
print(max(A-B,A+B,A*B))

Fixed submission:
A,B=map(int,input().split())
print(max(A-B,A+B,A*B))
Buggy python submission (verdict: Runtime Error):
import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N,K=map(int,input().split())
div=10**9+7

for i in range(K):
    if N-K+<i:
        print(0)
    else:
        print(comb(K-1,i)*comb(N-K+1,i+1)%div)

Fixed submission:
import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N,K=map(int,input().split())
div=10**9+7

for i in range(K):
    if N-K<i:
        print(0)
    else:
        print(comb(K-1,i)*comb(N-K+1,i+1)%div)

Buggy python submission (verdict: Runtime Error):
import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N,K=map(int,input().split())
div=10**9+7

for i in range(K):
    print(comb(K-1,i)*comb(N-K+1,i+1)%div)

Fixed submission:
import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N,K=map(int,input().split())
div=10**9+7

for i in range(K):
    if N-K<i:
        print(0)
    else:
        print(comb(K-1,i)*comb(N-K+1,i+1)%div)
Buggy python submission (verdict: Runtime Error):
import math

A,B,C,D=map(int,input().split())
lcm=int(C*D/math.gcd(C,D))

if B//lcm==0:
    num_CD=0
else:
    num_CD=B//lcm-math.ceil(A/lcm)+1


if B//C==0:
    num_C=0
else:
    num_C=B//C-math.ceil(A/C)+1



if B//D==0:
    num_D=0
else:
    num_D=B//D-math.ceil(A/D)+1


ans=B-A+1-num_C-num_D+num_CD


print(int(ans))

Fixed submission:
import fractions

A,B,C,D=map(int,input().split())
lcm=int(C*D/(fractions.gcd(C,D)))

if B//lcm==0:
    num_CD=0
else:
    num_CD=B//lcm-(A-1)//lcm


if B//C==0:
    num_C=0
else:
    num_C=B//C-(A-1)//C



if B//D==0:
    num_D=0
else:
    num_D=B//D-(A-1)//D


ans=B-A+1-num_C-num_D+num_CD


print(int(ans))

Buggy python submission (verdict: Runtime Error):
A,B,C,D=map(int,input().split())
lcm=int(C*D/math.gcd(C,D))

if B//lcm==0:
    num_CD=0
else:
    num_CD=B//lcm-math.ceil(A/lcm)+1


if B//C==0:
    num_C=0
else:
    num_C=B//C-math.ceil(A/C)+1



if B//D==0:
    num_D=0
else:
    num_D=B//D-math.ceil(A/D)+1


ans=B-A+1-num_C-num_D+num_CD


print(int(ans))

Fixed submission:
import fractions

A,B,C,D=map(int,input().split())
lcm=int(C*D/(fractions.gcd(C,D)))

if B//lcm==0:
    num_CD=0
else:
    num_CD=B//lcm-(A-1)//lcm


if B//C==0:
    num_C=0
else:
    num_C=B//C-(A-1)//C



if B//D==0:
    num_D=0
else:
    num_D=B//D-(A-1)//D


ans=B-A+1-num_C-num_D+num_CD


print(int(ans))
Buggy python submission (verdict: Runtime Error):
from itertools import accumulate 
N,K=map(int,input().split())
a=[int(i) for i in input().split()]
b=list(reversed(a))
b_sum=list(accumulate(b))
num=0
for i in range(len(b_sum)):
    if b_sum[i]<K:
        num+=1

ans=0
for i in range(N-num):
    b=a[i:]
    c=list(accumulate(b))
    c.reverse()
    for j in range(len(c)):
        if c[j]>=K:
            ans+=1
        else:
            break

print(ans)

Fixed submission:
X,A=map(int,input().split())
if X<A:
    print(0)
else:
    print(10)

Buggy python submission (verdict: Runtime Error):
X,A=map(int,input())
if X<A:
    print(0)
else:
    print(10)

Fixed submission:
X,A=map(int,input().split())
if X<A:
    print(0)
else:
    print(10)
Buggy python submission (verdict: Runtime Error):
S=input()
list = [-1]
list2 = []

for i in range(len(S)):
    if S[i] != 'A' and S[i] != 'T' and S[i] != 'G' and S[i] != 'C':
        list.append(i)
i=0
while i<len(list)-1:
    list2.append(list[i+1]-list[i]-1)
    i += 1

for i in range(len(list2)):
    for j in range(i,len(list2)):
        if list2[i]<list2[j]:
            temp = list2[i]
            list2[i] = list2[j]
            list2[j] = temp

print(list2[0])

Fixed submission:
S=input()
list = [-1]
list2 = []

for i in range(len(S)):
    if S[i] != 'A' and S[i] != 'T' and S[i] != 'G' and S[i] != 'C':
        list.append(i)

list.append(len(S))

i=0
while i<len(list)-1:
    list2.append(list[i+1]-list[i]-1)
    i += 1

for i in range(len(list2)):
    for j in range(i,len(list2)):
        if list2[i]<list2[j]:
            temp = list2[i]
            list2[i] = list2[j]
            list2[j] = temp
            
print(list2[0])
Buggy python submission (verdict: Runtime Error):
import math

A,B,K=map(int,input().split())

p=math.gcd(A,B)

count=1

ans=p

for i in reversed(list(range(1,p))):
    if p%i==0:
        count+=1
        ans=i
    if count==K:
        break

print(ans)

Fixed submission:
import fractions

A,B,K=map(int,input().split())

p=fractions.gcd(A,B)

count=1

ans=p

for i in reversed(list(range(1,p))):
    if p%i==0:
        count+=1
        ans=i
    if count==K:
        break

print(ans)
Buggy python submission (verdict: Runtime Error):
S=list(int(input()))

red=0
blue=0
for i in range(N):
    if S[i]==0:
        red+=1
    else:
        blue+=1
print(min(red,blue)*2)

Fixed submission:
S=list(input())

red=0
blue=0
for i in range(len(S)):
    if S[i]=="0":
        red+=1
    else:
        blue+=1
        
print(min(red,blue)*2)

Buggy python submission (verdict: Runtime Error):
S=input()
red=0
blue=0
for i in range(N):
    if S[i]==0:
        red+=1
    else:
        blue+=1
print(min(red,blue)*2)

Fixed submission:
S=list(input())

red=0
blue=0
for i in range(len(S)):
    if S[i]=="0":
        red+=1
    else:
        blue+=1
        
print(min(red,blue)*2)
Buggy python submission (verdict: Runtime Error):
K=int(input())

if K%2==0:
    even=K/2
    ans=even**2
    else:
        even=K//2
        ans=even**2+1
print(ans)

Fixed submission:
K=int(input())

if K%2==0:
    even=K/2
    ans=even**2
else:
    even=K//2
    ans=even*(even+1)
print(int(ans))
Buggy python submission (verdict: Runtime Error):
H,W=map(int,input().split())
hw=[]
for _ in range(H):
    hw.append(input())

yoko_list=[]
tate_list=[]
for i in range(H):
    for j in range(W):
        if hw[i][j]=="#":
            break
        elif j==W-1:
            yoko_list.append(i)

for i in range(W):
    for j in range(H):
        if hw[j][i]=="#":
            break
        elif j==H-1:
            tateH,W=map(int,input().split())

Fixed submission:
H,W=map(int,input().split())
hw=[]
for _ in range(H):
    hw.append(input())

yoko_list=[]
tate_list=[]
for i in range(H):
    for j in range(W):
        if hw[i][j]=="#":
            break
        elif j==W-1:
            yoko_list.append(i)

for i in range(W):
    for j in range(H):
        if hw[j][i]=="#":
            break
        elif j==H-1:
            tate_list.append(i)

for i in range(H):
    if not i in yoko_list:
        p=0
        for j in range(W):
            if not j in tate_list:
                p+=1
                if p==W-len(tate_list):
                    print(hw[i][j])
                else:
                    print(hw[i][j],end="")
Buggy python submission (verdict: Runtime Error):
if N>=189:
    print(3)
elif N>=165:
    print(2)
elif N>=105:
    print(1)
else:
    print(0)  

Fixed submission:
N=int(input())
if N>=195:
    print(5)
elif N>=189:
    print(4)
elif N>=165:
    print(3)
elif N>=135:
    print(2)
elif N>=105:
    print(1)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
A,B,C=map(int,input().split())
K=int(input())

print(A+B+C+max(A,B,C)*(2**K-1)

Fixed submission:
A,B,C=map(int,input().split())
K=int(input())

print(A+B+C+max(A,B,C)*(2**K-1))
Buggy python submission (verdict: Runtime Error):
abc=[int(i) for i in input().split()]

abc.sort()

def func(a,b,c):
    return int((c-a)/2+(c-b)/2)


if abc[0]%2==abc[1]%2:
    if abc[0]%2!=abc[2]%2:
        print(func(abc[0]+1,abc[1]+1,abc[2])+1)
    else:
        print(func(abc[0],abc[1],abc[2]))
else:
    if abc[0]%2==abc[2]%2:
        print(func(abc[0]+1,abc[1],abc[2]+1)+1)
    else:
        print(func(abc[0],abc[1]+1,abc[2+1])+1)

Fixed submission:
abc=[int(i) for i in input().split()]

abc.sort()

def func(a,b,c):
    return int((c-a)/2+(c-b)/2)

if abc[0]%2==abc[1]%2:
    if abc[0]%2!=abc[2]%2:
        print(func(abc[0]+1,abc[1]+1,abc[2])+1)
    else:
        print(func(abc[0],abc[1],abc[2]))
else:
    if abc[0]%2==abc[2]%2:
        print(func(abc[0]+1,abc[1],abc[2]+1)+1)
    else:
        print(func(abc[0],abc[1]+1,abc[2]+1)+1)
Buggy python submission (verdict: Runtime Error):
abc=[int(i) for i in input().split()]
num_five=0
num_seven=0
for i in range(3):
  if abc[i]==5:
    num_five+=1
  elif abc[i]==7:
    num_five+=1

if num_five==2 and num_seven==1:
  print("YES")
 else:
  print("NO")


Fixed submission:
abc=[int(i) for i in input().split()]
num_five=0
num_seven=0

for i in range(3):
  if abc[i]==5:
    num_five+=1
  elif abc[i]==7:
    num_seven+=1

if num_five==2 and num_seven==1:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
for i in range(1,N+1):
    count = 0
    for j in range(i-1, N-1):
        if A[j] == i:
            count += 1
    print(count)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = [0] * (N+1)
for i in A:
    ans[i] += 1
for a in ans[1:]:
    print(a)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
[print(A[i-1:].count(i)) for i in range(1,N+1)]

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = [0] * (N+1)
for i in A:
    ans[i] += 1
for a in ans[1:]:
    print(a)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
[print(A.count(i)) for i in range(1,N+1)]

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = [0] * (N+1)
for i in A:
    ans[i] += 1
for a in ans[1:]:
    print(a)