Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N= int(input())
A = list(map(int,input().split()))
B= [A.count(i+1) for i in range(N)]
for i in range(N):
  print(B[i])
          

Fixed submission:
N= int(input())
A = list(map(int,input().split()))
B =[0 for i in range(N)]
for i in A:
  B[i-1] += 1
for i in B:
  print(i)
Buggy python submission (verdict: Runtime Error):
N,M-map(int,input().split())
hoge=list(ap,int,input.split())
total_vote=sum(hoge)
if sorted(hoge)[-M]>total_vote/(4*M):
  print('Yes')
else:
  print('No')


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

if sorted(hoge)[-M] >= sum(hoge)/(4*M):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
a=N
while True:
  b=a
  a=abs(a-K)
  if a>b:
    break
print(b) 

Fixed submission:
N,K=map(int,input().split())
a=N % K
print(min(a,abs(K-a)))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S = [input() for _ in range(N)]
maxA=0
B=[]
for i in set(S):
  A=(S.count(i))
  if A > maxA:
    maxA=A
    B = [i]
  if A == maxA and i not in B:
    B.append(i)
[print(j) for j in sorted(B)]

Fixed submission:
N=int(input())
S = [input() for _ in range(N)]
import collections 
C=collections.Counter(S)
maxC=max(C.values())
keys = [k for k, v in C.items() if v == maxC]
[print(j) for j in sorted(keys)]
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
A=list(map(int,input().split()))
maxvalue=0
for i in range(N-K+1):
  maxvalue=max(maxvalue,sum(A[i:i+K]))
print((maxvalue+K)/2)

Fixed submission:
N,K=map(int,input().split())
A=list(map(int,input().split()))
summation=[0,A[0]]
for i in range(1,N):
  summation.append(summation[i]+A[i])

maxvalue=summation[K]
for i in range(1,1+N-K):
  maxvalue=max(maxvalue,summation[i+K]-summation[i])
print((maxvalue+K)/2)

Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=map(int,input().split())
maxvalue=0
for i in range(N-K):
  maxvalue=max(maxvalue,sum(A[K:N+K]))
print(maxvalue)

Fixed submission:
N,K=map(int,input().split())
A=list(map(int,input().split()))
summation=[0,A[0]]
for i in range(1,N):
  summation.append(summation[i]+A[i])

maxvalue=summation[K]
for i in range(1,1+N-K):
  maxvalue=max(maxvalue,summation[i+K]-summation[i])
print((maxvalue+K)/2)
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=[0]*M
pen=0
for i in range(M):
  p,S=input().split()
  if S=="AC":
    A[int(p)-1]=1
  elif S=="WA" and A[int(p)-1]==0:
    pen += 1
print(sum(A),pen)

Fixed submission:
N,M=map(int,input().split())
A=[0]*N
B=[0]*N
pen=0
for i in range(M):
  p,S=input().split()
  if S=="AC":
    A[int(p)-1]=1
  elif S=="WA" and A[int(p)-1]==0:
    B[int(p)-1] += 1
penalty=[A[i]*B[i] for i in range(N)]
print(sum(A),sum(penalty))
Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
L=[1,2,3]
p=L.pop(A-1)
q=L.pop(B-1)
print(L[0])

Fixed submission:
A=int(input())
B=int(input())
print(6-A-B)
Buggy python submission (verdict: Runtime Error):
N=int(input())
L=[[] for i in range(N)]
for i in range(N):
  M=int(input())
  L[i]=[list(map(int,input().split())) for j in range(M)]
#print(L)

L_2=[[i,None] for i in range(N)]
L_3=[0 for i in range(N)]
ans=0
for k in range(2**N):
	L_3=[0 for i in range(N)]
    Y_N=True
	count=0
	for a in range(N):
		if ((k >> a) & 1):  # 正直者のリストを作る
			L_3[a]=1
	for a in range(N):  # このループが一番のポイント
		if ((k >> a) & 1):  # 正直者のリスト
			count += 1
			for b in range(len(L[a])):
				if L_3[a] == 0: #もし正直者じゃないとされてたら
					Y_N=False #破綻
				person = L[a][b][0]-1
				if L_3[person]==1-L[a][b][1]: #すでに言われてることと矛盾
					Y_N=False #破綻
				L_3[person]=L[a][b][1] #証言の内容で人となりをアップデート
				#print(L_3,a,b)
	#print(L_3,count,Y_N)
	if Y_N:
		ans = max(ans, count)
print(ans)

