Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
l = [int(x) for x in input().split()]
l_dict = {k: v for v, k in enumerate(l)}
l.sort()

s = ""
for x in l:
    s = s + str(l_dict[x] + 1) + " "

print(s[:-1])

Fixed submission:

N = int(input())
l = [int(x) for x in input().split()]
l_dict = {k: v for v, k in enumerate(l)}
l.sort()

for i, x in enumerate(l):
    if i == 0:
        print(l_dict[x] + 1, end="")
    else:
        print(" {}".format(str(l_dict[x] + 1)), end="")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
l = [ int(x) for x in input().split() ]

l_sorted = sorted(l)

s = ""
for x in l_sorted:
    s = s + str(l.index(x) + 1) + " "

print(s[:-1])

Fixed submission:

N = int(input())
l = [int(x) for x in input().split()]
l_dict = {k: v for v, k in enumerate(l)}
l.sort()

for i, x in enumerate(l):
    if i == 0:
        print(l_dict[x] + 1, end="")
    else:
        print(" {}".format(str(l_dict[x] + 1)), end="")
Buggy python submission (verdict: Runtime Error):

N, M = list(map(lambda x:int(x), input().split(' ')))
l = list(map(lambda x:int(x), input().split(' ')))

maxheap = MaxHeap(l)

WARI = 0.5
for _ in range(0, M):
    v = int(maxheap.pop() * WARI)
    maxheap.push(v)

SUM = 0
for _ in range(0, N):
    SUM += maxheap.pop()

print(SUM)

Fixed submission:
d = {'Sunny': 'Cloudy', 'Cloudy':'Rainy', 'Rainy':'Sunny'}
print(d[input()])
Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = map(int, input().split(' '))
res = [K for _ in range(N)]
for i in range(Q):
    a = int(input()) - 1
    res = list(map(lambda n: n-1, res))
    res[a] = res[a] + 1
for i in range(N):
    print('Yes' if res[i] > 0 else 'No')


Fixed submission:
N, K, Q = map(int, input().split(' '))
res = [0 for _ in range(N)]
for i in range(Q):
    a = int(input()) - 1
    res[a] = res[a] + 1
res = list(map(lambda n: n - Q + K, res))
for i in range(N):
    print('Yes' if res[i] > 0 else 'No')
Buggy python submission (verdict: Runtime Error):
import heapq
 
 
class MaxHeap(object):
    def __init__(self, x):
        self.heap = [-e for e in x]
        heapq.heapify(self.heap)
 
    def push(self, value):
        heapq.heappush(self.heap, -value)
 
    def pop(self):
        return -heapq.heappop(self.heap)
 
N, M = list(map(lambda x:int(x), input().split(' ')))
l = list(map(lambda x:int(x), input().split(' ')))

maxheap = MaxHeap(l)
 
WARI = 0.5
for _ in range(0, M):

Fixed submission:

import heapq


class MaxHeap(object):
    def __init__(self, x):
        self.heap = [-e for e in x]
        heapq.heapify(self.heap)

    def push(self, value):
        heapq.heappush(self.heap, -value)

    def pop(self):
        return -heapq.heappop(self.heap)

N, M = list(map(lambda x:int(x), input().split(' ')))
l = list(map(lambda x:int(x), input().split(' ')))

maxheap = MaxHeap(l)

WARI = 0.5
for _ in range(0, M):
    v = int(maxheap.pop() * WARI)
    maxheap.push(v)

SUM = 0
for _ in range(0, N):
    SUM += maxheap.pop()

print(SUM)

Buggy python submission (verdict: Runtime Error):

import heapq


class MaxHeap(object):
    def __init__(self, x):
        self.heap = [-e for e in x]
        heapq.heapify(self.heap)

    def push(self, value):
        heapq.heappush(self.heap, -value)

    def pop(self):
        return -heapq.heappop(self.heap)

N, M = list(map(lambda x:int(x), input().split(' ')))
l = list(map(lambda x:int(x), input().split(' ')))

