Buggy python submission (verdict: Time Limit Exceeded):
def prime(n):
    if (n==2):
        return True
    elif(n == 1):
        return False
    else:
        pr = [2]
        for i in range(3,n):
            c = 0
            for p in pr:
                if (i % p != 0):
                    c = c + 1
            if (c == len(pr)):
                pr.append(i)
        cc = 0        
        for p in pr:
            if(n%p != 0):
                cc = cc + 1
    
    if(cc == len(pr)):
        return True
    else:
        return False
        
    
N = int(input())

count = 0
for i in range(N):
    n = int(input())
    if prime(n) == True:
        count = count + 1 
print(count)   
   


Fixed submission:
n = int(input())
mlist = []
plist = [2]
for i in range(3,10000):
    count = 0
    for k in plist:
        if (i%k != 0):
            count += 1
        else:
            break
    if (count == len(plist)):
        plist.append(i)
def check(m):
    for p in plist:
        if (m <= p):
            return True
        if m%p == 0:
            return False     ##한번이라도 False가 return되면 False가 되기에 prime인지 아닌지 check가능
    return True

count = 0
for i in range(n):
    m = int(input())
    if check(m):
        count += 1
        
print(count)

Buggy python submission (verdict: Runtime Error):
def composite(d,n,s): for a in (2,3,5,7): p = False if pow(a,d,n) == 1: continue for i in range(s): if pow(a, 2**i * d, n) == n-1: p = True break if not p: return True return False def is_prime(n): if n in (2,3,5,7): return True elif 0 in (n%2,n%3,n%5,n%7): return False else: d,s = n-1, 0 while not d%2: d,s = d>>1,s+1 return not composite(d,n,s) r = [] n = int(input()) for i in range(n): n = int(input()) if is_prime(n): r.append(n) print(len(r)) 


Fixed submission:
n = int(input())
mlist = []
plist = [2]
for i in range(3,10000):
    count = 0
    for k in plist:
        if (i%k != 0):
            count += 1
        else:
            break
    if (count == len(plist)):
        plist.append(i)
def check(m):
    for p in plist:
        if (m <= p):
            return True
        if m%p == 0:
            return False     ##한번이라도 False가 return되면 False가 되기에 prime인지 아닌지 check가능
    return True

count = 0
for i in range(n):
    m = int(input())
    if check(m):
        count += 1
        
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
def prime(n):
    if (n==2):
        return True
    elif(n == 1):
        return False
    else:
        pr = [2]
        for i in range(3,n):
            c = 0
            for p in pr:
                if (i % p != 0):
                    c = c + 1
            if (c == len(pr)):
                if n%i == 0:
                    return False 
                    break
                pr.append(i)
        cc = 0        
        for p in pr:
            if(n%p != 0):
                cc = cc + 1
            elif(n%p == 0):
                return False
                break
    
    if(cc == len(pr)):
        return True
    else:
        return False
        
    
N = int(input())

count = 0
for i in range(N):
    n = int(input())
    if prime(n) == True:
        count = count + 1 
print(count)   


Fixed submission:
n = int(input())
mlist = []
plist = [2]
for i in range(3,10000):
    count = 0
    for k in plist:
        if (i%k != 0):
            count += 1
        else:
            break
    if (count == len(plist)):
        plist.append(i)
def check(m):
    for p in plist:
        if (m <= p):
            return True
        if m%p == 0:
            return False     ##한번이라도 False가 return되면 False가 되기에 prime인지 아닌지 check가능
    return True

count = 0
for i in range(n):
    m = int(input())
    if check(m):
        count += 1
        
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
mlist = []
for i in range(n):
    m = int(input())
    mlist.append(m)
mlist.sort()
plist = [2]
for i in range(3,mlist[-1]+1):
    count = 0
    for k in plist:
        if (i%k != 0):
            count += 1
        else:
            break
    if (count == len(plist)):
        plist.append(i)
count = 0
for i in mlist:
    if(i in plist):
        count += 1
print(count)  



Fixed submission:
n = int(input())
mlist = []
plist = [2]
for i in range(3,10000):
    count = 0
    for k in plist:
        if (i%k != 0):
            count += 1
        else:
            break
    if (count == len(plist)):
        plist.append(i)
def check(m):
    for p in plist:
        if (m <= p):
            return True
        if m%p == 0:
            return False     ##한번이라도 False가 return되면 False가 되기에 prime인지 아닌지 check가능
    return True

count = 0
for i in range(n):
    m = int(input())
    if check(m):
        count += 1
        
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
mlist = []
for i in range(n):
    m = int(input())
    mlist.append(m)
mlist.sort()
plist = [2]
count = 0
j = 2
for i in mlist:
    if (i in plist):
        count += 1  
    else:
        for k in range(j+1, i+1):
            c = 0
            for p in plist:
                if (k % p != 0):
                    c += 1
                else : 
                    break
            if (c == len(plist)):
                plist.append(k)   
                if (k == i):
                    count += 1
    j = i
print(count)  


Fixed submission:
n = int(input())
mlist = []
plist = [2]
for i in range(3,10000):
    count = 0
    for k in plist:
        if (i%k != 0):
            count += 1
        else:
            break
    if (count == len(plist)):
        plist.append(i)
def check(m):
    for p in plist:
        if (m <= p):
            return True
        if m%p == 0:
            return False     ##한번이라도 False가 return되면 False가 되기에 prime인지 아닌지 check가능
    return True

count = 0
for i in range(n):
    m = int(input())
    if check(m):
        count += 1
        
print(count)