Fixed submission:
N=int(input())
L=[[] for i in range(N)]
for i in range(N):
  M=int(input())
  L[i]=[list(map(int,input().split())) for j in range(M)]
#print(L)

L_2=[[i,None] for i in range(N)]
L_3=[0 for i in range(N)]
ans=0
for k in range(2**N):
	L_3=[0 for i in range(N)]
	Y_N=True
	count=0
	for a in range(N):
		if ((k >> a) & 1):  # 正直者のリストを作る
			L_3[a]=1
	for a in range(N):  # このループが一番のポイント
		if ((k >> a) & 1):  # 正直者のリスト
			count += 1
			for b in range(len(L[a])):
				if L_3[a] == 0: #もし正直者じゃないとされてたら
					Y_N=False #破綻
				person = L[a][b][0]-1
				if L_3[person]==1-L[a][b][1]: #すでに言われてることと矛盾
					Y_N=False #破綻
				L_3[person]=L[a][b][1] #証言の内容で人となりをアップデート
				#print(L_3,a,b)
	#print(L_3,count,Y_N)
	if Y_N:
		ans = max(ans, count)
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
import math
A=list(map(int,input().split()))
b=math.ceil(math.log(max(A),2)) 
B=[0 for i in range(b)] #0のリスト
C=[0 for i in range(b)] #1のリスト
for i in A:
  for j in range(b):
    if ((i>>j) & 1):
      C[j]+=1
    else:
      B[j]+=1
 # print(B,C,i)
mod =10**9+7
ans=[(B[i]*C[i])*2**i % mod for i in range(b)]
print(sum(ans)%mod)

Fixed submission:
N=int(input())
import math
A=list(map(int,input().split()))
b=math.ceil(math.log(max(max(A),1),2)) 
B=[0 for i in range(b)] #0のリスト
C=[0 for i in range(b)] #1のリスト
for i in A:
  for j in range(b):
    if ((i>>j) & 1):
      C[j]+=1
    else:
      B[j]+=1
 # print(B,C,i)
mod =10**9+7
ans=[(B[i]*C[i])*2**i % mod for i in range(b)]
print(sum(ans)%mod)

Buggy python submission (verdict: Runtime Error):
N=int(input())
import math
A=list(map(int,input().split()))
b=math.ceil(math.log2(max(A))) 
B=[0 for i in range(b)] #0のリスト
C=[0 for i in range(b)] #1のリスト
for i in A:
  for j in range(b):
    if ((i>>j) & 1):
      C[j]+=1
    else:
      B[j]+=1
 # print(B,C,i)
mod =10**9+7
ans=[(B[i]*C[i])*2**i % mod for i in range(b)]
print(sum(ans)%mod)

Fixed submission:
N=int(input())
import math
A=list(map(int,input().split()))
b=math.ceil(math.log(max(max(A),1),2)) 
B=[0 for i in range(b)] #0のリスト
C=[0 for i in range(b)] #1のリスト
for i in A:
  for j in range(b):
    if ((i>>j) & 1):
      C[j]+=1
    else:
      B[j]+=1
 # print(B,C,i)
mod =10**9+7
ans=[(B[i]*C[i])*2**i % mod for i in range(b)]
print(sum(ans)%mod)

Buggy python submission (verdict: Runtime Error):
N=int(input())
import math
A=list(map(int,input().split()))
b=math.ceil(math.log2(max(A))) 
B=[0 for i in range(b)] #0のリスト
C=[0 for i in range(b)] #1のリスト
for i in A:
  for j in range(b):
    if ((i>>j) & 1):
      C[j]+=1
    else:
      B[j]+=1
 # print(B,C,i)
mod =10**9+7
ans=[(B[i]*C[i])*2**i % mod for i in range(b)]
print(sum(ans)%mod)

Fixed submission:
N=int(input())
import math
A=list(map(int,input().split()))
b=math.ceil(math.log(max(max(A),1),2)) 
B=[0 for i in range(b)] #0のリスト
C=[0 for i in range(b)] #1のリスト
for i in A:
  for j in range(b):
    if ((i>>j) & 1):
      C[j]+=1
    else:
      B[j]+=1
 # print(B,C,i)
mod =10**9+7
ans=[(B[i]*C[i])*2**i % mod for i in range(b)]
print(sum(ans)%mod)
Buggy python submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
if x==a*a*b:
  print(0)
elif x/a>=a*b/2:
  tangent= 2*b/a-2*x/a**3
else:
  tangent=a*b*b /(2*x)