print(N, M)
print(l)

maxheap = MaxHeap(l)

WARI = 0.5
for _ in range(0, M):
    v = int(maxheap.pop() * WARI)
    maxheap.push(v)

print(SUM)

Fixed submission:

import heapq


class MaxHeap(object):
    def __init__(self, x):
        self.heap = [-e for e in x]
        heapq.heapify(self.heap)

    def push(self, value):
        heapq.heappush(self.heap, -value)

    def pop(self):
        return -heapq.heappop(self.heap)

N, M = list(map(lambda x:int(x), input().split(' ')))
l = list(map(lambda x:int(x), input().split(' ')))

maxheap = MaxHeap(l)

WARI = 0.5
for _ in range(0, M):
    v = int(maxheap.pop() * WARI)
    maxheap.push(v)

SUM = 0
for _ in range(0, N):
    SUM += maxheap.pop()

print(SUM)
Buggy python submission (verdict: Time Limit Exceeded):
a=int(input())
res=1
l=list(map(int, input().split()))
for i in l:
    res*=i
if res>1000000000000000000:
    res=-1
print(res)
        


Fixed submission:
a=int(input())
res=1
flag=1
l=list(map(int, input().split()))
for i in l:
    if i==0:
        flag=0
if flag!=0:
    for i in l:
        res*=i
        if res>1000000000000000000:
            res=-1
            break
    if res>1000000000000000000:
        res=-1
else:
    res=0
print(res)
Buggy python submission (verdict: Runtime Error):
N=int(input())

a=N%10

if a==2 or a==4 or a==5 or a==7 or a==9:
  print('hon')
elif a==0 or a==1 or a==6 or a==8:
  print('pon')
else:
  print('bon')

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

print(A*B)
Buggy python submission (verdict: Runtime Error):
import numpy as np

N=int(input())
A=np.ones(N)
a=np.ones(N)

A=map(int,input().rstrip().split())


a=sorted(A,reverse=True)

a_product=1
flag_1e18=False
flag_0=False

if a[N-1]==0:
  flag_0=True

for i in range(0,N,1):
  a_product=a_product*a[i]
  if a_product>1e18:
    flag_1e18=True
    break
  else:
    continue
    
if flag_1e18==True and flag_0==False:
  print(-1)
elif flag_0==True:
  print(0)
else:
  print(A_product)
  


Fixed submission:
import numpy as np

N=int(input())
A=np.ones(N)
a=np.ones(N)

A=map(int,input().rstrip().split())


a=sorted(A,reverse=True)

a_product=1
flag_1e18=False
flag_0=False

if a[N-1]==0:
  flag_0=True

for i in range(0,N,1):
  a_product=a_product*a[i]
  if a_product>1e18:
    flag_1e18=True
    break
  else:
    continue
    
if flag_1e18==True and flag_0==False:
  print(-1)
elif flag_0==True:
  print(0)
else:
  print(a_product)

Buggy python submission (verdict: Runtime Error):
import numpy as np

N=int(input())
A=np.ones(N)
a=np.ones(N)

A=map(int,input().rstrip().split())


a=sorted(A,reverse=True)

a_product=1
flag_1e18=False
flag_0=False

if a[N-1]==0:
  flag_0=True

for i in range(0,N,1):
  a_product=a_product*a[i]
  if a_product>1e18:
    flag_1e18=True
  else:
    continue
    
if flag_1e18==True and flag_0==False:
  print(-1)
elif flag_0==True:
  print(0)
else:
  print(A_product)
  


Fixed submission:
import numpy as np

N=int(input())
A=np.ones(N)
a=np.ones(N)

A=map(int,input().rstrip().split())


a=sorted(A,reverse=True)

a_product=1
flag_1e18=False
flag_0=False

if a[N-1]==0:
  flag_0=True

for i in range(0,N,1):
  a_product=a_product*a[i]
  if a_product>1e18:
    flag_1e18=True
    break
  else:
    continue
    
