Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = list(map(int,input().split()))
    A.sort()
    num_tmp = [0]*(A[-1]+1)

    for a in A:
        num_tmp[a] += 1
        if num_tmp[a] == 1:
            for i in range(2*a,max(A)+1,a):
                num_tmp[i] = 2

    print(num_tmp.count(1))
    
main()

Fixed submission:
def main():
    N = int(input())
    A = list(map(int,input().split()))
    A.sort()
    MAX = A[-1]+1
    num_tmp = [0]*MAX

    for a in A:
        num_tmp[a] += 1
        if num_tmp[a] == 1:
            for i in range(2*a,MAX,a):
                num_tmp[i] = 2

    print(num_tmp.count(1))
    
main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = list(map(int,input().split()))
    A.sort()
    num_tmp = [0]*(max(A)+1)

    for a in A:
        num_tmp[a] += 1
        if num_tmp[a] == 1:
            for i in range(2*a,max(A)+1,a):
                num_tmp[i] = 2

    print(num_tmp.count(1))
    
main()

Fixed submission:
def main():
    N = int(input())
    A = list(map(int,input().split()))
    A.sort()
    MAX = A[-1]+1
    num_tmp = [0]*MAX

    for a in A:
        num_tmp[a] += 1
        if num_tmp[a] == 1:
            for i in range(2*a,MAX,a):
                num_tmp[i] = 2

    print(num_tmp.count(1))
    
main()

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
A.sort()
num_tmp = [0]*(max(A)+1)

for a in A:
    num_tmp[a] += 1
    if num_tmp[a] == 1:
        for i in range(2*a,max(A)+1,a):
            num_tmp[i] = 2

print(num_tmp.count(1))

Fixed submission:
def main():
    N = int(input())
    A = list(map(int,input().split()))
    A.sort()
    MAX = A[-1]+1
    num_tmp = [0]*MAX

    for a in A:
        num_tmp[a] += 1
        if num_tmp[a] == 1:
            for i in range(2*a,MAX,a):
                num_tmp[i] = 2

    print(num_tmp.count(1))
    
main()

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
A.sort()
num_tmp = [0]*(max(A)+1)

for a in A:
    num_tmp[a] += 1
    if num_tmp[a] == 1:
        for i in range(2*a,max(A)+1,a):
            num_tmp[i] = 2

ans = 0
for a in A:
    if num_tmp[a] == 1:
        ans += 1
        
print(ans)

Fixed submission:
def main():
    N = int(input())
    A = list(map(int,input().split()))
    A.sort()
    MAX = A[-1]+1
    num_tmp = [0]*MAX

    for a in A:
        num_tmp[a] += 1
        if num_tmp[a] == 1:
            for i in range(2*a,MAX,a):
                num_tmp[i] = 2

    print(num_tmp.count(1))
    
main()

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

MAX = 2*10**5+7
A.sort()

num_tmp = [0]*MAX

for a in A:
    if num_tmp[a] == 1:
        num_tmp[a] = 2
        continue
    for tmp in range(a,MAX,a):
        num_tmp[tmp] = 1

ans = 0
for a in A:
    if num_tmp[a] == 1:
        ans += 1
        
print(ans)

Fixed submission:
def main():
    N = int(input())
    A = list(map(int,input().split()))
    A.sort()
    MAX = A[-1]+1
    num_tmp = [0]*MAX

    for a in A:
        num_tmp[a] += 1
        if num_tmp[a] == 1:
            for i in range(2*a,MAX,a):
                num_tmp[i] = 2

    print(num_tmp.count(1))
    
main()

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

MAX = 2*10**5+7
A.sort()

num_tmp = [0]*MAX

for a in A:
    if num_tmp[a] == 1:
        num_tmp[a] = 2
        continue
    tmp = a
    while tmp <= MAX:
        num_tmp[tmp] = 1
        tmp += a

ans = 0
for a in A:
    if num_tmp[a] == 1:
        ans += 1
        
print(ans)

Fixed submission:
def main():
    N = int(input())
    A = list(map(int,input().split()))
    A.sort()
    MAX = A[-1]+1
    num_tmp = [0]*MAX

    for a in A:
        num_tmp[a] += 1
        if num_tmp[a] == 1:
            for i in range(2*a,MAX,a):
                num_tmp[i] = 2

    print(num_tmp.count(1))
    
main()