Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s = input()
if s == 'A':
    ans = 'T'
elif s== 'T':
    ans = 'A'
elif s == G:
    ans = 'C'
elif s == C:
    ans = 'G'
else:
    print("error")
    
print(ans)

Fixed submission:
s = input()
if s == 'A':
    ans = 'T'
elif s== 'T':
    ans = 'A'
elif s == 'G':
    ans = 'C'
elif s == 'C':
    ans = 'G'
else:
    print("error")
    
print(ans)

Buggy python submission (verdict: Runtime Error):

s = input()
if s == 'A':
    print('T')
elif s== 'T':
    print('A')
elif s == G:
    print('C')
else:
    print('G')

Fixed submission:
s = input()
if s == 'A':
    ans = 'T'
elif s== 'T':
    ans = 'A'
elif s == 'G':
    ans = 'C'
elif s == 'C':
    ans = 'G'
else:
    print("error")
    
print(ans)

Buggy python submission (verdict: Runtime Error):
s = input()
if s == 'A':
    print('C')
elif s== 'C':
    print('A')
elif s == G:
    print('T')
else:
    print('G')

Fixed submission:
s = input()
if s == 'A':
    ans = 'T'
elif s== 'T':
    ans = 'A'
elif s == 'G':
    ans = 'C'
elif s == 'C':
    ans = 'G'
else:
    print("error")
    
print(ans)
Buggy python submission (verdict: Runtime Error):
import sympy

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

set_a = set(sympy.divisors(A))
set_b = set(sympy.divisors(B))
# print(f'set_a ({A}): {set_a}')
# print(f'set_b ({B}): {set_b}')

set_ab = set_a.intersection(set_b)

list_ab = list(set_ab)
list_ab.sort()
# print(list_ab)

print(list_ab[K - 1])

Fixed submission:
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

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

set_a = set(make_divisors(A))
set_b = set(make_divisors(B))
set_ab = set_a.intersection(set_b)

list_ab = list(set_ab)
list_ab.sort()
# print(list_ab)

print(list_ab[-K])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input(''))

l = len(str(n))
s = 0
for i in range(l):
    j=10**(l-i-1)
    y = n//j
    n -= y*j
    s+=y

if s%9==0:
    print('Yes')
else:
    print('No')


Fixed submission:
n = input('')

s=0
for c in n:
    s+=int(c)

if s%9==0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input(''))

l = len(str(n))
s = 0
for i in range(len(str(n))):
    j = l-i-1
    y = n//10**j
    n -= y*10**j
    s+=y

if s%9==0:
    print('Yes')
else:
    print('No')


Fixed submission:
n = input('')

s=0
for c in n:
    s+=int(c)

if s%9==0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
nk = input('')
n = int(nk.split()[0])
k = int(nk.split()[1])

alist = list(map(int,input('').split()))

pre=0
result=1
for i in range(k):
    result *= alist[i]
pre=result
for i in range(1,n-k+1):
    result=result * alist[i+k-1] / alist[i-1]
#    print("[{}/{}]:{}".format(i,i+k,result))
    if result > pre:
        print('Yes')
    else:
        print('No')
    pre=result


Fixed submission:
nk = input('')
n = int(nk.split()[0])
k = int(nk.split()[1])

alist = list(map(int,input('').split()))

for i in range(1,n-k+1):
    removed = alist[i-1]
    inserted = alist[i+k-1]
    if inserted > removed:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
nk = input('')
n = int(nk.split()[0])
k = int(nk.split()[1])

alist = list(map(int,input('').split()))

pre=0
result=1
for i in range(n-k+1):
    record=""
    if i==0:
        for j in range(k):
            result *= alist[j+i]
    else:
        result=result * alist[i+k-1] / alist[i-1]
#    print("[{}/{}]:{}".format(i,i+k,result))
    if i>0:
        if result > pre:
            print('Yes')
        else:
            print('No')
    pre=result


Fixed submission:
nk = input('')
n = int(nk.split()[0])
k = int(nk.split()[1])

alist = list(map(int,input('').split()))

for i in range(1,n-k+1):
    removed = alist[i-1]
    inserted = alist[i+k-1]
    if inserted > removed:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
nk = input('')
n = int(nk.split()[0])
k = int(nk.split()[1])

alist = list(map(int,input('').split()))

