Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

MOD = 10 ** 9 + 7

H, W = map(int, input().split())
count = np.ones(W, dtype=np.int)

row = input()
for w in range(1, W):
  if row[w] == '#':
    count[w:] = 0
    break

for h in range(1, H):
  row = input()
  if row[0] == '#':
    count[0] = 0
  for w in range(1, W):
    if row[w] == '#':
      count[w] = 0
    else:
      count[w] = (count[w-1] + count[w]) % MOD
print(count[-1])

Fixed submission:
MOD = 10 ** 9 + 7

H, W = map(int, input().split())
count = [0] * W

row = input()
for w in range(W):
  if row[w] == '#':
    break
  else:
    count[w] = 1

for h in range(1, H):
  row = input()
  if row[0] == '#':
    count[0] = 0
  for w in range(1, W):
    if row[w] == '#':
      count[w] = 0
    else:
      count[w] = (count[w-1] + count[w]) % MOD
print(count[-1])

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

MOD = 10 ** 9 + 7

H, W = map(int, input().split())
count = np.ones(W, dtype=np.int)

row = input()
for w in range(1, W):
  if row[w] == '#':
    count[w:] = 0
    break

for h in range(1, H):
  row = input()
  if row[0] == '#':
    count[0] = 0
  period = 0
  for w in range(1, W):
    if row[w] == '#':
      count[period : w] = count[period : w].cumsum() % MOD
      count[w] = 0
      period = w + 1
  count[period:] = count[period:].cumsum() % MOD
print(count[-1])

Fixed submission:
MOD = 10 ** 9 + 7

H, W = map(int, input().split())
count = [0] * W

row = input()
for w in range(W):
  if row[w] == '#':
    break
  else:
    count[w] = 1

for h in range(1, H):
  row = input()
  if row[0] == '#':
    count[0] = 0
  for w in range(1, W):
    if row[w] == '#':
      count[w] = 0
    else:
      count[w] = (count[w-1] + count[w]) % MOD
print(count[-1])

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

MOD = 10 ** 9 + 7

H, W = map(int, input().split())
count = np.ones((H, W), dtype=np.int)

row = input()
for w in range(1, W):
  if row[w] == '#':
    count[0, w:] = 0
    break

flag = True
for h in range(1, H):
  row = input()
  count[h] = count[h-1]
  if flag and row[0] == '#':
    count[h:, 0] = 0
    flag = False
  period = 0
  for w in range(1, W):
    if row[w] == '#':
      count[h, period : w] = count[h, period : w].cumsum() % MOD
      count[h, w] = 0
      period = w + 1
  count[h, period:] = count[h, period:].cumsum() % MOD
print(count[-1, -1])

Fixed submission:
MOD = 10 ** 9 + 7

H, W = map(int, input().split())
count = [0] * W

row = input()
for w in range(W):
  if row[w] == '#':
    break
  else:
    count[w] = 1

for h in range(1, H):
  row = input()
  if row[0] == '#':
    count[0] = 0
  for w in range(1, W):
    if row[w] == '#':
      count[w] = 0
    else:
      count[w] = (count[w-1] + count[w]) % MOD