if flag_1e18==True and flag_0==False:
  print(-1)
elif flag_0==True:
  print(0)
else:
  print(a_product)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N=int(input())
A=np.ones(N)
a=np.ones(N)

A=map(int,input().rstrip().split())


a=sorted(A,reverse=True)

A_product=1
flag_1e18=False

for i in range(0,N,1):
  A_product=A_product*a[i]
  if A_product>1e18:
    flag_1e18=True
  elif A_product==0:
    flag_1e18=False
  else:
    continue
    
if flag_1e18==True:
  print(-1)
else:
  print(A_product)
  


Fixed submission:
import numpy as np

N=int(input())
A=np.ones(N)
a=np.ones(N)

A=map(int,input().rstrip().split())


a=sorted(A,reverse=True)

a_product=1
flag_1e18=False
flag_0=False

if a[N-1]==0:
  flag_0=True

for i in range(0,N,1):
  a_product=a_product*a[i]
  if a_product>1e18:
    flag_1e18=True
    break
  else:
    continue
    
if flag_1e18==True and flag_0==False:
  print(-1)
elif flag_0==True:
  print(0)
else:
  print(a_product)
Buggy python submission (verdict: Runtime Error):
import math

N,M=map(int,input().split())
if N==1 and M==1:
  print(0)
elif N==1 and M!=1:
  print(int(math.factorial(M)/math.factorial(M-2)/math.factorial(2)))
elif M==1 and N!=1:
  print(int(math.factorial(N)/math.factorial(N-2)/math.factorial(2)))
else:
  print(int(math.factorial(N)/math.factorial(N-2)/math.factorial(2)+math.factorial(M)/math.factorial(M-2)/math.factorial(2)))


Fixed submission:
import math

N,M=map(int,input().split())

if (N==0 or N==1) and (M==0 or M==1):
  print(0)
elif (N==0 or N==1) and (M!=0 and M!=1):
  print(int(math.factorial(M)/math.factorial(M-2)/math.factorial(2)))
elif (M==0 or M==1) and (N!=0 and N!=1):
  print(int(math.factorial(N)/math.factorial(N-2)/math.factorial(2)))
else:
  print(int(math.factorial(N)/math.factorial(N-2)/math.factorial(2)+math.factorial(M)/math.factorial(M-2)/math.factorial(2)))

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

N,M=map(int,input().split())

print(int(math.factorial(N)/math.factorial(N-2)/math.factorial(2)+math.factorial(M)/math.factorial(M-2)/math.factorial(2)))


Fixed submission:
import math

N,M=map(int,input().split())

if (N==0 or N==1) and (M==0 or M==1):
  print(0)
elif (N==0 or N==1) and (M!=0 and M!=1):
  print(int(math.factorial(M)/math.factorial(M-2)/math.factorial(2)))
elif (M==0 or M==1) and (N!=0 and N!=1):
  print(int(math.factorial(N)/math.factorial(N-2)/math.factorial(2)))
else:
  print(int(math.factorial(N)/math.factorial(N-2)/math.factorial(2)+math.factorial(M)/math.factorial(M-2)/math.factorial(2)))
Buggy python submission (verdict: Runtime Error):
S=input()
flag=False
for i in range(len(S)):
  if i%2==0:
    if S[i]!='R' and S[i]!='U' and S[i]!='D':
      flag=True
  else:
    if S[i]!='L' and S[i]!='U' and S[i]!='D':
      flag=True
if flag=True:
  print('No')
else:
  print('Yes')

Fixed submission:
S=input()
flag=False
for i in range(len(S)):
  if i%2==0:
    if S[i]!='R' and S[i]!='U' and S[i]!='D':
      flag=True
  else:
    if S[i]!='L' and S[i]!='U' and S[i]!='D':
      flag=True
if flag==True:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
N,X=map(int,input().split())
if N!=1:
  L=list(map(int,input().split()))
  tot=0
  count=0
  while X>=tot:
    tot+=L[count]
    count+=1
  print(count)
