Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans =0
seta = set(a)
for i in seta:
    k=a.count(i)
    if i>k:
        ans+=k
    elif i<k:
        ans+=k-i
print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans =0
import collections
c = collections.Counter(a)
for i in c.keys():
    if c[i]>i:
        ans+=c[i]-i
    elif c[i]<i:
        ans+=c[i]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans =0
for i in set(a):
    k=a.count(i)
    if i>k:
        ans+=k
    elif i<k:
        ans+=k-i
print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans =0
import collections
c = collections.Counter(a)
for i in c.keys():
    if c[i]>i:
        ans+=c[i]-i
    elif c[i]<i:
        ans+=c[i]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans =0
for i in set(a):
    if i>a.count(i):
        ans+=a.count(i)
    elif i<a.count(i):
        ans+=a.count(i)-i
print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans =0
import collections
c = collections.Counter(a)
for i in c.keys():
    if c[i]>i:
        ans+=c[i]-i
    elif c[i]<i:
        ans+=c[i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))
ans=0
num=[]
if len(set(a))-k <0:
    print(0)
else:
    for x in set(a):
        num.append(a.count(x))
    num.sort()
    for i in range(len(set(a))-k):
        ans+=num[i]
    print(ans)

Fixed submission:
import collections
n, k = map(int, input().split())
a = list(map(int, input().split()))
c = collections.Counter(a)
ans=0
num=[]
seta=set(a)
if len(seta)-k <0:
    print(0)
else:
    for x in seta:
        num.append(c[x])
    num.sort()
    for i in range(len(seta)-k):
        ans+=num[i]
    print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
if len(s)<len(t):
    print("UNRESTORABLE")
else:
    x=[]
    for i in range(len(s)-len(t)+1):
        k=0
        for j in range(len(t)):
            if s[i+j]!=t[j] and s[i+j]!="?":
                k+=1
        if k==0:
            x.append((s[:i]+t+s[(i+len(t)):]).replace("?","a"))
if len(x)==0:
    print("UNRESTORABLE")
else:
    x.sort()
    print(x[0])

Fixed submission:
s=input()
t=input()
if len(s)<len(t):
    print("UNRESTORABLE")
else:
    x=[]
    for i in range(len(s)-len(t)+1):
        k=0
        for j in range(len(t)):
            if s[i+j]!=t[j] and s[i+j]!="?":
                k+=1
        if k==0:
            x.append((s[:i]+t+s[(i+len(t)):]).replace("?","a"))
    if len(x)==0:
        print("UNRESTORABLE")
    else:
        x.sort()
        print(x[0])
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
xy=[list(map(int,input().split())) for _ in range(n)]
x=[t[0] for t in xy]
y=[t[1] for t in xy]

res=[]
for i in range(n):
    for j in range(n):
        for a in range(n):
            for b in range(n):
                l=min(x[i],x[j])
                r=max(x[i],x[j])
                d=min(y[a],y[b])
                u=max(y[a],y[b])
                tk=0
                for t in xy:
                    if l<=t[0]<=r and d<=t[1]<=u:
                        tk+=1
                if tk>=k:
                    res.append((r-l)*(u-d))
print(min(res))

Fixed submission:
n,k=map(int,input().split())
xy=[list(map(int,input().split())) for _ in range(n)]
x=[t[0] for t in xy]
y=[t[1] for t in xy]

res=[]
for i in range(n-1):
    for j in range(i+1,n):
        for a in range(n-1):
            for b in range(a+1,n):
                l=min(x[i],x[j])
                r=max(x[i],x[j])
                d=min(y[a],y[b])
                u=max(y[a],y[b])
                tk=0
                for t in xy:
                    if l<=t[0]<=r and d<=t[1]<=u:
                        tk+=1
                if tk>=k:
                    res.append((r-l)*(u-d))
print(min(res))

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
xy=[list(map(int,input().split())) for _ in range(n)]
x=[t[0] for t in xy]
y=[t[1] for t in xy]

res=[]
for i in range(n):
    for j in range(n):
        for a in range(n):
            for b in range(n):
                l=min(x[i],x[j])
                r=max(x[i],x[j])
                d=min(y[a],y[b])
                u=max(y[a],y[b])
                tk=0
                for t in xy:
                    if l<=t[0]<=r and d<=t[1]<=u:
                        tk+=1
                if tk>=k:
                    res.append((r-l)*(u-d))
