Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def E(x):
    ans = (x+1)/2
    return ans

n, k =  map(int,input().split())

p = list(map(int,input().split()))
counter_li = []
for i in range(len(p)-k+1):
    temp = 0
    for j in range(k):
        temp+=p[i+j]
    counter_li.append(temp)

print(max(counter_li)/2+k/2)


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

p = list(map(int,input().split()))
counter_li = []
first = 0
for i in range(k):
    first+=p[i]
counter_li.append(first)
for i in range(1,len(p)-k+1):
    counter_li.append(counter_li[i-1]+ p[i+k-1] - p[i-1])
print(max(counter_li)/2+k/2)

Buggy python submission (verdict: Time Limit Exceeded):
def E(x):
    ans = (x+1)*x/2
    ans /= x
    return ans

n, k =  map(int,input().split())

p = list(map(int,input().split()))
E_lis = [E(i) for i in p]
res = []

for i in range(len(p)-k+1):
    temp = 0
    for j in range(k):
        temp += E_lis[i+j]
    res.append(temp)
print(max(res))


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

p = list(map(int,input().split()))
counter_li = []
first = 0
for i in range(k):
    first+=p[i]
counter_li.append(first)
for i in range(1,len(p)-k+1):
    counter_li.append(counter_li[i-1]+ p[i+k-1] - p[i-1])
print(max(counter_li)/2+k/2)

Buggy python submission (verdict: Time Limit Exceeded):

def E(x):
    ans = 0
    for i in range(x):
        ans += (i+1)
    ans /= x
    return ans

n, k =  map(int,input().split())

p = list(map(int,input().split()))
E_lis = [E(i) for i in p]
res = []

for i in range(len(p)-k+1):
    temp = 0
    for j in range(k):
        temp += E_lis[i+j]
    res.append(temp)
print(max(res))


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

p = list(map(int,input().split()))
counter_li = []
first = 0
for i in range(k):
    first+=p[i]
counter_li.append(first)
for i in range(1,len(p)-k+1):
    counter_li.append(counter_li[i-1]+ p[i+k-1] - p[i-1])
print(max(counter_li)/2+k/2)

Buggy python submission (verdict: Time Limit Exceeded):

def E(x):
    ans = 0
    for i in range(x):
        ans += (i+1)
    ans /= x
    return ans

n, k =  map(int,input().split())

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

res = []

for i in range(len(p)-k+1):
    temp = 0
    for j in range(k):
        temp +=E(p[i+j])
    res.append(temp)
print(max(res))


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

p = list(map(int,input().split()))
counter_li = []
first = 0
for i in range(k):
    first+=p[i]
counter_li.append(first)
for i in range(1,len(p)-k+1):
    counter_li.append(counter_li[i-1]+ p[i+k-1] - p[i-1])
print(max(counter_li)/2+k/2)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int, input().split()))

h = sorted(h)
sum_of_k = 0
for i in range(k):
    sum_of_k += h[len(h)-i-1]
ans = sum(h)-sum_of_k
print(ans if ans >=0 else 0)


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

h = sorted(h)
sum_of_k = 0
if k >= n:
    print(0)
    exit()
for i in range(k):
    sum_of_k += h[len(h)-i-1]
ans = sum(h)-sum_of_k
print(ans if ans >=0 else 0)
Buggy python submission (verdict: Runtime Error):
def gcd(a,b):
    a,b = max(a,b),min(a,b)
    if a % b == 0:
        return b
    else:
        gcd(b,a%b)

a,b = map(int, input().split())

print(int(a*b/math.gcd(a,b)))


Fixed submission:
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

#a,bの最小公倍数
def lcm(a, b):
    return a * b // gcd (a, b)

a,b = map(int, input().split())

print(lcm(a,b))

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

a,b = map(int, input().split())

print(int(a*b/math.gcd(a,b)))


Fixed submission:
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

#a,bの最小公倍数
def lcm(a, b):
    return a * b // gcd (a, b)

a,b = map(int, input().split())

print(lcm(a,b))
Buggy python submission (verdict: Runtime Error):
list = [100,101,102,103,104,105]

def search(list, target):
    for i in list:
        target = target - i
        if target == 0:
            return True
        elif target <= 0:
            return
        else:
            search(list,target)

s = search(list,int(input()))

if s:
    print(1)
else:
    print(0)


Fixed submission:
list = [100,101,102,103,104,105]
# a = [list[i] * 2000 for i in range(len(list))]

N = int(input())

dp = [0 for i in range(N+1)]
dp[0] = 1

