Buggy python submission (verdict: Runtime Error):
def main():
    #input
    N=int(input())
    A=list(map(int,input().strip().split()))

    A.sort()

    l=[True for _ in range(A[-1]+1)]
    
    cnt=0
    for n in range(N):
        if l[A[n]]==True:
            cnt+=1
            l[A[n]]=False
            i=2
            while i*A[n]<=A[-1]:
                l[A[n]*i]=False
                i+=1
    if A[0]==A[1]:
        cnt-=1
    return cnt
if __name__=="__main__":
    print(main())

Fixed submission:
def main():
    #input
    N=int(input())
    A=list(map(int,input().strip().split()))

    A.sort()

    l=[True for _ in range(A[-1]+1)]
    
    cnt=0
    for n in range(N-1):
        if l[A[n]]==True:
            if A[n]==A[n+1]:
                l[A[n]]=False
            else:
                l[A[n]]=False
                cnt+=1
            i=1
            while i*A[n]<=A[-1]:
                l[A[n]*i]=False
                i+=1
    if l[A[N-1]]==True:
        cnt+=1
        l[A[N-1]]=False
    return cnt

if __name__=="__main__":
    print(main())

Buggy python submission (verdict: Runtime Error):
def main():
    #input
    N=int(input())
    A=list(map(int,input().strip().split()))

    A.sort()

    l=[True for _ in range(A[-1])]
    
    cnt=0
    for n in range(N):
        if l[A[n]-1]==True:
            cnt+=1
            l[A[n]-1]=False
            i=1
            while i*A[n]-1<=len(l)-1:
                l[A[n]*i-1]=False
                i+=1
    if A[0]==A[1]:
        cnt-=1
    return cnt
if __name__=="__main__":
    print(main())

Fixed submission:
def main():
    #input
    N=int(input())
    A=list(map(int,input().strip().split()))

    A.sort()

    l=[True for _ in range(A[-1]+1)]
    
    cnt=0
    for n in range(N-1):
        if l[A[n]]==True:
            if A[n]==A[n+1]:
                l[A[n]]=False
            else:
                l[A[n]]=False
                cnt+=1
            i=1
            while i*A[n]<=A[-1]:
                l[A[n]*i]=False
                i+=1
    if l[A[N-1]]==True:
        cnt+=1
        l[A[N-1]]=False
    return cnt

if __name__=="__main__":
    print(main())

Buggy python submission (verdict: Runtime Error):
import math

def prime(x):
    if x==1:
        prime=True
        #この問題に合わせて１でもTrueとする
    else:
        prime=True
        for i in range(2,int(math.sqrt(x)+1)):
            if x%i==0:
                prime=False
                break
    return prime

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

    A.sort(reverse=True)
    
    #割り切れた場合+1
    cnt=0
    for i in range(N-1):
        #A[i]が素数または1の場合
        if prime(A[i]):
            #前後に同じ数がない場合、割り切れない
            if i<N-1:
                if A[i]==A[i+1]:
                    cnt+=1
            elif i>0:
                if A[i]==A[i-1]:
                    cnt+=1
        #A[i]が素数ではない場合
        else:
            for j in reversed(range(i+1,N)):
                if A[i]%A[j]==0:
                    cnt+=1
                    break
    if A[-1]%A[-2]==0:
        cnt+=1
    print(N-cnt)

if __name__=="__main__":
    main()

Fixed submission:
def main():
    #input
    N=int(input())
    A=list(map(int,input().strip().split()))

    A.sort()

    l=[True for _ in range(A[-1]+1)]
    
    cnt=0
    for n in range(N-1):
        if l[A[n]]==True:
            if A[n]==A[n+1]:
                l[A[n]]=False
            else:
                l[A[n]]=False
                cnt+=1
            i=1
            while i*A[n]<=A[-1]:
                l[A[n]*i]=False
                i+=1
    if l[A[N-1]]==True:
        cnt+=1
        l[A[N-1]]=False
    return cnt

if __name__=="__main__":
    print(main())

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().strip().split()))

A.sort(reverse=True)

cnt=0
for i in range(N-1):
    for j in reversed(range(i+1,N)):
        if A[i]%A[j]==0:
            cnt+=1
            break
if A[-1]%A[-2]==0:
    cnt+=1
print(N-cnt)

Fixed submission:
def main():
    #input
    N=int(input())
    A=list(map(int,input().strip().split()))

    A.sort()

    l=[True for _ in range(A[-1]+1)]
    
    cnt=0
    for n in range(N-1):
        if l[A[n]]==True:
            if A[n]==A[n+1]:
                l[A[n]]=False
            else:
                l[A[n]]=False
                cnt+=1
            i=1
            while i*A[n]<=A[-1]:
                l[A[n]*i]=False
                i+=1
    if l[A[N-1]]==True:
        cnt+=1
        l[A[N-1]]=False
    return cnt

if __name__=="__main__":
    print(main())