pre=0
for i in range(n-k+1):
    result=1
    record=""
    for j in range(k):
        result *= alist[j+i]
#        record += " " + str(alist[j+i])
#    print("[{}/{}]:{} = {}".format(i,i+k-1,result,record))
    if i>0:
        if result > pre:
            print('Yes')
        else:
            print('No')
    pre=result


Fixed submission:
nk = input('')
n = int(nk.split()[0])
k = int(nk.split()[1])

alist = list(map(int,input('').split()))

for i in range(1,n-k+1):
    removed = alist[i-1]
    inserted = alist[i+k-1]
    if inserted > removed:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
nk = input('')
n = int(nk.split()[0])
k = int(nk.split()[1])

alist = list(map(int,input('').split()))

pre=0
for i in range(n-k+1):
    result=1
    record=""
    for j in range(k):
        result *= alist[j+i]
        record += " " + str(alist[j+i])
#    print("[{}/{}]:{} = {}".format(i,i+k-1,result,record))
    if i>0:
        if result > pre:
            print('Yes')
        else:
            print('No')
    pre=result


Fixed submission:
nk = input('')
n = int(nk.split()[0])
k = int(nk.split()[1])

alist = list(map(int,input('').split()))

for i in range(1,n-k+1):
    removed = alist[i-1]
    inserted = alist[i+k-1]
    if inserted > removed:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input(''))
alist = list(map(int,input('').split(' ')))

if 0 in alist:
    print("0")
else:
    result=1
    for a in alist:
        result*= a

    if result <= 10**18:
        print(result)
    else:
        print('-1')


Fixed submission:
n = int(input(''))
alist = list(map(int,input('').split(' ')))

if 0 in alist:
    result=0
else:
    result=1
    for a in alist:
        result*= a
        if result > 10**18:
            result = -1
            break

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input(''))
alist = list(map(int,input('').split(' ')))

result=1
for a in alist:
    result*= a

if result <= 10**18:
    print(result)
else:
    print('-1')


Fixed submission:
n = int(input(''))
alist = list(map(int,input('').split(' ')))

if 0 in alist:
    result=0
else:
    result=1
    for a in alist:
        result*= a
        if result > 10**18:
            result = -1
            break

print(result)
Buggy python submission (verdict: Runtime Error):
ab = input('')
a = int(ab.split(' ')[0])
b = int(ab.split(' ')[1])
import math
result =  math.floor(a*b)

print(result)


Fixed submission:
import decimal
ab = input('')
a = decimal.Decimal(ab.split(' ')[0])
b = decimal.Decimal(ab.split(' ')[1])
result =  a*b
import math
result = math.floor(result)
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
t = input('')

def check_score(s):    
    s1 = s.count('PD')
    s2 = s.count('D')
    return s1+s2

# ?の位置を調査
tlist = list(t)
qlist = []
for i in range(len(tlist)):
    if tlist[i] == '?':
        qlist.append(i)

n=len(qlist)
max_s = ''
max_c = 0
for i in range(2**n):
    tlist = list(t)
    s=''
    for j in range(n):
        idx = qlist[j]
        if ((i>>j) &1):
            tlist[idx] = 'P'
        else:
            tlist[idx] = 'D'
    st = "".join(tlist)
    score = check_score(st)
#    print("{}:{}".format(st,score))
    if score > max_c:
        max_c = score
        max_s = st

print("{}".format(max_s))

Fixed submission:
t = input('')

tlist = list(t)
for i in range(len(tlist)):
    if tlist[i] == '?':
        if i==0:
            tlist[i] = 'D'
        elif i==len(tlist)-1:
            tlist[i] = 'D'
        else:
            if tlist[i-1] == 'P':
                if tlist[i+1] == 'P':
                    tlist[i] = 'D'
                elif tlist[i+1] == 'D':
                    tlist[i] = 'D'
                elif tlist[i+1] == '?':
                    tlist[i] = 'D'
            else:
                # 1つ前が'D'
                if tlist[i+1] == 'P':
                    tlist[i] = 'D'
                elif tlist[i+1] == 'D':
                    tlist[i] = 'P'
                elif tlist[i+1] == '?':
                    tlist[i] = 'P'

print("".join(tlist))
Buggy python submission (verdict: Time Limit Exceeded):
x = int(input(''))