for i in range(N):
    if dp[i] == 1:
        for j in range(len(list)):
            if i + list[j] <= len(dp)-1:
                
                dp[i+list[j]]=1


print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
anslist = []
_ = input()
S = input()
l = [i for i in S]
for c  in itertools.combinations(l, 3):
    
    anslist.append(c)

print(len(set(anslist)))


Fixed submission:
_ = input()
S = input()
counter = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            idxi = S.find(str(i))
            if idxi ==-1:
                continue
            idxj = S.find(str(j),idxi+1)
            if idxj == -1:
                continue
            idxk = S.find(str(k),idxj+1)
            if idxk == -1:
                continue
            counter+=1
print(counter)

Buggy python submission (verdict: Time Limit Exceeded):
import copy

N = int(input())
S = input()
list = [i for i in S]
anslist = []
for i in range(len(S)):
    s_i = list[i]
    for j in range(i+1,len(S)):
        s_j = list[j]
        for k in range(j+1,len(S)):
            s = s_i + s_j + S[k]
            anslist.append(s)


print(len(set(anslist)))


Fixed submission:
_ = input()
S = input()
counter = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            idxi = S.find(str(i))
            if idxi ==-1:
                continue
            idxj = S.find(str(j),idxi+1)
            if idxj == -1:
                continue
            idxk = S.find(str(k),idxj+1)
            if idxk == -1:
                continue
            counter+=1
print(counter)
Buggy python submission (verdict: Runtime Error):
x,y = map(int, input().split())
 
if (x + y) % 3  != 0:
  print(0)
  exit()
  
k = x - (x+y)//3
m = y - (x+y)//3
 
if k < 0 or m < 0:
  print(0)
  exit()
  
def nCr(k,m):
  mod = 10**9 + 7
  k,m = max(k,m),min(k,m)
  l = s = 0
  for i in range(m,k - m + 1):
    l = l * (m + i) % mod
    s = s * (i + 1) % mod
    
print(l/s)

Fixed submission:
import math
M = 10**9+7
X,Y = map(int,input().split())
if (X+Y)/3 != (X+Y)//3:
    print(0)
    exit()
n = (X+Y)//3
r = Y-n
if r<0 or r>n:
    print(0)
    exit()
 
 
#nCr and Mod
def nCr(n, r, mod=10**9+7):
    r = min(r, n-r)
    numer = denom = 1
    for i in range(1, r+1):
        numer = numer * (n+1-i) % mod
        denom = denom * i % mod
    return numer * pow(denom, mod-2, mod) % mod
 
print(nCr(n,r,M))

Buggy python submission (verdict: Runtime Error):
x,y = map(int, input().split())
 
if (x + y) % 3  == 0:
  print(0)
  exit()
  
k = x - (x+y)//3
m = y - (x+y)//3
 
if k < 0 or m < 0:
  print(0)
  exit()
  
def nCr(k,m):
  mod = 10**9 + 7
  k,m = max(k,m),min(k,m)
  l = s = 0
  for i in range(m,k - m + 1):
    l = l * (m + i) % mod
    s = s * (i + 1) % mod
    
print(l/s)

Fixed submission:
import math
M = 10**9+7
X,Y = map(int,input().split())
if (X+Y)/3 != (X+Y)//3:
    print(0)
    exit()
n = (X+Y)//3
r = Y-n
if r<0 or r>n:
    print(0)
    exit()
 
 
#nCr and Mod
def nCr(n, r, mod=10**9+7):
    r = min(r, n-r)
    numer = denom = 1
    for i in range(1, r+1):
        numer = numer * (n+1-i) % mod
        denom = denom * i % mod
    return numer * pow(denom, mod-2, mod) % mod
 
print(nCr(n,r,M))

Buggy python submission (verdict: Runtime Error):
x,y = map(int, input().split())

if (x + y) % 3  == 0:
  print(0)
  exit()
  
k = x - (x+y)//3
m = y - (x+y)//3

if k < 0 or m < 0:
  print(0)
  exit()
  
def nCr(k,m):
  mod = 10**9 + 7
  k,m = max(k,m),min(k,m)
  l = s = 0
  for i in range(m,k + 1):
    l = l * (m + i) % mod
    s = s * (i + 1) % mod
    
print(l/s)

Fixed submission:
import math
M = 10**9+7
X,Y = map(int,input().split())
if (X+Y)/3 != (X+Y)//3:
    print(0)
    exit()
n = (X+Y)//3
r = Y-n
if r<0 or r>n:
    print(0)
    exit()
 
 