print(min(res))

Fixed submission:
n,k=map(int,input().split())
xy=[list(map(int,input().split())) for _ in range(n)]
x=[t[0] for t in xy]
y=[t[1] for t in xy]

res=[]
for i in range(n-1):
    for j in range(i+1,n):
        for a in range(n-1):
            for b in range(a+1,n):
                l=min(x[i],x[j])
                r=max(x[i],x[j])
                d=min(y[a],y[b])
                u=max(y[a],y[b])
                tk=0
                for t in xy:
                    if l<=t[0]<=r and d<=t[1]<=u:
                        tk+=1
                if tk>=k:
                    res.append((r-l)*(u-d))
print(min(res))
Buggy python submission (verdict: Runtime Error):
n=int(input())
import sys
for a in range(1,3501):
    for b in range(1,3501):
        if (4/n-1/a-1/b)<=0:
            continue
        c=n*a*b/(4*a*b -n*a -n*b)
        if not 0<c<=3500:
            continue
        if c==int(c):
            print(a,b,int(c))
            sys.exit()

Fixed submission:
n=int(input())
import sys
for a in range(1,3501):
    for b in range(1,3501):
        if 4*a*b -n*a -n*b<=0:
            continue
        c=n*a*b/(4*a*b -n*a -n*b)
        if not 0<c<=3500:
            continue
        if c==int(c):
            print(a,b,int(c))
            sys.exit()

Buggy python submission (verdict: Runtime Error):
n=int(input())
ans=[]
for a in range(1,3501):
    for b in range(1,3501):
        if (4/n-1/a-1/b)==0:
            continue
        c=1/(4/n-1/a-1/b)
        if c==int(c) and c>0:
            ans.append([str(a),str(b),str(int(c))])
            break
print(" ".join(ans[0]))

Fixed submission:
n=int(input())
import sys
for a in range(1,3501):
    for b in range(1,3501):
        if 4*a*b -n*a -n*b<=0:
            continue
        c=n*a*b/(4*a*b -n*a -n*b)
        if not 0<c<=3500:
            continue
        if c==int(c):
            print(a,b,int(c))
            sys.exit()
Buggy python submission (verdict: Runtime Error):
import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
m = max(1, min(a))
M = max(a)
ans=[]
for x in range(m,M):
    ans.append(c[x-1]+c[x]+c[x+1])
if m == M:
    ans.append(n)
print(max(ans))

Fixed submission:
import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
m = max(1, min(a))
M = max(a)
ans=[]
for x in range(m,M):
    ans.append(c[x-1]+c[x]+c[x+1])
if m >= M:
    ans.append(n)
print(max(ans))

Buggy python submission (verdict: Runtime Error):
import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
ans=[]
m = max(1, min(a))
M = max(a)+1
for x in range(m,M):
    ans.append(c[x-1]+c[x]+c[x+1])
print(max(ans))

Fixed submission:
import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
m = max(1, min(a))
M = max(a)
ans=[]
for x in range(m,M):
    ans.append(c[x-1]+c[x]+c[x+1])
if m >= M:
    ans.append(n)
print(max(ans))
Buggy python submission (verdict: Runtime Error):
n=int(input())
abc=[list(map(int,input().split())) for _ in range(n-1)]
q,k=map(int,input().split())
xy=[list(map(int,input().split())) for _ in range(q)]

z=[[] for _ in range(n)]
for a,b,c in abc:
    z[a-1].append([b-1,c])
    z[b-1].append([a-1,c])

depth=[0 for _ in range(100010)]
def dfs(v,p,d):
    depth[v]=d
    for t in z[v]:
        if t[0]==p:
            continue
        dfs(t[0],v,d+t[1])
dfs(k-1,-1,0)
for x,y in xy:
    print(depth[x-1]+depth[y-1])

Fixed submission:
n=int(input())
abc=[list(map(int,input().split())) for _ in range(n-1)]
q,k=map(int,input().split())
xy=[list(map(int,input().split())) for _ in range(q)]

z=[[] for _ in range(n)]
for a,b,c in abc:
    z[a-1].append([b-1,c])
    z[b-1].append([a-1,c])