can = []
for a in range(10**4):
    if not a in can:
        can.append(a**5)

result = []
for a in can:
    for b in can:
        if a - b == x:
            ans = "{} {}".format(int(a**(1/5)),int(b**(1/5)))
            if not ans in result:
                result.append(ans)
        if a + b == x and a > b:
            ans = "{} {}".format(int(a**(1/5)),int(-1 * b**(1/5)))
            if not ans in result:
                result.append(ans)

for r in result:
    print(r)

Fixed submission:
x = int(input(''))

can = []
for a in range(10**3):
    a5 = a**5
    if not a5 in can:
        can.append(a5)

result = []
for a in can:
    for b in can:
        if a - b == x:
            ans = "{} {}".format(int(a**(1/5)),int(b**(1/5)))
            if not ans in result:
                result.append(ans)
        if a + b == x and a > b:
            ans = "{} {}".format(int(a**(1/5)),int(-1 * b**(1/5)))
            if not ans in result:
                result.append(ans)

for r in result:
    print(r)
Buggy python submission (verdict: Runtime Error):
r = int(input(""))
print(r*2*math.pi)


Fixed submission:
import math
r = int(input(''))
print(2*r*math.pi)

Buggy python submission (verdict: Runtime Error):
r = int(input(''))
print(2*r*math.pi)

Fixed submission:
import math
r = int(input(''))
print(2*r*math.pi)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input(''))
stra = input('')

alist = stra.split(' ')
dic = {}
for i in range(0,len(alist)):
  if alist[i] in dic.keys():
    dic[alist[i]]+=1
  else:
    dic[alist[i]] = 1

for k in range(0,n):
  cnt = 0
  key = alist[k]
  for k,v in dic.items():
    if k== key:
      cnt += ((v-1)*(v-2))/2
    else:
      cnt += (v*(v-1))/2
  print(int(cnt))

Fixed submission:
n = int(input(''))
stra = input('')

alist = stra.split(' ')
dic = {}
for i in range(0,len(alist)):
  if alist[i] in dic.keys():
    dic[alist[i]]+=1
  else:
    dic[alist[i]] = 1

all_cnt = 0    
for k,v in dic.items():
  all_cnt += (v*(v-1))/2

    
for k in range(0,n):
  cnt = 0
  key = alist[k]
  minus_cnt1 = (dic[key] * (dic[key]-1))/2
  minus_cnt2 = ((dic[key]-1) * (dic[key]-2))/2
  print(int(all_cnt -  minus_cnt1 + minus_cnt2))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input(''))
stra = input('')

for k in range(0,n):
  dic = {}
  alist = stra.split(' ')
  del alist[k]
  for i in range(0,len(alist)):
    if alist[i] in dic.keys():
      dic[alist[i]]+=1
    else:
      dic[alist[i]] = 1
  cnt = 0
  for k,v in dic.items():
    cnt += (v*(v-1))/2
  print(int(cnt))

Fixed submission:
n = int(input(''))
stra = input('')

alist = stra.split(' ')
dic = {}
for i in range(0,len(alist)):
  if alist[i] in dic.keys():
    dic[alist[i]]+=1
  else:
    dic[alist[i]] = 1

all_cnt = 0    
for k,v in dic.items():
  all_cnt += (v*(v-1))/2

    
for k in range(0,n):
  cnt = 0
  key = alist[k]
  minus_cnt1 = (dic[key] * (dic[key]-1))/2
  minus_cnt2 = ((dic[key]-1) * (dic[key]-2))/2
  print(int(all_cnt -  minus_cnt1 + minus_cnt2))
Buggy python submission (verdict: Runtime Error):
in1 = input('')
n = int(in1.split(' ')[0])
m = int(in1.split(' ')[1])
l = []
for i in range(0,n):
  l.append(0)

hasError = False
for i in range(0,m):
  in2 = input('')
  idx = int(in2.split(' ')[0])
  li = int(in2.split(' ')[1])
  if l[idx-1] != li:
    hasError = True
  else:
    l[idx-1] = li

result = 0
for i in range(0,n):
  ix = 1
  for j in range(0,(n-i-1)):
    ix*=10
  result += int(l[i])*ix

if result < 0:
  result = -1
if n == 1 and result == 0:
  result = 0
elif len(str(result)) != n:
  result = -1