#nCr and Mod
def nCr(n, r, mod=10**9+7):
    r = min(r, n-r)
    numer = denom = 1
    for i in range(1, r+1):
        numer = numer * (n+1-i) % mod
        denom = denom * i % mod
    return numer * pow(denom, mod-2, mod) % mod
 
print(nCr(n,r,M))
Buggy python submission (verdict: Runtime Error):
def selectionsort(a,n):
  counter = 0
  for i in range(n-1):
    idx = None
    mi = a[i]
    flag = False
    for x in reversed(range(i,n)):
      if mi > a[x]:
        idx = x
        mi = a[x]
        counter+=1
        flag = True
    if flag:
      a[i],a[idx] = a[idx],a[i]
    if counter > n - 2:
      return a, True
  return a, counter
 
len = int(input())
a = sorted([int(i) for i in input().split(" ")])
b = [int(i) for i in input().split(" ")]
b, counter = selectionsort(b,len)

Flag = True

if counter:
  print("No")


else:
  for i in range(len):
    if a[i] > b[i]:
      print("No")
      Flag = False
      break
      

  if Flag:
    print("Yes")

Fixed submission:
i = int(input())

print((i-1)//2)
Buggy python submission (verdict: Runtime Error):
a = int(input())

for i in range(int(a**0.5),0,-1):
    if a % i == 0:
        print(int(a/i + i -2))
        break


Fixed submission:
a = list(map(int, input().split()))
if 1<=a[0] and a[0]<=9:
    if 1<=a[1] and a[1]<=9:
        print(a[0]*a[1])
    else:
        print(-1)
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
a = int(input())

for i in range(int(i**0.5),0,-1):
    if a % i == 0:
        print(int(a/i + i -2))
        break


Fixed submission:
a = list(map(int, input().split()))
if 1<=a[0] and a[0]<=9:
    if 1<=a[1] and a[1]<=9:
        print(a[0]*a[1])
    else:
        print(-1)
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
a = int(input())

for i in range(int(i**0.5),0,-1):
    if a % i == 0:
        print(a/i + i -2)
        break


Fixed submission:
a = list(map(int, input().split()))
if 1<=a[0] and a[0]<=9:
    if 1<=a[1] and a[1]<=9:
        print(a[0]*a[1])
    else:
        print(-1)
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
def prime_factorize(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

a = int(input())

b = prime_factorize(a)

c = 10**10
d = 10**10
for i in range(len(b)):
    if i % 2 == 0:
        c *= b[i]
    else:
        d *= b[i]

print(c + d - 2)


Fixed submission:
a = list(map(int, input().split()))
if 1<=a[0] and a[0]<=9:
    if 1<=a[1] and a[1]<=9:
        print(a[0]*a[1])
    else:
        print(-1)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0:
        cnt+=1
        temp //= i
        arr.append([i, cnt])

  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])

  return arr

i = int(input())
a = factorization(i)
for i in range(len(a)-1):
  if a[i][0] == a[i + 1][0]:
    a.remove(a[i])
flag = False
for i in a:
  
  if i[1] == 1:
    
    flag = True
  else:
    flag = False

if flag:
  b = [0 if i % 2 == 0 else 1 for i in range(len(a))]