depth=[0 for _ in range(n)]
from collections import deque
que=deque([])
v,p,d=k-1,-1,0
que.append((v,p,d))
while que:
    v,p,d=que.pop()
    depth[v]=d
    for t in z[v]:
        if t[0]==p:
            continue
        que.append((t[0],v,d+t[1]))
for x,y in xy:
    print(depth[x-1]+depth[y-1])

Buggy python submission (verdict: Runtime Error):
n=int(input())
abc=[list(map(int,input().split())) for _ in range(n-1)]
q,k=map(int,input().split())
xy=[list(map(int,input().split())) for _ in range(q)]

z=[[] for _ in range(n)]
for a,b,c in abc:
    z[a-1].append([b-1,c])
    z[b-1].append([a-1,c])

depth=[0 for _ in range(n)]
def dfs(v,p,d):
    depth[v]=d
    for t in z[v]:
        if t[0]==p:
            continue
        dfs(t[0],v,d+t[1])
dfs(k-1,-1,0)
for x,y in xy:
    print(depth[x-1]+depth[y-1])

Fixed submission:
n=int(input())
abc=[list(map(int,input().split())) for _ in range(n-1)]
q,k=map(int,input().split())
xy=[list(map(int,input().split())) for _ in range(q)]

z=[[] for _ in range(n)]
for a,b,c in abc:
    z[a-1].append([b-1,c])
    z[b-1].append([a-1,c])

depth=[0 for _ in range(n)]
from collections import deque
que=deque([])
v,p,d=k-1,-1,0
que.append((v,p,d))
while que:
    v,p,d=que.pop()
    depth[v]=d
    for t in z[v]:
        if t[0]==p:
            continue
        que.append((t[0],v,d+t[1]))
for x,y in xy:
    print(depth[x-1]+depth[y-1])
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int, input().split()))
b=[]
for i in range(n):
    b.append(str(a[i]))
    b=b[::-1]
print(' '.join(b))