if hasError = True:
  result = -1
print(result)



Fixed submission:
in1 = input('')
n = int(in1.split(' ')[0])
m = int(in1.split(' ')[1])
l = []
for i in range(0,n):
  l.append(-1)

hasError = False
for i in range(0,m):
  in2 = input('')
  idx = int(in2.split(' ')[0])-1
  li = int(in2.split(' ')[1])
  if l[idx] != -1 and l[idx] != li:
    hasError = True
  else:
    l[idx] = li

for i in range(0,n):
  if l[i] == -1:
    if i == 0 and n > 1:
      l[i] = 1
    else:
      l[i] = 0

result = 0
for i in range(0,n):
  ix = 1
  for j in range(0,(n-i-1)):
    ix*=10
  result += int(l[i])*ix

if result < 0:
  result = -1
if n == 1 and result == 0:
  result = 0
elif len(str(result)) != n:
  result = -1
if hasError == True:
  result = -1
print(result)
Buggy python submission (verdict: Runtime Error):
sz = int(input(''))
ary = []
for i in range(0,sz):
  s = input()
  ary.append(s)

map = {}
for w in ary:
  if not w in map:
    map[w] = 1
  else:
    map[w] +=1

max = 0
maxes = []
for k,v in map.items():
  if v > max:
    max = v

for k,v in map.items():
  if v == max:
    maxes.append(k)

for m in maxes.sort():
  print(m)

Fixed submission:
sz = int(input(''))
ary = []
for i in range(0,sz):
  s = input()
  ary.append(s)

map = {}
for w in ary:
  if not w in map:
    map[w] = 1
  else:
    map[w] +=1

max = 0
maxes = []
for k,v in map.items():
  if v > max:
    max = v

for k,v in map.items():
  if v == max:
    maxes.append(k)

for m in sorted(maxes):
  print(m)
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

N = int(input())
A = list(map(int, input().split()))
mod = 10**9 + 7
cnt = 0
for x,y in combinations(A,2):
    z = x * y % mod
    cnt += z
print(cnt % mod)

Fixed submission:
N = int(input())
A = [0] + list(map(int, input().split()))
mod = 10**9 + 7

t = sum(A)
ans = 0
for i in range(1,N+1):
    t -= A[i]
    ans += A[i] * t % mod
print(ans % mod)
Buggy python submission (verdict: Runtime Error):
from collections import deque
from sys import stdin, setrecursionlimit
input = stdin.readline

setrecursionlimit(100000)

def DFS(x,y):
    #global blocknum
    if mapmatrix[y][x] == '.' and blocknumlist[y][x] == -1:
        #blocknumlist[y][x] = blocknum
        num = blocknumlist[y][x]
        for dx, dy in move:
            X = x + dx; Y = y + dy
            if X == Dw and Y == Dh:
                print(num)
                exit()
            if X >= 0 and X < W and Y >= 0 and Y < H:
                if blocknumlist[Y][X] == -1 and mapmatrix[Y][X] == '.':
                    blocknumlist[Y][X] = num
                    DFS(X,Y)
        for dx, dy in move2:
            X = x + dx; Y = y + dy
            if X == Dw and Y == Dh:
                print(num + 1)
                exit()
            if X >= 0 and X < W and Y >= 0 and Y < H:
                if blocknumlist[Y][X] == -1 and mapmatrix[Y][X] == '.':
                    blocknumlist[Y][X] = num + 1
                    DFS(X,Y)

H,W = map(int, input().split())
Ch, Cw = map(int, input().split())
Dh, Dw = map(int, input().split())
Ch -= 1
Cw -= 1
Dh -= 1
Dw -= 1
mapmatrix = [None]*H
for i in range(H):
    mapmatrix[i] = list(input())

move = ((1,0),(-1,0),(0,-1),(0,1))
move2 = ((2,0),(-2,0),(0,-2),(0,2),(1,1),(-1,-1),(1,-1),(-1,1))
blocknumlist = [[-1]*W for _ in range(H)]
blocknum = 0

DFS(Cw,Ch)
print(-1)

Fixed submission:
from itertools import product
from collections import deque
from sys import stdin
input = stdin.readline

H,W = map(int, input().split())
Ch,Cw = map(lambda x: int(x) - 1, input().split())
Dh,Dw = map(lambda x: int(x) - 1, input().split())
S = [None]*H
for i in range(H):
    S[i] = list(input())

