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

def main():
    n = int(input().strip())
    L = list(map(int, input().strip().split()))
    seen = Counter()
    
    
    for x in L:
        seen[x]+=1
    @jit
    def loop():
        ans=0
        for x in L:
            if seen[x]>1 or x!=1 and 1 in seen:
                continue
        
            tmp=2
            while tmp**2<=x:
                if x%tmp==0 and (tmp in seen or x/tmp in seen):
                    break
                tmp+=1
            else:
                ans+=1
        return ans
    print(loop())
# print(ans)
    
if '__main__' == __name__:
    main()

Fixed submission:
def main():
    n = int(input().strip())
    L = list(map(int, input().strip().split()))
    L.sort()
    max_=L[-1]
    isDivisible = [False]*(max_) # 1-Lmax
    
    for i,x in enumerate(L):
        if i!=n-1 and x==L[i+1]:
            isDivisible[x-1]=True
            continue
        j=2*x
        while j<=max_:
            isDivisible[j-1]=True
            j+=x
    ans=0
    for x in L:
        if not isDivisible[x-1]:
            ans+=1
    print(ans)
# print(ans)
    
if '__main__' == __name__:
    main()

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

def main():
    n = int(input().strip())
    L = list(map(int, input().strip().split()))
    seen = Counter()
    
    
    for x in L:
        seen[x]+=1
    
    def loop():
        ans=0
        for x in L:
            if seen[x]>1 or x!=1 and 1 in seen:
                continue
        
            tmp=2
            while tmp**2<=x:
                if x%tmp==0 and (tmp in seen or x/tmp in seen):
                    break
                tmp+=1
            else:
                ans+=1
        return ans
    print(loop())
# print(ans)
    
if '__main__' == __name__:
    main()

Fixed submission:
def main():
    n = int(input().strip())
    L = list(map(int, input().strip().split()))
    L.sort()
    max_=L[-1]
    isDivisible = [False]*(max_) # 1-Lmax
    
    for i,x in enumerate(L):
        if i!=n-1 and x==L[i+1]:
            isDivisible[x-1]=True
            continue
        j=2*x
        while j<=max_:
            isDivisible[j-1]=True
            j+=x
    ans=0
    for x in L:
        if not isDivisible[x-1]:
            ans+=1
    print(ans)
# print(ans)
    
if '__main__' == __name__:
    main()

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

n = int(input().strip())
L = list(map(int, input().strip().split()))
seen = Counter()
ans=0

for x in L:
    seen[x]+=1

for x in L:
    if seen[x]>1 or x!=1 and 1 in seen:
        continue

    tmp=2
    while tmp**2<=x:
        if x%tmp==0 and (tmp in seen or x/tmp in seen):
            break
        tmp+=1
    else:
        ans+=1

print(ans)

Fixed submission:
def main():
    n = int(input().strip())
    L = list(map(int, input().strip().split()))
    L.sort()
    max_=L[-1]
    isDivisible = [False]*(max_) # 1-Lmax
    
    for i,x in enumerate(L):
        if i!=n-1 and x==L[i+1]:
            isDivisible[x-1]=True
            continue
        j=2*x
        while j<=max_:
            isDivisible[j-1]=True
            j+=x
    ans=0
    for x in L:
        if not isDivisible[x-1]:
            ans+=1
    print(ans)
# print(ans)
    
if '__main__' == __name__:
    main()