print(count[-1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
v = list(map(int, input().split()))

odd = [[0, i] for i in range(10001)]
even = [[0, i] for i in range(10001)]

for i in range(0, n, 2):
  odd[v[i]][0] += 1
for i in range(1, n, 2):
  even[v[i]][0] += 1

odd.sort()
even.sort()

if odd[-1][1] != even[-1][1]:
  print(n - odd[-1][0] - even[-1][0])
else:
  print(n - max(odd[-2][0] + even[-1][0], odd[-1][0] + even[-2][0]))

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

odd = [[0, i] for i in range(100001)]
even = [[0, i] for i in range(100001)]

for i in range(0, n, 2):
  odd[v[i]][0] += 1
for i in range(1, n, 2):
  even[v[i]][0] += 1

odd.sort()
even.sort()

if odd[-1][1] != even[-1][1]:
  print(n - odd[-1][0] - even[-1][0])
else:
  print(n - max(odd[-2][0] + even[-1][0], odd[-1][0] + even[-2][0]))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = 0
tmp = n
while tmp:
  s += tmp % 10
  tmp // 10
if n % s == 0:
  print('Yes')
else:
  print('No')

Fixed submission:
str_n = input()
n = int(str_n)
s = 0
for digit in str_n:
  s += int(digit)
if n % s == 0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
mod = 10**9 + 7
h, w, a, b = map(int, input().split())

fact = [1] * (h + w + 1)
invf = [1] * (h + w + 1)
invn = [1] * (h + w + 1)
for i in range(1, h + w + 1):
  fact[i] = fact[i-1] * i % mod
  invn[i] = -invn[mod % i] * (p // i) % mod
  invf[i] = invf[i-1] * invn[i] % mod

count = 0
for i in range(min(h-a, w-b)):
  count += fact[h+b-a-1] * invf[h-a-i-1] * invf[b+i] * fact[w+a-b-1] * invf[a+i] * invf[w-b-i-1]
  count %= mod
print(count)

Fixed submission:
mod = 10**9 + 7
h, w, a, b = map(int, input().split())

fact = [1] * (h + w + 1)
invf = [1] * (h + w + 1)
invn = [1] * (h + w + 1)
for i in range(2, h + w + 1):
  fact[i] = fact[i-1] * i % mod
  invn[i] = (-invn[mod % i]) * (mod // i) % mod
  invf[i] = invf[i-1] * invn[i] % mod

count = 0
for i in range(min(h-a, w-b)):
  count += fact[h+b-a-1] * invf[h-a-i-1] * invf[b+i] * fact[w+a-b-1] * invf[a+i] * invf[w-b-i-1]
  count %= mod
print(count)
Buggy python submission (verdict: Runtime Error):
x=int(input())
if x==0:
  print 1
elif x==1:
  print 0

Fixed submission:
x=int(input())
if x==1:
  print(0)
elif x==0:
  print(1)
Buggy python submission (verdict: Runtime Error):
a,b,c,d=[int(input()) for i in range(4)]
x=[a*b,a*c,b*d,b*c]
print(max(x))

Fixed submission:
a,b,c,d=list(map(int,input().split()))
x=[a*c,a*d,b*c,b*d]
print(max(x))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
sumA=0
for i in range(N-1):
    sumB=0
    for j in range(i+1,N):
        sumB=sumB+A[j]
        j=j+1
    sumB=sumB%(10**9+7)
    sumA=sumA+(A[i]*sumB)%(10**9+7)
    i=i+1
print(sumA%(10**9+7))

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
sumA=0
sumB=[0]
for i in range(N):
    sumB.append(sumB[i]+A[i])
    i=i+1
for j in range(N-1):
    sumA=sumA+(A[j]*(sumB[N]-sumB[j+1]))%(10**9+7)
    j=j+1
print(sumA%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
sumA=0
for i in range(N-1):
    for j in range(i+1,N):
        sumA=(A[i]*A[j])%(10**9+7)+sumA
print(sumA%(10**9+7))

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
sumA=0
sumB=[0]
for i in range(N):
    sumB.append(sumB[i]+A[i])
    i=i+1
for j in range(N-1):
    sumA=sumA+(A[j]*(sumB[N]-sumB[j+1]))%(10**9+7)
    j=j+1
print(sumA%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
X=0
for i in range(20000000):
    X=X+N%10
    N=N//10
    if N<1:
        break

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

Fixed submission:
N=int(input())
if N%9==0:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
X=[]
for i in range(20000000):
    X.append(N%10)
    N=N//10
    if N<1:
        break
sumX=sum(X)
if sumX%9==0:
    print('Yes')
else:
    print('No')

Fixed submission:
N=int(input())
if N%9==0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
S=input()
count=[]
s=0
for i in range(3):
    if S[i]=='R':
        if i==2 or S[i+1]=='S':
            s=s+1
            count.append(s)
            s=0
        else:
            s=s+1
print(max(count))

Fixed submission:
S=input()
count=[0]
s=0
for i in range(3):
    if S[i]=='R':
        if i==2 or S[i+1]=='S':
            s=s+1
            count.append(s)
            s=0
        else:
            s=s+1
print(max(count))
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
x=998244353
S=[]
for i in range(K):
    l,r=map(int,input().split())
    for j in range(l,r+1):
      S.append(j)
S=list(set(S))
dp=[0 for i in range(N)]
for i in range(len(S)):
    dp[S[i]]=1
for i in range(N):
    for j in range(len(S)):
        if(i-S[j]>0):
            dp[i]+=dp[i-S[j]]
            dp[i]=dp[i]%x
print(dp[-1])


Fixed submission:
N,K=map(int,input().split())
x=998244353
dp=[0 for i in range(N)]
sdp=[0 for i in range(N)]
L=[]
R=[]
dp[0]=1
sdp[0]=1
for i in range(K):
    l,r=map(int,input().split())
    L.append(l)
    R.append(r) 
for i in range(1,N):
    for j in range(K):
        dp[i]+=(sdp[max(i-L[j],-1)]-sdp[max(i-R[j]-1,-1)])
        dp[i]%=x
    sdp[i]=(sdp[i-1]+dp[i])%x
print(dp[-1]%x)

Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
x=998244353
S=[]
for i in range(K):
    l,r=map(int,input().split())
    for j in range(l,r+1):
      S.append(j)
S=list(set(S))
dp=[0 for i in range(N)]
for i in range(len(S)):
    dp[S[i]]=1
for i in range(N):
    for j in range(len(S)):
        if(i-S[j]>0):
            dp[i]+=dp[i-S[j]]
            dp[i]=dp[i]%x
print(dp[-1])

Fixed submission:
N,K=map(int,input().split())
x=998244353
dp=[0 for i in range(N)]
sdp=[0 for i in range(N)]
L=[]
R=[]
dp[0]=1
sdp[0]=1
for i in range(K):
    l,r=map(int,input().split())
    L.append(l)
    R.append(r) 
for i in range(1,N):
    for j in range(K):
        dp[i]+=(sdp[max(i-L[j],-1)]-sdp[max(i-R[j]-1,-1)])
        dp[i]%=x
    sdp[i]=(sdp[i-1]+dp[i])%x
print(dp[-1]%x)
Buggy python submission (verdict: Runtime Error):
S=int(input())
x=10**9+7
a=[0 for i in range(S+1)]
a[3]=1
a[4]=1
a[5]=1
a[6]=2
for i in range(7,S+1):
    a[i]=(a[i-1]+a[i-3])%x
print(a[S])

Fixed submission:
S=int(input())
x=10**9+7
a=[0 for i in range(2001)]
a[3]=1
a[4]=1
a[5]=1
a[6]=2
for i in range(7,S+1):
    a[i]=(a[i-1]+a[i-3])%x
print(a[S])
Buggy python submission (verdict: Runtime Error):
a,b=int(map(int,input().split()))
print(a*b)

Fixed submission:
a,b=map(int,input().split())
print(a*b)
Buggy python submission (verdict: Runtime Error):
A=list(map(int,input().split()))
A=sorted(A,reverse=True)
if(A[-1]==0):
    print(0)
else:
    ans=1
    flag=0
    for i in range(N):
        ans=ans*A[i]
        if(ans>10**18):
            flag=1
            break
    if(flag==0):
        print(ans)
    else:
        print(-1)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
A=sorted(A,reverse=True)
if(A[-1]==0):
    print(0)
else:
    ans=1
    flag=0
    for i in range(N):
        ans=ans*A[i]
        if(ans>10**18):
            flag=1
            break
    if(flag==0):
        print(ans)
    else:
        print(-1)
Buggy python submission (verdict: Runtime Error):
a,b=input().split()
a=int(a)
b=float(b)
a=a**-1
print(int(b//a))

Fixed submission:
import decimal
A,B=input().split()
A=int(A)
B=decimal.Decimal(B)
print(int(A*B))
Buggy python submission (verdict: Runtime Error):
X=int(input())
for i in range(65):
    a=i
    for j in range(65):
        b=j
        if(a**5-b**5==X):
            A=a
            B=b
        b=-j
        if(a**5-b**5==X):
            A=a
            B=b
print(A,B)


Fixed submission:
X=int(input())
for i in range(121):
    a=i
    for j in range(121):
        b=j
        if(a**5-b**5==X):
            A=a
            B=b
        b=-j
        if(a**5-b**5==X):
            A=a
            B=b
print(A,B)

Buggy python submission (verdict: Time Limit Exceeded):
X=int(input())
A=X**(1/5)
A=round(A)
a=A**5
if(a<X):
    B=-1
    while(a-B**5!=X):
        B-=2
else:
    B=0
    while(a-B**5!=X):
        B+=1
print(A,B)

Fixed submission:
X=int(input())
for i in range(121):
    a=i
    for j in range(121):
        b=j
        if(a**5-b**5==X):
            A=a
            B=b
        b=-j
        if(a**5-b**5==X):
            A=a
            B=b
print(A,B)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
last=A[N-2]
for i in range(1,last+1):
    print(A.count(i))
for i in range(last+1,N+1)
    print(0)

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

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
for i in range(1,N+1):
    print(A.count(i))

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
ans=[0]*N
for i in range(N-1):
    ans[A[i]-1]+=1
for i in range(N):
    print(ans[i])
Buggy python submission (verdict: Runtime Error):
mport math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)


N=int(input())
S=0
T=0
for i in range(1,N+1):
    for j in range(i+1,N+1):
        for k in range(j+1,N+1):
            S+=gcd(i,j,k)
for i in range(1,N+1):
    for j in range(i+1,N+1):
            T+=gcd(i,j,j)
            T+=gcd(i,j,j)
print(6*S+3*T+N*(N+1)//2)

Fixed submission:
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)


N=int(input())
S=0
T=0
for i in range(1,N+1):
    for j in range(i+1,N+1):
        for k in range(j+1,N+1):
            S+=gcd(i,j,k)
for i in range(1,N+1):
    for j in range(i+1,N+1):
            T+=gcd(i,j,j)
            T+=gcd(i,j,j)
print(6*S+3*T+N*(N+1)//2)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)


N=int(input())
S=0
for i in range(1,N+1):
    for j in range(1,N+1):
        for k in range(1,N+1):
            S+=gcd(i,j,k)
print(S)

Fixed submission:
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)


N=int(input())
S=0
T=0
for i in range(1,N+1):
    for j in range(i+1,N+1):
        for k in range(j+1,N+1):
            S+=gcd(i,j,k)
for i in range(1,N+1):
    for j in range(i+1,N+1):
            T+=gcd(i,j,j)
            T+=gcd(i,j,j)
print(6*S+3*T+N*(N+1)//2)
Buggy python submission (verdict: Runtime Error):
import collections
N=int(input())
S=input()
lis=list(S)
C= collections.Counter(lis)
count=list(C.values())
c=0
for i in range(N):
    for j in range(i,(N+i-1) // 2+1):
        if(lis[i]!=lis[j]):
            if(lis[j]!=lis[2*j-i]):
                if(lis[i]!=lis[2*j-i]):
                    c+=1
print(count[0]*count[1]*count[2]-c)


Fixed submission:
import collections
N=int(input())
S=input()
lis=list(S)
C= collections.Counter(lis)
count=list(C.values())
c=0
for i in range(N):
    for j in range(i,(N+i-1) // 2+1):
        if(lis[i]!=lis[j]):
            if(lis[j]!=lis[2*j-i]):
                if(lis[i]!=lis[2*j-i]):
                    c+=1
if(len(count)==3):
    print(count[0]*count[1]*count[2]-c)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
import collections
N=int(input())
S=input()
lis=list(S)
C= collections.Counter(lis)
count=list(C.values())
c=0
for i in range(N):
    print(i)
    for j in range(i,(N+i-1) // 2+1):
        if(lis[i]!=lis[j]):
            if(lis[j]!=lis[2*j-i]):
                if(lis[i]!=lis[2*j-i]):
                    c+=1
print(count[0]*count[1]*count[2]-c)


Fixed submission:
import collections
N=int(input())
S=input()
lis=list(S)
C= collections.Counter(lis)
count=list(C.values())
c=0
for i in range(N):
    for j in range(i,(N+i-1) // 2+1):
        if(lis[i]!=lis[j]):
            if(lis[j]!=lis[2*j-i]):
                if(lis[i]!=lis[2*j-i]):
                    c+=1
if(len(count)==3):
    print(count[0]*count[1]*count[2]-c)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=list(map(int,input().split()))
new_A= sorted(A,reverse=True)
if(new_A[M-1]>=sum(A)/(4*M):
    print("Yes")
else:
    print("No")

Fixed submission:
N,M=map(int,input().split())
A=list(map(int,input().split()))
new_A= sorted(A,reverse=True)
if(new_A[M-1]>=sum(A)/(4*M)):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N=int(input())
a = list(map(int,input().split()))
c=0
i=0
print(a)
while(c==0 and i<N):
    if(a[i]%2==0):
        if(a[i]%3==0 or a[i]%5==0):
            i+=1
        else:
            c+=1
    else:
        i+=1
if(c==0):
    print("APPROVED")
else:
    print("DENINED")


Fixed submission:
A,B,C=input().split()
if(A==B):
    if(A!=C):
        print("Yes")
    else:
        print("No")
else:
    if(B==C):
        print("Yes")
    else:
        if(A==C):
            print("Yes")
        else:
            print("No")

Buggy python submission (verdict: Runtime Error):
A,B,C=input().split()
if(A==B):
    if(A!=C):
        print("Yes")
    else:
        print("No")
else:
    if(B==C):
        print("Yes")
    else if(A==C):
        print("Yes")
        else:
            print("No")


Fixed submission:
A,B,C=input().split()
if(A==B):
    if(A!=C):
        print("Yes")
    else:
        print("No")
else:
    if(B==C):
        print("Yes")
    else:
        if(A==C):
            print("Yes")
        else:
            print("No")
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
for i in range(3)
	if((i+1==a or i+1==b)=False):
    	print(i+1)

Fixed submission:
a=int(input())
b=int(input())
for i in range(3):
    if((i+1==a or i+1==b)==False):
        print(i+1)
Buggy python submission (verdict: Runtime Error):
x=int(input())
if x>=30 : 
  print('Yes')   
else : 
  pt('No')

Fixed submission:
x=int(input())
if x>=30:
  print('Yes')   
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
x=int(input())
if x>=30 : 
  put('Yes')
else :
  put('No')

Fixed submission:
x=int(input())
if x>=30:
  print('Yes')   
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
x=int(input())
if x>=30 :  
  put('Yes')   
else :    
  put('No')

Fixed submission:
x=int(input())
if x>=30:
  print('Yes')   
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
x=input()
if x>=30 :
  put('Yes') 
else :  
  put('No')

Fixed submission:
x=int(input())
if x>=30:
  print('Yes')   
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
x=input()
if x>=30 :
　　put('Yes')
  else :
    put('No')

Fixed submission:
x=int(input())
if x>=30:
  print('Yes')   
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int, input().split())

import numpy as np
l = np.array(list(map(int, input().split())))

for _ in range(M):
	max_ind = np.argmax(l)
	l[max_ind] = l[max_ind]//2

print(np.sum(l))

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

import numpy as np
l = list(map(int, input().split()))
l = list(map(lambda x: -1 * x, l))

import heapq

heapq.heapify(l)

for _ in range(M):
	max_value = -1 * heapq.heappop(l)
	heapq.heappush(l, (max_value // 2) * (-1))

print(-1 * sum(l))
Buggy python submission (verdict: Runtime Error):
text = list(input())

def swap(char, a, b):
    if char == a:
        return(b)
    if char == b:
        return(a)

res = list(map(lambda x: swap(x, "1", "9"), text))
print("".join(res))
~                     

Fixed submission:
text = list(input())

def swap(char, a, b):
    if char == a:
        return(b)
    if char == b:
        return(a)

res = list(map(lambda x: swap(x, "1", "9"), text))
print("".join(res))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split)
print(a + 1 - b)

Fixed submission:
a, b = map(int, input().split())
print(a + 1 - b)
Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split()))

import pandas as pd

print(int(pd.Series(A).sort_values().diff().sum()))

Fixed submission:
import numpy as np
A = list(map(int, input().split()))

A = np.array(A)
A.sort()

print(np.diff(A).sum())
Buggy python submission (verdict: Runtime Error):
A,B = map(int, input().split());

print(A*A-B)

Fixed submission:
A = int(input())
B = int(input())


print(A*A-B)

Buggy python submission (verdict: Runtime Error):
A,B = map(input(), int);

print(A*A-B)

Fixed submission:
A = int(input())
B = int(input())


print(A*A-B)
Buggy python submission (verdict: Runtime Error):
K,S = map(int, input().split())

if K == S:
	print( (K+5)*(K+4)//2 )
	sys.exit( ) 

ans = 0
for X in range(K+1):
	S1 = S - X
	if S1 < 0:
		break
	else:
		if S1 <= K:
			ans += S1 + 1
		elif S1 <= 2 * K:
			ans += S1 - 2*K + 1
		else:
			continue

print(ans)
		

Fixed submission:
K,S = map(int, input().split())
 
ans = 0
 
for X in range(K+1):
	S1 = S - X
	if S1 < 0:
		break
	else:
		if S1 <= K:
			ans += S1 + 1
		elif S1 <= 2 * K:
			ans += 2*K - S1 + 1
 
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
data = list(map(int, input().split()))

for i in range(n-k):
    if data[i:i+k][0] < data[i+1:i+k+1][-1]:
        print("Yes")
        # print( data[i:i+k] )
        # print( data[i+1:i+k+1] )
    else:
        print("No")


Fixed submission:
n, k = map(int, input().split())
data = list(map(int, input().split()))

for i in range(n-k):
    # if data[i:i+k][0] < data[i+1:i+k+1][-1]:
    # print("-----------------")
    # print( data[i:i+k] )
    # print( data[i+1:i+k+1] )

    # print( data[i] )
    # print( data[k+i] )
    # print("-----------------")

    if data[i] < data[k+i]:
        print("Yes")
        # print( data[i:i+k] )
        # print( data[i+1:i+k+1] )
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
data = list(map(int, input().split()))
rui = [1]
for i in range(n):
    rui.append( rui[-1] * data[i] )

for i in range(n-k):
    if data[i:i+k][0] < data[i+1:i+k+1][-1]:
        print("Yes")
        # print( data[i:i+k] )
        # print( data[i+1:i+k+1] )
    else:
        print("No")


Fixed submission:
n, k = map(int, input().split())
data = list(map(int, input().split()))

for i in range(n-k):
    # if data[i:i+k][0] < data[i+1:i+k+1][-1]:
    # print("-----------------")
    # print( data[i:i+k] )
    # print( data[i+1:i+k+1] )

    # print( data[i] )
    # print( data[k+i] )
    # print("-----------------")

    if data[i] < data[k+i]:
        print("Yes")
        # print( data[i:i+k] )
        # print( data[i+1:i+k+1] )
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
n = input()
n = int(n[1:])
if 1000 - n == 1000:
    print(0)
else:
    print(1000 - n)


Fixed submission:
n = int(input())
n = n % 1000
if 1000 - n == 1000:
    print(0)
else:
    print(1000 - n)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
data = list(map(int, input().split()))

ans_list = []
for i in range(n):
    f = True
    for j in range(n):
        if i == j:
            continue

        if data[i] % data[j] == 0:
            f = False
            break

    if f:
        ans_list.append(data[i])

print(len(ans_list))


Fixed submission:
from collections import Counter

n = int(input())
data = list(map(int, input().split()))

max_ = 10 ** 6 + 1
b = [True] * (max_ + 1)
data.sort()
c = Counter(data)

ans = 0
for d in data:
    if b[d]:
        for j in range(d, max_, d):
            b[j] = False
        # 複数存在
        if c[d] > 1:
            continue
        else:
            ans += 1

print(ans)