moveA = ((1,0),(0,1),(-1,0),(0,-1))
moveB = []
for i,j in product((-2,-1,0,1,2), repeat=2):
    if (i,j) not in moveA:
        moveB.append((i,j))

mapmatrix = [[-1]*W for _ in range(H)]
queue = deque()
queue.append((Cw,Ch))
mapmatrix[Ch][Cw] = 0

worpqueue = deque()
worpqueue.append((Cw,Ch))
while queue or worpqueue:
    while queue:
        x,y = queue.popleft()
        worpnum = mapmatrix[y][x]

        for dx, dy in moveA:
            X = x + dx; Y = y + dy
            if X >= 0 and X < W and Y >= 0 and Y < H:
                if mapmatrix[Y][X] == -1 and S[Y][X] == '.':
                    mapmatrix[Y][X] = worpnum
                    queue.append((X,Y))
                    worpqueue.append((X,Y))
                    
    nextworpqueue = deque()
    while worpqueue:
        x,y = worpqueue.popleft()
        worpnum = mapmatrix[y][x]

        for dx, dy in moveB:
            X = x + dx; Y = y + dy
            if X >= 0 and X < W and Y >= 0 and Y < H:
                if mapmatrix[Y][X] == -1 and S[Y][X] == '.':
                    mapmatrix[Y][X] = worpnum + 1
                    queue.append((X,Y))
                    nextworpqueue.append((X,Y))
    
    while nextworpqueue:
        x,y = nextworpqueue.popleft()
        worpqueue.append((x,y))
        
print(mapmatrix[Dh][Dw])
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
K = int(input())

cnt = 0
while b <= a:
    cnt += 1
    b *= 2
while c <= b:
    cnt += 1
    c *= 2
if cnt <= K:
    print('Yes')
else:
    print('No')

Fixed submission:
x = int(input())
a = (x - 400)//200
print(8-a)
Buggy python submission (verdict: Runtime Error):
from sys import stdin
input = stdin.readline

def accumulate(l, X):
    acclist = [0]*(l+1)
    for i in range(1,l+1):
        acclist[i] = acclist[i-1] + X[i]
    return acclist

N,M,K = map(int, input().split())
A = [0] + list(map(int, input().split()))
B = [0] + list(map(int, input().split()))

X = accumulate(N, A)
Y = accumulate(M, B)

maxbook = 0
j = M
for i in range(N+1):
    x = X[i]
    y = Y[j]
    while x + y > K:
        j -= 1 
        y = Y[j]
        if j <= 0:
            break
    maxbook = max(maxbook, i + j)

print(maxbook)

Fixed submission:
from sys import stdin
input = stdin.readline

def accumulate(l, X):
    acclist = [0]*(l+1)
    for i in range(1,l+1):
        acclist[i] = acclist[i-1] + X[i]
    return acclist

N,M,K = map(int, input().split())
A = [0] + list(map(int, input().split()))
B = [0] + list(map(int, input().split()))

X = accumulate(N, A)
Y = accumulate(M, B)

maxbook = 0
j = M
for i in range(N+1):
    x = X[i]
    y = Y[j]
    while x + y > K:
        j -= 1 
        if j < 0:
            break
        y = Y[j]
    if j < 0:
        break

    maxbook = max(maxbook, i + j)

print(maxbook)
Buggy python submission (verdict: Runtime Error):
import sympy

N = int(input())

ans = 0
for x in range(1, N+1):
    ans += x * sympy.divisor_count(x)
print(ans)

Fixed submission:
N = int(input())

ans = 0
for i in range(1,N+1):
    k = N // i
    ans += (i + i*k) * k // 2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

N,K = map(int, input().split())
P = list(map(int, input().split()))

ans = 100000000
for tup in combinations(P, K):
    price = sum(tup)
    ans = min(price,ans)
print(ans)

Fixed submission:
from itertools import combinations

N,K = map(int, input().split())
P = list(map(int, input().split()))