else:
  L=int(input())
  if X>=L:
    print(2)
  else:
    print(1)

Fixed submission:
N,X=map(int,input().split())
if N!=1:
  L=list(map(int,input().split()))
  tot=0
  count=1
  for i in range(N):
    tot+=L[i]
    if X>=tot:
      count+=1
  print(count)
else:
  L=int(input())
  if X>=L:
    print(2)
  else:
    print(1)

Buggy python submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
tot=0
count=0
while X>=tot:
  tot+=L[count]
  count+=1
print(count)

Fixed submission:
N,X=map(int,input().split())
if N!=1:
  L=list(map(int,input().split()))
  tot=0
  count=1
  for i in range(N):
    tot+=L[i]
    if X>=tot:
      count+=1
  print(count)
else:
  L=int(input())
  if X>=L:
    print(2)
  else:
    print(1)
Buggy python submission (verdict: Runtime Error):
A,B,C,D=map(int,input().split())

if (A+B)>(C+D):
  print('left')
elif (A+B)=(C+D):
  print('Balanced')
else:
  print('Right')

Fixed submission:
A,B,C,D=map(int,input().split())
 
if (A+B)>(C+D):
  print('Left')
elif (A+B)==(C+D):
  print('Balanced')
else:
  print('Right')
Buggy python submission (verdict: Runtime Error):
c=input()

if c=='a' of c=='i' or c=='u' or c=='e' or c=='o':
  print('vowel')
else:
  print('consonant')

Fixed submission:
c=input()
 
if c=='a' or c=='i' or c=='u' or c=='e' or c=='o':
  print('vowel')
else:
  print('consonant')
Buggy python submission (verdict: Runtime Error):
X,N = map(int, input().split())
if N ==0:
  print(X)
  exit() 
if N !=0:
  p = list(map(int, input().split()))
if p.count(X) == 0:
  print(X)
  exit()
for a in range(1000):
  if p.count(X-a) ==0:
    print(X-a)
    exit()
  elif p.count(X+a) ==0:
    print(X+a)
    exit()


Fixed submission:
s = list(map(int, input().split()))
for i in range(len(s)):
  if s[i]==0:
    print(i+1)
Buggy python submission (verdict: Runtime Error):
X,N = map(int, input().split())
if N ==0:
  print(X)
  exit() 
if N ==0:
  print(X)
  exit() 
if p.count(X) == 0:
  print(X)
  exit()
for a in range(1000):
  if p.count(X-a) ==0:
    print(X-a)
    exit()
  elif p.count(X+a) ==0:
    print(X+a)
    exit()


Fixed submission:
X,N = map(int, input().split())
if N ==0:
  print(X)
  exit() 
if N !=0:
  p = list(map(int, input().split()))
if p.count(X) == 0:
  print(X)
  exit()
for a in range(1000):
  if p.count(X-a) ==0:
    print(X-a)
    exit()
  elif p.count(X+a) ==0:
    print(X+a)
    exit()
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
ans=0
for a in range(N):
  newA = [A[a]%n for n in A]
  newA.pop(a)
  if 0 in newA:
    ans = ans
  else:
    ans += 1
  