else:
  b = [i[1]//2 for i in a]

c = [a[i][1]-b[i] for i in range(len(b))]

d = [a[i][0]**b[i] for i in range(len(a))]


f = 1
for i in range(len(c)):
  f *= a[i][0]**c[i]

g = 1
for i in range(len(c)):
  g *= d[i]

print(f + g - 2)

Fixed submission:
a = int(input())

for i in range(int(a**0.5),0,-1):
    if a % i == 0:
        print(int(a/i + i -2))
        break
Buggy python submission (verdict: Time Limit Exceeded):
n,k,q = map(int,input().split())
point = [k for i in range(n)]

for _ in range(q):
  ans = int(input())
  for i in range(n):
    if ans - 1 != i:
      point[i]-=1

for i in range(n):
  if point[i] > 0:
    print("Yes")
  else:
    print("No")

Fixed submission:
n,k,q = map(int,input().split())
point = [0 for i in range(n)]

for _ in range(q):
  ans = int(input())
  point[ans-1] += 1
  
for i in range(n):
  if k + point[i] - q > 0:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a = input().split(" ")
s = [input() for i in range(a)]
print("".join(sorted(s))

Fixed submission:
a = input().split(" ")
s = [input() for i in range(int(a[0]))]
print("".join(sorted(s)))
Buggy python submission (verdict: Time Limit Exceeded):
n,k=(input().split())
a=list(map(int,input().split()))
pdt=a
p=1
for i in range(int(n)):
  p*=a[i]
  pdt[i]=p
j=0  
for i in range(int(k),int(n)):
  a[i]=pdt[i]/a[j]
  #print(a[i],a[j],a[i-1])
  j+=1
  if(a[i]>a[i-1]):
    print("Yes")
  else:
    print("No")  



Fixed submission:
n,k=(input().split())
a=list(map(int,input().split()))
#pdt=a
#p=1
j=0  
for i in range(int(k),int(n)):
  if(a[i]>a[j]):
    print("Yes")
  else:
    print("No")  
  j+=1
Buggy python submission (verdict: Time Limit Exceeded):
import math
import time
from collections import defaultdict,deque
from sys import stdin,stdout
from bisect import bisect_left,bisect_right
n=int(input())
s=time.time()
factors=[]
for _ in range(max(n+2,3300)):
    factors.append([])
for i in range(2,3300):
    if(len(factors[i])==0):
        for j in range(i,n+2,i):
            factors[j].append(i)
ans=1
# print(factors)
for i in range(2,n+1):
    tt=1
    tn=i
    for j in factors[i]:
        temp=0
        while(tn%j==0):
            temp+=1
            tn=tn//j
        tt*=(temp+1)
    if(tn!=1):
        tt*=2
    ans+=i*tt
print(ans)





Fixed submission:
import math
import time
from collections import defaultdict,deque
from sys import stdin,stdout
from bisect import bisect_left,bisect_right
def find(a):
    return (a*(a+1))//2
n=int(input())
ans=0
for i in range(1,n+1):
    ans+=i*find(n//i)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
import time
from collections import defaultdict,deque
from sys import stdin,stdout
from bisect import bisect_left,bisect_right
n=int(input())
s=time.time()
factors=defaultdict(lambda:[])
for i in range(2,3300):
    if(i not in factors):
        for j in range(i,10000001,i):
            factors[j].append(i)
ans=1
# print(factors)
# print(time.time()-s)
for i in range(2,n+1):
    tt=1
    tn=i
    for j in factors[i]:
        temp=0
        while(tn%j==0):
            temp+=1
            tn=tn//j
        tt*=(temp+1)
    if(tn!=1):
        tt*=2
    ans+=i*tt
print(ans)
# print(time.time()-s)





Fixed submission:
import math
import time
from collections import defaultdict,deque
from sys import stdin,stdout
from bisect import bisect_left,bisect_right
def find(a):
    return (a*(a+1))//2
n=int(input())
ans=0
for i in range(1,n+1):
    ans+=i*find(n//i)
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
import time
from collections import defaultdict,deque
from sys import stdin,stdout
from bisect import bisect_left,bisect_right
n,k=map(int,stdin.readline().split())
ans=n
done=defaultdict(lambda:False)
for _ in range(k):
    d=int(input())
    a=list(map(int,stdin.readline().split()))
    for i in d:
        if(i not in done):
            ans-=1
            done[i]=True
print(ans)


Fixed submission:
import math
import time
from collections import defaultdict,deque
from sys import stdin,stdout
from bisect import bisect_left,bisect_right
n,k=map(int,stdin.readline().split())
ans=n
done=defaultdict(lambda:False)
for _ in range(k):
    d=int(input())
    a=list(map(int,stdin.readline().split()))
    for i in a:
        if(i not in done):
            ans-=1
            done[i]=True
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
n = int(input())
ans = 0
c = defaultdict(lambda: 0)
for _ in n:
    s = input()
    if(s in c):
        ans += 1
        c[s] += 1
print(ans)


Fixed submission:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
s,w=map(int,stdin.readline().split())
if(w>=s):
    print("unsafe")
else:
    print("safe")
Buggy python submission (verdict: Runtime Error):
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
n = int(input())
ans = 0
c = defaultdict(lambda: 0)
for _ in n:
    s = input()
    if(s in c):
        ans += 1
        c[s] += 1
print(ans)


Fixed submission:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
n = int(input())
ans = 0
c = defaultdict(lambda: 0)
for _ in range(n):
    s = input()
    if(s not in c):
        ans += 1
        c[s] += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
import time
from collections import defaultdict,deque
from sys import stdin,stdout
from bisect import bisect_left,bisect_right
n=int(input())
ans=0
c=defaultdict(lambda:0)
for _ in n:
    s=int(input())
    if(s in c):
        ans+=1
        c[s]+=1
print(ans)

Fixed submission:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
n = int(input())
ans = 0
c = defaultdict(lambda: 0)
for _ in range(n):
    s = input()
    if(s not in c):
        ans += 1
        c[s] += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
n=int(input())
s=input()
t=input()
ans=""
for i in range(n):
    ans+=s[i]
    ans+=t[i]
print(ans)

Fixed submission:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
n=int(input())
s,t=input().split()
ans=""
for i in range(n):
    ans+=s[i]
    ans+=t[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
s=input()
poss=True
for i in range(len(s)):
    if(i%2==0):
        if(s[i]!='R'or):
            poss=False
            break
    else:
        if(s[i]=='R'):
            poss=False
            break
if(poss):
    print("Yes")
else:
    print("No")

Fixed submission:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
s=input()
poss=True
for i in range(len(s)):
    if(i%2==0):
        if(s[i]=='L'):
            poss=False
            break
    else:
        if(s[i]=='R'):
            poss=False
            break
if(poss):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
a=input()
A=math.inf
Z=0
for i in range(len(a)):
    if(a[i]=='A'):
        A=min(A,i)
    elif(a[i]=='Z'):
        Z=i 
ans=Z-A+1
if(ans==-math.inf):
    print(0)
else:
    print(ans)

Fixed submission:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
a=input()
A=0
Z=0
Adone=False
for i in range(len(a)):
    if(a[i]=='A' and not Adone):
        A=i 
        Adone=True
    elif(a[i]=='Z'):
        Z=i 
ans=Z-A+1
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
a=input()
A=math.inf
Z=0
for i in range(len(a)):
    if(a[i]=='A'):
        A=min(A,i)
    elif(a[i]=='Z'):
        Z=i 
print(Z-A+1)

Fixed submission:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
a=input()
A=0
Z=0
Adone=False
for i in range(len(a)):
    if(a[i]=='A' and not Adone):
        A=i 
        Adone=True
    elif(a[i]=='Z'):
        Z=i 
ans=Z-A+1
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
a=input()
A=math.inf
Z=0
for i in range(len(a)):
    if(a[i]=='A'):
        A=min(A,i)
    elif(a[i]=='Z'):
        Z=i 
print(Z-A+1)

Fixed submission:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
a=input()
A=0
Z=0
Adone=False
for i in range(len(a)):
    if(a[i]=='A' and not Adone):
        A=i 
        Adone=True
    elif(a[i]=='Z'):
        Z=i 
ans=Z-A+1
print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()
a=list(input.split(","))
print(*a)

Fixed submission:

s=input()
a=list(s.split(","))
print(*a)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007

def calcSum(n, A):
    return n

def main():
    N, K = map(int, readline().split())
    A = list(map(int, readline().split()))

    l = [0] * (N + 1)
    for i in range(K, N + 1):
        pi = 1
        if (K == i):
            for j in range(i - K + 1, i + 1):
                pi *= A[j - 1]
        else:
            # print("A[i - K]=")
            # print(A[i - K])
            # print("A[i - 1]=")
            # print(A[i - 1])
            pi = l[i - 1] * A[i - 1] / A[i - K - 1] 
            # pi = l[i - 1] / A[j - K]
        l[i] = pi

        if (i != K):
            # print(l[i - 1])
            # print(l[i])
            if (l[i - 1] < l[i]):
                print("Yes")
            else:
                print("No")
    return


if __name__ == '__main__':
    main()


Fixed submission:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007

def calcSum(n, A):
    return n

def main():
    N, K = map(int, readline().split())
    A = list(map(int, readline().split()))

    for i in range(K + 1, N + 1): # K + 1 から N までのループ
        if (A[i - K - 1] < A[i - 1]):
            print("Yes")
        else:
            print("No")
    return

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007

def calcSum(n, A):
    return n

def main():
    N, K = map(int, readline().split())
    A = list(map(int, readline().split()))

    l = [0] * (N + 1)
    for i in range(K, N + 1):
        pi = 1
        for j in range(i - K + 1, i + 1):
           pi *= A[j - 1]
        l[i] = pi
        if (i != K):
            if (l[i - 1] < l[i]):
                print("Yes")
            else:
                print("No")
    return


if __name__ == '__main__':
    main()


Fixed submission:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007

def calcSum(n, A):
    return n

def main():
    N, K = map(int, readline().split())
    A = list(map(int, readline().split()))

    for i in range(K + 1, N + 1): # K + 1 から N までのループ
        if (A[i - K - 1] < A[i - 1]):
            print("Yes")
        else:
            print("No")
    return

if __name__ == '__main__':
    main()