Fixed submission:
n=int(input())
a=list(map(int, input().split()))
b=[0 for _ in range(n)]
if n%2!=0:
    for i in range(n):
        if i%2==0:
            b[n//2-i//2]=str(a[i])
        else:
            b[n//2+i//2+1]=str(a[i])
else:
    for i in range(n):
        if i%2==0:
            b[n//2+i//2]=str(a[i])
        else:
            b[n//2-i//2-1]=str(a[i])
print(' '.join(b))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
u=a[0]<=a[1]
d=a[0]>=a[1]
res=0
for i in range(2,n):
    u=u and a[i-1]<=a[i]
    d=d and a[i-1]>=a[i]
    #print(i,u,d)
    if not any([u,d]):
        res+=1
        u=True
        d=True
print(res+1)
    

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
if n==1:
    print(1)
else:
    u=a[0]<=a[1]
    d=a[0]>=a[1]
    res=0
    for i in range(2,n):
        u=u and a[i-1]<=a[i]
        d=d and a[i-1]>=a[i]
        #print(i,u,d)
        if not any([u,d]):
            res+=1
            u=True
            d=True
    print(res+1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a,b=[],[]
for i in range(1,int(n**0.5)):
    if n%i==0:
        a.append(i)
        b.append(n//i)
ans=[]
for i in range(len(a)):
    ans.append(max(len(str(a[i])),len(str(b[i]))))
print(min(ans))

Fixed submission:
n = int(input())
a,b=[],[]
for i in range(1,int(n**0.5)+1):
    if n%i==0:
        a.append(i)
        b.append(int(n/i))
ans=[]
for i in range(len(a)):
    ans.append(max(len(str(a[i])),len(str(b[i]))))
print(min(ans))
Buggy python submission (verdict: Runtime Error):
x=int(input())
n=int((2*int(input()))**0.5)
if n*(n-1)<2*x<=n*(n+1):
    print(n)
elif (n-1)*(n-2)<2*x<=n*(n-1):
    print(n-1)
else:
    print(n+1)

Fixed submission:
x=int(input())
n=int((2*x)**0.5)
if n*(n-1)<2*x<=n*(n+1):
    print(n)
elif (n-1)*(n-2)<2*x<=n*(n-1):
    print(n-1)
else:
    print(n+1)
Buggy python submission (verdict: Time Limit Exceeded):
n,c,k=map(int,input().split())
t=[int(input()) for _ in range(n)]
t.sort()
res=0
while(t):
    i=0
    j=t[0]+k
    if len(t)==1:
        res+=1
        break
    while(i<len(t) and t[i]<=j and i<c):
        i+=1
    res+=1
    t=t[i:]
print(res)

Fixed submission:
n,c,k=map(int,input().split())
t=[int(input()) for _ in range(n)]
t.sort()
res=0
i1=0
while(i1<n):
    i2=0
    j=t[i1]+k
    if i1==n-1:
        res+=1
        break
    while(i1+i2<len(t) and t[i1+i2]<=j and i2<c):
        i2+=1
    res+=1
    i1+=i2
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
n,c,k=map(int,input().split())
t=[int(input()) for _ in range(n)]
t.sort()
res=0
while(t):
    i=0
    j=t[0]+k
    if len(t)==1:
        res+=1
        break
    while(i<len(t) and t[i]<=j and i<c):
        i+=1
    res+=1
    for _ in range(i):
        del t[0]
print(res)

Fixed submission:
n,c,k=map(int,input().split())
t=[int(input()) for _ in range(n)]
t.sort()
res=0
i1=0
while(i1<n):
    i2=0
    j=t[i1]+k
    if i1==n-1:
        res+=1
        break
    while(i1+i2<len(t) and t[i1+i2]<=j and i2<c):
        i2+=1
    res+=1
    i1+=i2
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
ans=0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x+y+z==s:
                ans+=1
print(ans)

Fixed submission:
k, s = map(int, input().split())
ans=0
for x in range(k+1):
    for y in range(k+1):
        if 0<=s-(x+y)<=k:
            ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
w, h, n = map(int, input().split())
xya = [list(map(int, input().split())) for i in range(n)]
x,y,a=[],[],[]
for z in xya:
    x.append(z[0])
    y.append(z[1])
    a.append(z[2])
pp = np.array([[1]*w]*h)
for i in range(n):
    if a[i]==1:
        pp[:, :x[i]]=0
    if a[i]==2:
        pp[:, x[i]:]=0
    if a[i]==3:
        pp[(h-y[i]):, :]=0
    if a[i]==4:
        pp[:(h-y[i]), :]=0
print(sum(sum(pp)))

Fixed submission:
import numpy as np
w, h, n = map(int, input().split())
xya = [list(map(int, input().split())) for i in range(n)]
x,y,a=[],[],[]
for z in xya:
    x.append(z[0])
    y.append(z[1])
    a.append(z[2])
pp = np.array([[1]*w]*h)
for i in range(n):
    if a[i]==1:
        pp[:, :x[i]]=0
    if a[i]==2:
        pp[:, x[i]:]=0
    if a[i]==3:
        pp[(h-y[i]):, :]=0
    if a[i]==4:
        pp[:(h-y[i]), :]=0
print(sum(sum(pp)))
Buggy python submission (verdict: Runtime Error):
s=input()
a=0
for i in range(1,n):
    if s[i]!=s[i-1]:
        a+=1
print(a)

Fixed submission:
s=input()
a=0
for i in range(1,len(s)):
    if s[i]!=s[i-1]:
        a+=1
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ta=[list(map(int, input().split())) for _ in range(n)]
a,b=0,0
for i in range(n):
    x,y=ta[i]
    j,k=x,y
    t=0
    while(1):
        t+=1
        if j*t>=a and k*t>=b:
            break
    a,b=j*t,k*t
print(a+b)

Fixed submission:
n=int(input())
ta=[list(map(int, input().split())) for _ in range(n)]
a,b=1,1
import math
for i in range(n):
    x,y=ta[i]
    t=max(-(-a//x),-(-b//y))
    a,b=t*x,t*y
print(a+b)
Buggy python submission (verdict: Runtime Error):
days = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']

s = input()

days_till_next_sunday = len(days) - days.index(s)

print(days_till_next_sunday)


Fixed submission:
days = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
S = input()

if S in days:
  days_till_next_sunday = len(days) - days.index(S)

print(days_till_next_sunday)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# 133C
"""
L<=i<=j<=R
(i×j)mod 2019
0≤L<R≤2×10^9
"""

L, R = map(int, input().split())

min2019 = 2019
for i in range(L, R):
    for j in range(i+1, R+1):
        #print((i * j) % 2019)
        if (i * j) % 2019 == 2019:
            break
        elif (i * j) % 2019 < min2019:
            min2019 = (i * j) % 2019
            
print(min2019)

Fixed submission:
# coding: utf-8
# 133C
"""
L<=i<=j<=R
(i×j)mod 2019
0≤L<R≤2×10^9
"""

def solve(L, R):
    if R - L > 2019:
        return 0
    
    tmp = 2019
    for i in range(L, R):
        for j in range(R, i, -1):
            if (i * j) % 2019 < tmp:
                tmp = (i * j) % 2019
    return tmp
 
L, R = map(int, input().split())
print(solve(L, R))

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# 133C
"""
L<=i<=j<=R
(i×j)mod 2019
0≤L<R≤2×10^9
"""

L, R = map(int, input().split())

min2019 = 2019
for i in range(L, R):
    for j in range(R, i, -1):
        if (i * j) % 2019 < min2019:
            min2019 = (i * j) % 2019
print(min2019)

Fixed submission:
# coding: utf-8
# 133C
"""
L<=i<=j<=R
(i×j)mod 2019
0≤L<R≤2×10^9
"""

def solve(L, R):
    if R - L > 2019:
        return 0
    
    tmp = 2019
    for i in range(L, R):
        for j in range(R, i, -1):
            if (i * j) % 2019 < tmp:
                tmp = (i * j) % 2019
    return tmp
 
L, R = map(int, input().split())
print(solve(L, R))
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# A - Fifty-Fifty

s = input()
c = []
dict = {}
for i in s:
    if i in dict:
        dict[i] +=1
    else:
        dict[i] = 1
        c.append(i)
if dict[c[0]] == dict[c[1]] == 2 and len(dict) == 2:
    print("Yes")
else:
    print("No")


Fixed submission:
# coding: utf-8
# A - Fifty-Fifty

s = input()
c = []
dict = {}
for i in s:
    if i in dict:
        dict[i] +=1
    else:
        dict[i] = 1
        c.append(i)

if dict[c[0]] == 4:
    print("No")
elif dict[c[0]] == dict[c[1]] == 2 and len(dict) == 2:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# A - Fifty-Fifty

s = input()
c = []
dict = {}
for i in s:
    if i in dict:
        dict[i] +=1
    else:
        dict[i] = 1
        c.append(i)
if dict[c[0]] == dict[c[1]] and len(dict) == 2:
    print("Yes")
else:
    print("No")


Fixed submission:
# coding: utf-8
# A - Fifty-Fifty

s = input()
c = []
dict = {}
for i in s:
    if i in dict:
        dict[i] +=1
    else:
        dict[i] = 1
        c.append(i)

if dict[c[0]] == 4:
    print("No")
elif dict[c[0]] == dict[c[1]] == 2 and len(dict) == 2:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# A - Fifty-Fifty

s = input()
c = []
dict = {}
for i in s:
    if i in dict:
        dict[i] +=1
    else:
        dict[i] = 1
        c.append(i)
if dict[c[0]] == dict[c[1]]:
    print("Yes")
else:
    print("No")


Fixed submission:
# coding: utf-8
# A - Fifty-Fifty

s = input()
c = []
dict = {}
for i in s:
    if i in dict:
        dict[i] +=1
    else:
        dict[i] = 1
        c.append(i)

if dict[c[0]] == 4:
    print("No")
elif dict[c[0]] == dict[c[1]] == 2 and len(dict) == 2:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
num = int(input())
numList = list(range(0, num))
listLength = len(numList)
counter = 0

#print(numList)

m = [0] * 1000000

for i in range(0, listLength):
    m[numList[i]]
    m[numList[i]] += 1

secondCount = 0

for i in range(0, listLength):
    secondCount += m[num - numList[i]]
    if (num - numList[i] == numList[i]):
        secondCount -= 1

print(int(secondCount / 2))

Fixed submission:
num = int(input())
numList = list(range(0, num))
listLength = len(numList)
counter = 0

#print(numList)

m = [0] * 10000000

for i in range(0, listLength):
    m[numList[i]]
    m[numList[i]] += 1

secondCount = 0

for i in range(0, listLength):
    secondCount += m[num - numList[i]]
    if (num - numList[i] == numList[i]):
        secondCount -= 1

print(int(secondCount / 2))
Buggy python submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())

n = math.gcd(A, B)


if n == 1:
    print(1)
else:
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            while temp%i == 0:
                temp //= i
            arr.append(i)
    if temp != 1:
        arr.append(temp)

    print(len(arr)+1)


Fixed submission:

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

while B:
    A, B = B, A % B
n = A



if n == 1:
    print(1)
else:
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            while temp%i == 0:
                temp //= i
            arr.append(i)
    if temp != 1:
        arr.append(temp)

    print(len(arr)+1)

Buggy python submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())

n = math.gcd(A, B)


if n == 1:
    print(1)
else:
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            while temp%i == 0:
                temp //= i
            arr.append(i)
    if temp != 1:
        arr.append(temp)

    print(len(arr)+1)


Fixed submission:

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

while B:
    A, B = B, A % B
n = A



if n == 1:
    print(1)
else:
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            while temp%i == 0:
                temp //= i
            arr.append(i)
    if temp != 1:
        arr.append(temp)

    print(len(arr)+1)
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
aList = []
for i in range(Q):
    aList.append(int(input()))

ptsList = []
handy = Q - K
for i in range(N):
    ptsList.append(0)
if K - Q > 0:
    for i in range(N):
        print("Yes")
else:
    for i, Ai in enumerate(aList):
        AiPts = ptsList[Ai-1]
        AiPts += 1
        ptsList.pop(Ai-1)
        ptsList.insert(Ai-1, AiPts)

    for i, e in enumerate(ptsList):
        if e > handy:
            print("Yes")
        else:
            print("No")


Fixed submission:
N, K, Q = map(int, input().split())

ptsList = [K-Q]*N

if K - Q > 0:
    for i in range(N):
        print("Yes")
else:
    for i in range(Q):
        ptsList[int(input())-1] += 1

    for i, e in enumerate(ptsList):
        if e > 0:
            print("Yes")
        else:
            print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split())
aList = []
for i in range(Q):
    aList.append(int(input()))

ptsList = []
for i in range(N):
    ptsList.append(K-Q)

for i, Ai in enumerate(aList):
    AiPts = ptsList[Ai-1]
    AiPts += 1
    ptsList.pop(Ai-1)
    ptsList.insert(Ai-1, AiPts)

for i, e in enumerate(ptsList):
    if e > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
N, K, Q = map(int, input().split())

ptsList = [K-Q]*N

if K - Q > 0:
    for i in range(N):
        print("Yes")
else:
    for i in range(Q):
        ptsList[int(input())-1] += 1

    for i, e in enumerate(ptsList):
        if e > 0:
            print("Yes")
        else:
            print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
priceList = [int(i) for i in input().split()]

priceList.sort(reverse=True)
if N == 1:
    while M > 0:
        priceList[0] = priceList[0] // 2
        M -= 1
else:
    while M > 0:
        while priceList[0] >= priceList[1] and M > 0:
            priceList[0] = priceList[0] // 2
            M -= 1

        priceList.sort(reverse=True)

sum = 0
for i in range(N):
    sum += priceList[i]

print(sum)

Fixed submission:
import heapq

N, M = map(int, input().split())
priceList = [(-1)*int(i) for i in input().split()]
heapq.heapify(priceList)

while M > 0:
    maxPrice = -heapq.heappop(priceList)
    maxPrice = maxPrice // 2
    M -= 1
    heapq.heappush(priceList, -maxPrice)

sum = 0
for i in range(N):
    sum += priceList[i]

print(-sum)
Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())

r = 2019
for i in range(L, R):
    for j in range(i+1, R+1):
        r = min(r, (i*j)%2019)


print(r)

Fixed submission:
import sys
L, R = map(int, input().split())

r = 2019
for i in range(L, R):
    for j in range(i+1, R+1):
        r = min(r, (i*j)%2019)
        if r == 0:
            print(r)
            sys.exit()

print(r)
Buggy python submission (verdict: Runtime Error):
n= int(input())
a_list=list(map(int,input().split()))
f_list=[0]*n

for i in a_list:
  f_list[i-1]= a_list.index(i)+1

print(n)
for i in f_list:
    print(i,end=' ')
print('')

Fixed submission:
n = int(input())
odd_cnt= len([a for a in range(n+1) if a%2==1])

prob= (odd_cnt)/float(n)

print (prob)