print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
Amax = A[-1]
dp = [1]*(Amax+1)
ans = 0
for i in range(len(A)-1):
  p = A[i]
  if dp[p] == 1:
    for q in range(Amax//p+1):
      dp[p*q] = 0
    if A[i] != A[i+1]: 
      ans += 1
if dp[Amax] == 1:
  ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
ans=0
for a in range(N):
  newA = [A[a]%n for n in A]
  newA.pop(a)
  print(newA)
  if 0 in newA:
    ans = ans
  else:
    ans += 1
  
print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
Amax = A[-1]
dp = [1]*(Amax+1)
ans = 0
for i in range(len(A)-1):
  p = A[i]
  if dp[p] == 1:
    for q in range(Amax//p+1):
      dp[p*q] = 0
    if A[i] != A[i+1]: 
      ans += 1
if dp[Amax] == 1:
  ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N, K= map(int,input().split())
A = list(map(int,input().split()))
p=0
while p<K:
  B=[0]*N
  for i in range(N):
    count = 0
    for j in range(N):
      if A[j]+1>abs(j-i):
        count +=1
    B[i] = count
  if min(A)==N:
    break
  A = B
  p +=1
print(*A)

Fixed submission:
A, V=map(int,input().split())
B, W=map(int,input().split())
T =int(input())
D = abs(A-B)

if (V-W)*T>=D:
  print("YES")
#elif 10**9-A<=V*T and A<B:
#  print("YES")
#elif abs(-10**9-A)<=V*T and A>B:
#  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
import sys
N=int(sys.stdin.readline())
L=list(map(int,sys.stdin.readline().split()))
count=[0]*N
C=list(set(L))
x=0
d=[0]*len(C)
e=[0]*N
for i in range(len(C)):
  d[i] = int((L.count(C[i]))*(L.count(C[i])-1)/2)
  x += d[i]  
for K in range(N):
  e[K] = L.count(L[K])-1
  print(x-e[K])


Fixed submission:
N,M=map(int,input().split())
print(int(N*(N-1)/2+M*(M-1)/2))
Buggy python submission (verdict: Runtime Error):
import sys
N=int(sys.stdin.readline())
L=list(map(int,sys.stdin.readline().split()))
C=list(set(L))
x=0
for i in range(len(C)):
  a = L.count(C[i])
  x += int(a*(a-1)/2)  
for K in range(N):
  print(x-L.count(L[K])+1)

Fixed submission:
a=int(input())
print((a/3)**3)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N, Q=map(int,input().split())
S=input()
L =[list(map(int,input().split()))for i in range(Q)]
c = [0]*(N)  #ACのチェック
s = [0]*(N)  #ACの累積和
ans = [0]*Q 

for i in range(N-1):
  if S[i] == "A" and S[i+1] == "C":
    c[i+1] = 1
s = np.cumsum(c)
for i in range(Q):
  ans[i] = s[L[i][1]-1]-s[L[i][0]-1]

for i in ans:
  print(i)

Fixed submission:
import numpy as np
N, Q=map(int,input().split())
S=input()
L =[list(map(int,input().split()))for i in range(Q)]
c = [0]*(N)  #ACのチェック
s = [0]*(N)  #ACの累積和
ans = [0]*Q 

for i in range(N-1):
  if S[i] == "A" and S[i+1] == "C":
    c[i+1] = 1
s = np.cumsum(c)
for i in range(Q):
  ans[i] = s[L[i][1]-1]-s[L[i][0]-1]

for i in ans:
  print(i)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N, Q=map(int,input().split())
S=input()
L =[list(map(int,input().split()))for i in range(Q)]
c = [0]*(N)  #ACのチェック
s = [0]*(N)  #ACの累積和
ans = [0]*Q 

for i in range(N-1):
  if S[i] == "A" and S[i+1] == "C":
    c[i+1] = 1
s = np.cumsum(c)
for i in range(Q):
  ans[i] = s[L[i][1]-1]-s[L[i][0]-1]

for i in ans:
  print(i)


Fixed submission:
import numpy as np
N, Q=map(int,input().split())
S=input()
L =[list(map(int,input().split()))for i in range(Q)]
c = [0]*(N)  #ACのチェック
s = [0]*(N)  #ACの累積和
ans = [0]*Q 

for i in range(N-1):
  if S[i] == "A" and S[i+1] == "C":
    c[i+1] = 1
s = np.cumsum(c)
for i in range(Q):
  ans[i] = s[L[i][1]-1]-s[L[i][0]-1]

for i in ans:
  print(i)
Buggy python submission (verdict: Runtime Error):
A=list(map(int,input().split()))

if max(A)<=8:
  print(Yay!)
else:
  print(:()

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

if max(A)<=8:
  print("Yay!")
else:
  print(":(")
Buggy python submission (verdict: Runtime Error):
D, N =map(int, input().split())
if N != 100:
  print(100**D*N)
else:
  print(100**d*101)
  

Fixed submission:
D, N =map(int, input().split())
if N != 100:
  print(100**D*N)
else:
  print(100**D*101)

Buggy python submission (verdict: Runtime Error):
D, N =map(int, input().split())
if N != 100:
  print(100**D*N)
else:
  print(100**d*101)
  

Fixed submission:
D, N =map(int, input().split())
if N != 100:
  print(100**D*N)
else:
  print(100**D*101)
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
K=int(input())
D=[]
for i in range(len(s)+1):
  for j in range(len(s)-i):
    D.append(s[i:i+j+1])
D = sorted(list(set(D)))
#print(D)
print(D[K-1])

Fixed submission:
s=input()
K=int(input())
D=[]
for i in range(len(s)+1):
  for j in range(min(len(s)-i,5)):
    D.append(s[i:i+j+1])
D = sorted(list(set(D)))
#print(D)
print(D[K-1])

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
K=int(input())
D=[]
for i in range(len(s)+1):
  for j in range(len(s)-i):
    D.append(s[i:i+j+1])
D = sorted(list(set(D)))
#print(D)
print(D[K-1])

Fixed submission:
s=input()
K=int(input())
D=[]
for i in range(len(s)+1):
  for j in range(min(len(s)-i,5)):
    D.append(s[i:i+j+1])
D = sorted(list(set(D)))
#print(D)
print(D[K-1])

Buggy python submission (verdict: Runtime Error):
s=input()
K=int(input())
D=[]
for i in range(len(s)):
  for j in range(len(s)-i-1):
    D.append(s[i:i+j+1])
D = sorted(list(set(D)))
print(D[K-1])

Fixed submission:
s=input()
K=int(input())
D=[]
for i in range(len(s)+1):
  for j in range(min(len(s)-i,5)):
    D.append(s[i:i+j+1])
D = sorted(list(set(D)))
#print(D)
print(D[K-1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = []
for i in range(int(N**0.5)):
  if N%(i+1) == 0:
    A.append(i)
print(len(str(int(N/A[-1]))))


Fixed submission:
def p(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
def P(L):
  P = 1
  for c in range(len(L)):
    P = P*L[c]
  return P  
N = int(input())
A = p(N)
F = []
for i in range(2**(len(A))):
  B = []
  C = []
  for j in range(len(A)):
    if(i>>j&1):
      B.append(A[j])
    else:
      C.append(A[j])
  F.append(max(len(str(P(B))),len(str(P(C)))))
  
print(min(F))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
nums = [int(e) for e in input().split()]
import numpy as np
nums.sort()
npnums = np.array(nums)

cnt = 0 #個数のカウント


for i,v in enumerate(nums):
    if np.count_nonzero(v % npnums[:i+2] == 0) > 1:
        cnt +=1
    else:
        continue
print(n-cnt)

Fixed submission:
n = int(input())
nums = [int(e) for e in input().split()]
import numpy as np

ans= np.zeros(max(nums)+1)

for i in nums:
    if ans[i] >1:
        continue
    else:
        ans[i::i] +=1

cnt = 0
for i in nums:
    if ans[i] ==1:
        cnt +=1

print(cnt)

Buggy python submission (verdict: Runtime Error):
n = int(input())
nums = [int(e) for e in input().split()]
import numpy as np
npnums = np.array(nums)

cnt = 0 #個数のカウント

test = np.zeros(n*n).reshape(n,n)
for i,v in enumerate(nums):
    test[i] +=v

mask = (test % npnums ==0)

for i in mask:
    if np.count_nonzero(i) >1:
        cnt+=1

print(n-cnt)

Fixed submission:
n = int(input())
nums = [int(e) for e in input().split()]
import numpy as np

ans= np.zeros(max(nums)+1)

for i in nums:
    if ans[i] >1:
        continue
    else:
        ans[i::i] +=1

cnt = 0
for i in nums:
    if ans[i] ==1:
        cnt +=1

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
nums = [int(e) for e in input().split()]
import numpy as np
npnums = np.array(nums)

cnt = 0 #個数のカウント

for i in nums:
    if np.count_nonzero(i % npnums == 0) > 1:
        cnt +=1
    else:
        continue
print(n-cnt)

Fixed submission:
n = int(input())
nums = [int(e) for e in input().split()]
import numpy as np

ans= np.zeros(max(nums)+1)

for i in nums:
    if ans[i] >1:
        continue
    else:
        ans[i::i] +=1

cnt = 0
for i in nums:
    if ans[i] ==1:
        cnt +=1

print(cnt)
Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
lista = [int(e) for e in input().split()]
lista = np.array(lista)
ans = np.cumprod(lista)

if ans > 10**18:
    ans=-1

print(ans)

Fixed submission:
n = int(input())
lista = [int(e) for e in input().split()]

if 0 in lista:
    ans = 0
else:
    ans = 1
    for i in lista:
        ans *= i
        if ans>10**18:
            ans = -1
            break

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lista = [int(e) for e in input().split()]
ans = 1
for i in lista:
    ans = ans *i

if ans > 10**18:
    ans=-1

print(ans)

Fixed submission:
n = int(input())
lista = [int(e) for e in input().split()]

if 0 in lista:
    ans = 0
else:
    ans = 1
    for i in lista:
        ans *= i
        if ans>10**18:
            ans = -1
            break

print(ans)
Buggy python submission (verdict: Runtime Error):
a, b = input().split()
a=int(a)
b = int(b*100)
c = a*b
c = c//100
print(c)

Fixed submission:
a, b = input().split()
a=int(a)
b = int(b.replace('.',''))
c = a*b
c = c//100
print(c)
Buggy python submission (verdict: Runtime Error):
import math

x = ((a*math.cos(math.pi/6*(h+m/60))-b*math.cos(math.pi/30*m))**2 + (a*math.sin(math.pi/6*(h+m/60))-b*math.sin(math.pi/30*m))**2 )**(1/2)

print(x)

Fixed submission:
a, b, h, m = [int(e) for e in input().split()]
import math

x = ((a*math.cos(math.pi/6*(h+m/60))-b*math.cos(math.pi/30*m))**2 + (a*math.sin(math.pi/6*(h+m/60))-b*math.sin(math.pi/30*m))**2 )**(1/2)

print(x)
Buggy python submission (verdict: Runtime Error):
a, b, c, k = [int(e) for e in input().split()]

import numpy as np

all = np.zeros(a+b+c)
all[:a] +=1
all[-c:] -=1

print(int(sum(all[:k])))

Fixed submission:
a, b, c, k = [int(e) for e in input().split()]

count=0

if k <= a:
    count +=k
elif k <= a+b:
    count +=a
else:
    count = 2*a + b - k

print(count)

Buggy python submission (verdict: Runtime Error):
a, b, c, k = [int(e) for e in input().split()]

import numpy as np

all = np.zeros(a+b+c)
all[:a] +=1
all[-c:] -=1

print(int(sum(all[:a+b])))

Fixed submission:
a, b, c, k = [int(e) for e in input().split()]

count=0

if k <= a:
    count +=k
elif k <= a+b:
    count +=a
else:
    count = 2*a + b - k

print(count)

Buggy python submission (verdict: Runtime Error):
a, b, c, k = [int(e) for e in input().split()]

import numpy as np

all = np.zeros(k)
all[:a] +=1
all[a+b:] -=1

print(sum(all))

Fixed submission:
a, b, c, k = [int(e) for e in input().split()]

count=0

if k <= a:
    count +=k
elif k <= a+b:
    count +=a
else:
    count = 2*a + b - k

print(count)