print(math.degrees(math.atan(tangent)))


Fixed submission:
import math
a,b,x=map(int,input().split())
if x/a>=a*b/2:
  tangent= 2*b/a-2*x/a**3
else:
  tangent=a*b*b /(2*x)
print(math.degrees(math.atan(tangent)))

Buggy python submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
if x/2>=a*b/2:
  tangent=a**2 / ((a*b-x/a)*2)
  print(90-math.atan(tangent)*180/math.pi)
else:
  tangent=2*x/(a*(b**2))
  print(90-math.atan(tangent)*180/math.pi)
        
  

Fixed submission:
import math
a,b,x=map(int,input().split())
if x/a>=a*b/2:
  tangent= 2*b/a-2*x/a**3
else:
  tangent=a*b*b /(2*x)
print(math.degrees(math.atan(tangent)))
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
for i in range(M):
  B = A[-1]//2
  del A[-1]
  bisect.insort_left(A, B)
  #print(A)
print(sum(A))

Fixed submission:
import heapq
N,M=map(int,input().split())
A=list(map(lambda x:int(x)*(-1),input().split()))
heapq.heapify(A) #落としたりするのもO(N)かかってしまうのでHeapで実装
#A=[i for i in range(N)]
for i in range(M):
  B = heapq.heappop(A)
  heapq.heappush(A,-1*(-1*B//2))
  #print(A)
print(-sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
for i in range(M):
  B = A[-1]//2
  A=A[:N-1]
  bisect.insort_left(A, B)
  #print(A)
print(sum(A))

Fixed submission:
import heapq
N,M=map(int,input().split())
A=list(map(lambda x:int(x)*(-1),input().split()))
heapq.heapify(A) #落としたりするのもO(N)かかってしまうのでHeapで実装
#A=[i for i in range(N)]
for i in range(M):
  B = heapq.heappop(A)
  heapq.heappush(A,-1*(-1*B//2))
  #print(A)
print(-sum(A))
Buggy python submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split()))
i = 0
ans =[]
cnt = 0
for i in range( N-1 ):
  if H[i] >= H[i+1]:
    cnt += 1
  else:
    ans.append(cnt)
    cnt = 0
  ans.append(cnt)
print(max(ans))
       

Fixed submission:
N=int(input())
H=list(map(int,input().split()))
ans =[]
cnt = 0
if N == 1:
  print (0)
  exit()
for i in range( N-1 ):
  if H[i] >= H[i+1]:
    cnt += 1
  else:
    ans.append(cnt)
    cnt = 0
  ans.append(cnt)
print(max(ans))
Buggy python submission (verdict: Runtime Error):
S=input()
N=len(S)
A=[int(i) for i in S]
B=["+" for i in range(N-1)]
output=S[0]
for i in range(2**N):
  for j in range(1,N):
    if (i>>j)&1:
      A[j]= -1*int(str(S[j]))
      B[j]=  "-"
  #print(A,B,sum(A))
  if sum(A) ==7:
    for i in range(1,N):
      output += B[i-1] + str(S[i])
    print(output+"=7")
    break


Fixed submission:
S=input()
N=len(S)
A=[int(i) for i in S]
D=["+" for i in range(N-1)]
output=S[0]
for i in range(2**N):
  C=A
  B=D
  for j in range(N-1):
    if ((i>>j)&1):
      C[j+1]= -1*int(str(S[j+1]))
      B[j]=  "-"
    else:
      C[j+1]= int(str(S[j+1]))
      B[j]=  "+"
  #print(C,B,sum(C))
  if sum(C) ==7:
    for i in range(1,N):
      output += B[i-1] + str(S[i])
    print(output+"=7")
    break
Buggy python submission (verdict: Runtime Error):
ist=[]
starting = 400
for I in range(400,2001):
    list.append(starting)
    starting += 1
n=int(input(""))
for I in list:
    if(n>=400 and n<=599):
        print("8")
        break
    elif(n>=600 and n<=799):
        print("7")
        break
    elif(n>=800 and n<=999):
        print("6")
        break
    elif(n>=1000 and n<=1199):
        print("5")
        break
    elif(n>=1200 and n<=1399):
        print("4")
        break
    elif(n>=1400 and n<=1599):
        print("3")
        break
    elif(n>=1600 and n<=1799):
        print("2")
        break
    elif(n>=1800 and n<=1999):
        print("1")
        break

Fixed submission:
n=int(input(""))
if(n>=400 and n<=599):
        print("8")
elif(n>=600 and n<=799):
        print("7")
       
elif(n>=800 and n<=999):
        print("6")
       
elif(n>=1000 and n<=1199):
        print("5")
        
elif(n>=1200 and n<=1399):
        print("4")
       
elif(n>=1400 and n<=1599):
        print("3")
       
elif(n>=1600 and n<=1799):
        print("2")
        
elif(n>=1800 and n<=1999):
        print("1")
Buggy python submission (verdict: Runtime Error):
L= int(input(""))
R= int(input(""))
d= int(input(""))
count=0
for I in range(L, R+1):
    if(I%d == 0):
        count= count +1
print(count)
        

Fixed submission:
L,R,d= map(int, input().split())
count=0
for I in range(L, R+1):
    if(I%d == 0):
        count= count +1
print(count)

Buggy python submission (verdict: Runtime Error):
L= int(input(""))
R= int(input(""))
d= int(input(""))
list=[]
list2=[]
for I in range(L, R+1):
    list.append(I)
for I in list:
    if(I%d == 0):
        list2.append(I)
count=0
for I in list2:
        count= count +1
print(count)
       

Fixed submission:
L,R,d= map(int, input().split())
count=0
for I in range(L, R+1):
    if(I%d == 0):
        count= count +1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N, K, *A = map(int, open(0).read().split())
S = [1]*(N+1)
for i in range(N):
    if K + i <= N:
        for j in range(i, K + i):
            S[i] *= A[j]
        if i > 0:
            if S[i] > S[i - 1]:
                print("Yes")
            else:
                print("No")
    else:
        exit


Fixed submission:
N, K, *A = map(int, open(0).read().split())
for i in range(N):
    unko = A[i]
    if i + K < N:
        S = A[i + K]
        if S > unko:
            print("Yes")
        else:
            print("No")
    else:
        exit
Buggy python submission (verdict: Runtime Error):
print(1000-int(input()) % 1000 if int(input()) % 1000 else 0)



Fixed submission:
N = int(input())
print(1000-N % 1000 if N % 1000 else 0)
Buggy python submission (verdict: Runtime Error):
N, *s = map(open(0).read().split())
for v in ('AC', 'WA', 'TLE', 'RE'):
    print('{} x {}'.format(v, s.count(v)))


Fixed submission:
N = int(input())
s = [input() for i in range(N)]
for v in ('AC', 'WA', 'TLE', 'RE'):
    print('{} x {}'.format(v, s.count(v)))

Buggy python submission (verdict: Runtime Error):
N, *s = map(int, open(0).read().split())
for v in ('AC', 'WA', 'TLE', 'RE'):
    print('{} x {}'.format(v, s.count(v)))


Fixed submission:
N = int(input())
s = [input() for i in range(N)]
for v in ('AC', 'WA', 'TLE', 'RE'):
    print('{} x {}'.format(v, s.count(v)))

Buggy python submission (verdict: Runtime Error):
N, *s = map(int, open(0).read().split()
for v in ('AC', 'WA', 'TLE', 'RE'):
    print('{} x {}'.format(v, s.count(v)))


Fixed submission:
N = int(input())
s = [input() for i in range(N)]
for v in ('AC', 'WA', 'TLE', 'RE'):
    print('{} x {}'.format(v, s.count(v)))
Buggy python submission (verdict: Runtime Error):
X, N = map(int, input().split())
if N > 0:
    l = list(map(int, input().split()))
    A = [0] * N
    for i in range(N):
        A[i] = abs(l[i] - X)
        S = A.count(0)
        if S == 0:
            print(X)
        else:
            for i in range(1, N):
                S = A.count(N)
                if S == 1:
                    if l.count(X - 1) == 0:
                        print(X - 1)
                        break
                    else:
                        print(X + 1)
                        break
                else:
                    pass
else:
    print(X)


Fixed submission:

l = list(map(int, input().split()))

for i in range(5):
    if l[i] == 0:
        print(i+1)
Buggy python submission (verdict: Runtime Error):
X, N = map(int, input().split())
if N > 0:
    l = list(map(int, input().split()))
    A = [0] * N
    ok == 0

    for i in range(N):
        A[i] = abs(l[i] - X)

    S = A.count(0)
    if S == 0:
        print(X)
        ok = 1

    if ok == 0:
        for i in range(1, 101):
            S = A.count(i)
            if S == 0:
                print(X - 1)
                break
            if S == 1:
                if l.count(X - i) == 0:
                    print(X - i)
                    break
                else:
                    print(X + i)
                    break
            else:
                pass

else:
    print(X)


Fixed submission:
X, N, *d = map(int, open(0).read().split())
if N == 0:
    print(X)
else:
    ans = -100
    for i in range(102):
        if i not in d and abs(i - X) < abs(ans - X):
            ans = i

    print(ans)

Buggy python submission (verdict: Runtime Error):
X, N = map(int, input().split())
if N > 0:
    l = list(map(int, input().split()))
    A = [0] * N

    for i in range(N):
        A[i] = abs(l[i] - X)

    S = A.count(0)
    if S == 0:
        print(X)
        ok = 1

    if ok != 1:
        for i in range(1, 101):
            S = A.count(i)
            if S == 0:
                print(X - 1)
                break
            if S == 1:
                if l.count(X - i) == 0:
                    print(X - i)
                    break
                else:
                    print(X + i)
                    break
            else:
                pass

else:
    print(X)


Fixed submission:
X, N, *d = map(int, open(0).read().split())
if N == 0:
    print(X)
else:
    ans = -100
    for i in range(102):
        if i not in d and abs(i - X) < abs(ans - X):
            ans = i

    print(ans)

Buggy python submission (verdict: Runtime Error):
X, N = map(int, input().split())
if N > 0:
    l = list(map(int, input().split()))
    A = [0] * N

    for i in range(N):
        A[i] = abs(l[i] - X)

    S = A.count(0)
    if S == 0:
        print(X)

    for i in range(1, N + 1):
        S = A.count(i)
        if S == 0:
            print(X-1)
        if S == 1:
            if l.count(X - i) == 0:
                print(X - i)
                break
            else:
                print(X + i)
                break
        else:
            pass

else:
    print(X)
print(A)


Fixed submission:
X, N, *d = map(int, open(0).read().split())
if N == 0:
    print(X)
else:
    ans = -100
    for i in range(102):
        if i not in d and abs(i - X) < abs(ans - X):
            ans = i

    print(ans)
Buggy python submission (verdict: Runtime Error):
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
if (abs(A-B) % abs(W-V)) == 0 and abs(A-B) >= abs((W - V) * T):
    print("YES")
else:
    print("NO")


Fixed submission:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
if V > W and abs(A - B) <= abs((W - V) * T):
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
if (abs(A-B) % abs(W-V)) = 0 and abs(A-B) >= abs((W - V) * T):
    print("YES")
else:
    print("NO")


Fixed submission:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
if V > W and abs(A - B) <= abs((W - V) * T):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
K = int(input())
S = input()
if int(len(S)) <= K:
    print(S)
else:
    print(S[0:K]+'...')


Fixed submission:
N = input()
M = str(N)
K = len(M)
if N[K-1] == '2' or N[K-1] == '4' or N[K-1] == '5' or N[K-1] == '7' or N[K-1] == '9':
    print('hon')
elif N[K-1] == '0' or N[K-1] == '1' or N[K-1] == '6' or N[K-1] == '8':
    print('pon')
else:
    print('bon')
Buggy python submission (verdict: Runtime Error):
K = int(input())
S = input()
if int(len(S)) <= K:
    print(S)
else:
    print(S[0:K]...)


Fixed submission:
K = int(input())
S = input()
if int(len(S)) <= K:
    print(S)
else:
    print(S[0:K]+'...')

Buggy python submission (verdict: Runtime Error):
K = int(input())
S = input()
if int(len(S)) <= K:
    print(S)
else:
    print(S[0:K]...)


Fixed submission:
K = int(input())
S = input()
if int(len(S)) <= K:
    print(S)
else:
    print(S[0:K]+'...')
Buggy python submission (verdict: Runtime Error):
print(int((input()))**3/27)


Fixed submission:
N, M = map(int, input().split())
print(int((N * (N - 1) + M * (M-1)) / 2))

Buggy python submission (verdict: Runtime Error):
S = input()
a = (len(S) - 1) / 2
b = (len(S) + 1) / 2
if S[:a] == S[b:]:
    print("Yes")
else:
    print("No")


Fixed submission:
N, M = map(int, input().split())
print(int((N * (N - 1) + M * (M-1)) / 2))

Buggy python submission (verdict: Runtime Error):
# %%
N = int(input())
M = int(input())
print((N * (N - 1) + M * (M-1)) / 2)


Fixed submission:
N, M = map(int, input().split())
print(int((N * (N - 1) + M * (M-1)) / 2))
Buggy python submission (verdict: Runtime Error):
S = input()
a = len(S)
if S[:(a - 1) / 2] == S[(a + 1) / 2:]:
    print("Yes")
else:
    print("No")


Fixed submission:
S = input()
n = len(S)
a = S[:int((n - 1) / 2)]
b = S[int((n + 1) / 2):]
if a == b:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
print(float((input())**3/27))


Fixed submission:
print(int(input())**3/27)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
ans = 0
tmp = [A[0]]
for i in range(1,N,1):
  #print(i)
  #print(tmp)
  ans += tmp[0]
  tmp = tmp[1:]
  tmp.append(A[i])
  tmp.append(A[i])
print(ans)

Fixed submission:
from collections import deque
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
ans = 0
d = deque([A[0]])
#tmp = [A[0]]
for i in range(1,N,1):
  #print(i)
  #print(tmp)
  ans += d.popleft()
  d.extend([A[i],A[i]])
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = [0]*(max(A) + 5)
for i in A:
  ans[i] += 1
  if ans[i] == 1:
    for j in range(i*2, max(A) + 5, i):
      ans[j] = 2
print(ans.count(1))

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
max_A = A[-1] + 1
ans = [0]*max_A
for i in A:
  ans[i] += 1
  if ans[i] == 1:
    for j in range(i*2, max_A, i):
      ans[j] = 2
print(ans.count(1))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = [0]*(max(A) + 5)
for i in range(N):
  ans[A[i]] += 1
  if ans[A[i]] == 1:
    for j in range(A[i]*2, max(A) + 5, A[i]):
      ans[j] = 2
cnt = 0
for a in A:
  if ans[a] == 1:
    cnt += 1
print(cnt)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
max_A = A[-1] + 1
ans = [0]*max_A
for i in A:
  ans[i] += 1
  if ans[i] == 1:
    for j in range(i*2, max_A, i):
      ans[j] = 2
print(ans.count(1))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = np.zeros(max(A) + 5)
for i in range(N):
  if ans[A[i]] == 0:
    for j in range(0, max(A) + 5, A[i]):
      ans[j] += 1
  else:
    ans[A[i]] += 1
cnt = 0
for a in A:
  if ans[a] == 1:
    cnt += 1
print(cnt)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
max_A = A[-1] + 1
ans = [0]*max_A
for i in A:
  ans[i] += 1
  if ans[i] == 1:
    for j in range(i*2, max_A, i):
      ans[j] = 2
print(ans.count(1))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = [0 for _ in range(max(A) + 5)]
for i in range(N):
  if ans[A[i]] == 0:
    for j in range(0, max(A) + 5, A[i]):
      ans[j] += 1
  else:
    ans[A[i]] += 1
cnt = 0
for a in A:
  if ans[a] == 1:
    cnt += 1
print(cnt)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
max_A = A[-1] + 1
ans = [0]*max_A
for i in A:
  ans[i] += 1
  if ans[i] == 1:
    for j in range(i*2, max_A, i):
      ans[j] = 2
print(ans.count(1))
Buggy python submission (verdict: Runtime Error):
S = input()
ans = 'ABC'
if S = 'ABC':
  ans = 'ARC'
print(ans)

Fixed submission:
S = input()
ans = 'ABC'
if S == 'ABC':
  ans = 'ARC'
print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
ans = 'Yes'
if S = 'AAA' or S = 'BBB':
  ans = 'No'
print(ans)

Fixed submission:
S = input()
ans = 'Yes'
if S == 'AAA' or S == 'BBB':
  ans = 'No'
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())
a = 0
b = 0
while True:
  if a + b + A >= N:
    ans = N - b 
    break
  else:
    a += A
    if a + b + B >= N:
      ans = a
      break
    else:
      b += B
print(ans)

Fixed submission:
N, A, B = map(int, input().split())
ans  = (N//(A+B))*A
if N%(A+B)<=A:
  ans += N%(A+B)
elif N%(A+B) !=0:
  ans += A
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N = int(input())
P = list(map(int, input().split()))
P.append(0)
P = np.array(P)
ans = 1
for i in range(1,N):
  tmp = P[:i+1]
  if np.argmin(tmp) == i:
    ans +=1
print(ans)

Fixed submission:
import numpy as np
N = int(input())
P = list(map(int, input().split()))
P.append(0)
P = np.array(P)
ans = 1
tmp = P[0]
for i in range(1,N):
  if P[i] < tmp:
    ans += 1
    tmp = P[i]
print(ans)