P.sort()
print(sum(P[:K]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

lis = []
for a in A:
    stra = str(a)
    S = '0b'
    i = 0
    for s in stra:
        s = 0 | (a >> i)
        if i%2 == 0:
            S = s + S
        else:
            if s == '0':
                S = '1' + S
            else:
                S = '0' + S
        i += 1
    lis.append(int(S))
print(*S)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

X = 0
for a in A:
    X = X ^ a

lis = []
for a in A:
    Y = X ^ a
    lis.append(Y)
print(*lis)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
A.sort()
INF = 10**6+1
lis = [1]*INF
exist = [0]*INF
for i in range(N):
    a = A[i]
    exist[a] += 1
    if lis[a]:
        q = 2
        while a*q < INF:
            lis[a*q] = 0
            q += 1
cnt = 0
for a in A:
    if lis[a] and exist[a] == 1:
        cnt += 1
print(cnt)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

INF = 10**6

A.sort()
check = [False] + [True]*(INF)

setA = list(set(A))
length = len(setA)
for i in range(length):
    x = setA[i]
    for j in range(2, int(INF/x)+1):
        check[x*j] = False

prev = 0
count = 0
flag = False #重複チェック
for i in range(N):
    x = A[i]
    if check[x]:
        if x != prev:
            count += 1
            flag = True
        elif flag:
            count -= 1
            flag = False
        prev = x
print(count)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
INF = 10**6+1
lis = [1]*INF
exist = [0]*INF
for i in range(N):
    a = A[i]
    exist[a] += 1
    if lis[a]:
        for q in range(2, INF // a + 1):
            lis[a*q] = 0
cnt = 0
for a in A:
    if lis[a] and exist[a] == 1:
        cnt += 1
print(cnt)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

INF = 10**6

A.sort()
check = [False] + [True]*(INF)

setA = list(set(A))
length = len(setA)
for i in range(length):
    x = setA[i]
    for j in range(2, int(INF/x)+1):
        check[x*j] = False

prev = 0
count = 0
flag = False #重複チェック
for i in range(N):
    x = A[i]
    if check[x]:
        if x != prev:
            count += 1
            flag = True
        elif flag:
            count -= 1
            flag = False
        prev = x
print(count)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
i = 0
while True:
    x = A[i]
    u = 0
    flag = True
    for j in range(i+1,N):
        j -= u
        if x == A[j]:
            flag = False
        if A[j]%x == 0:
            A.pop(j)
            N -= 1
            u += 1
        if j == N-1:
            break
    if flag == False:
        A.pop(i)
        N -= 1
        u += 1
    if i == N-1:
        break
    i += 1
print(len(A))

Fixed submission:
N = int(input())
A = list(map(int, input().split()))

INF = 10**6

A.sort()
check = [False] + [True]*(INF)

setA = list(set(A))
length = len(setA)
for i in range(length):
    x = setA[i]
    for j in range(2, int(INF/x)+1):
        check[x*j] = False

prev = 0
count = 0
flag = False #重複チェック
for i in range(N):
    x = A[i]
    if check[x]:
        if x != prev:
            count += 1
            flag = True
        elif flag:
            count -= 1
            flag = False
        prev = x
print(count)
Buggy python submission (verdict: Runtime Error):
a,v = map(int, input().split())
b,w = map(int, input().split())
T = int(input())
if b-a < (v-w)*T and (b-a)%(v-w) == 0:
    print('YES')
else:
    print('NO')

Fixed submission:
a,v = map(int, input().split())
b,w = map(int, input().split())
T = int(input())
if abs(b-a) <= (v-w)*T:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce
n = int(input())
A = list(map(int, input().split()))
ans = reduce(mul, A)
if ans <= 10**18:
    print(ans)
else:
    print(-1) 

Fixed submission:
from sys import stdin
input = stdin.readline

n = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range(n):
    ans = ans * A[i]
    if ans > 10**18:
        for j in range(i+1,n):
            if A[j] == 0:
                print(0)
                exit()
        print(-1)
        exit()
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range(n):
    ans = ans * A[i]
if ans <= 10**18:
    print(ans)
else:
    print(-1)

Fixed submission:
from sys import stdin
input = stdin.readline

n = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range(n):
    ans = ans * A[i]
    if ans > 10**18:
        for j in range(i+1,n):
            if A[j] == 0:
                print(0)
                exit()
        print(-1)
        exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
b = int(b*100)
print(a*b/100)

Fixed submission:
from decimal import Decimal
s = input().split()
a,b = int(s[0]),Decimal(s[1])
print(int(a*b))