Problem:


Score: 300 points

Problem Statement

M-kun is a student in Aoki High School, where a year is divided into N terms.

There is an exam at the end of each term. According to the scores in those exams, a student is given a grade for each term, as follows:

For the first through (K-1)-th terms: not given.

For each of the K-th through N-th terms: the multiplication of the scores in the last K exams, including the exam in the graded term.

M-kun scored A_i in the exam at the end of the i-th term.

For each i such that K+1 \leq i \leq N, determine whether his grade for the i-th term is strictly greater than the grade for the (i-1)-th term.

Constraints

2 \leq N \leq 200000

1 \leq K \leq N-1

1 \leq A_i \leq 10^{9}

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N K
A_1 A_2 A_3 \ldots A_N

Output

Print the answer in N-K lines.

The i-th line should contain Yes if the grade for the (K+i)-th term is greater than the grade for the (K+i-1)-th term, and No otherwise.

Sample Input 1

5 3
96 98 95 100 20

Sample Output 1

Yes
No

His grade for each term is computed as follows:

3-rd term: (96 \times 98 \times 95) = 893760

4-th term: (98 \times 95 \times 100) = 931000

5-th term: (95 \times 100 \times 20) = 190000

Sample Input 2

3 2
1001 869120 1001

Sample Output 2

No

Note that the output should be No if the grade for the 3-rd term is equal to the grade for the 2-nd term.

Sample Input 3

15 7
3 1 4 1 5 9 2 6 5 3 5 8 9 7 9

Sample Output 3

Yes
Yes
No
Yes
Yes
No
Yes
Yes



Sample input:
5 3
96 98 95 100 20


Sample output:
Yes
No

Submission status: Time Limit Exceeded

Solution code:
n, k= map(int, input().split())
a = list(map(int, input().split()))

scores = []

for i in range(k, n+1):
    score = 1
    for j in range(i-1, i-k-1, -1):
        score *= a[j]
    scores.append(score)
    if len(scores) > 1:
        if scores[-1] > scores[-2]:
            print('Yes')
        else:
            print('No')

Submission status: Time Limit Exceeded

Solution code:
n,k = map(int, input().split())
a = list(map(int, input().split()))
b = []
prod = 1
l = 0
for i,j in enumerate(a):
  if i>=k-1:
    prod *= j
    b.append(prod)
    prod //= a[l]
    l += 1
  else:
    prod *= j

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

Submission status: Time Limit Exceeded

Solution code:
def main():
	n,k = map(int,input().split())
	h = tuple(map(int,input().split()))
	
	dp = h[0]
	d = True
	i = 0
	while d:
		i += 1
		if i+1 <= k:			
			dp *= h[i]
		else:
			break
	i -= 1
	printcounter = 0
	while d:
		i += 1
		if n-k < printcounter or i >= len(h):
			break
		if dp < (dp/h[i-k])*h[i]:
			dp = (dp/h[i-k])*h[i]
			print("Yes")
			printcounter += 1
		else:
			dp = (dp/h[i-k])*h[i]
			print("No")
			printcounter += 1


if __name__ == '__main__':
	main()

Submission status: Time Limit Exceeded

Solution code:
from functools import reduce

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

mul = int(reduce(lambda x, y: x * y, A[:K]))

res = [mul]

for i in range(K, N):
    res.append(res[-1]*A[i]//A[i-K])
    print('Yes' if res[-2] < res[-1] else 'No')

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
readline = stdin.readline

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

prev = 0
point = 1
ans = []
for i in range(N):
    if i < K:
        point *= A[i]
    else:
        prev = point
        point *= A[i]
        point /= A[i-K]
        if prev < point:
            ans.append("Yes")
        else:
            ans.append("No")
print(*ans, sep='\n')

Submission status: Time Limit Exceeded

Solution code:
#c
n,k = map(int,input().split())
a = list(map(int,input().split()))
mul1 = 1
cnt = 0
for i in range(n-k+1):
    mul2 = 1
    for j in range(i,i+k):
        mul2 *= a[j]
    if cnt !=0:
        if mul2 >mul1:
            print("Yes")
        else:
            print("No")
    mul1 = mul2
    cnt+=1

Submission status: Time Limit Exceeded

Solution code:
num = list (map (int, input().strip().split()))
n = num[0]
k = num[1]
v = list (map (int, input().strip().split()))
sum = 1
for i in range(k):
    sum *= v[i]
for i in range(k, n):
    nsum = sum / v[i - k]
    nsum *= v[i]
    if(sum < nsum):
        print("Yes")
    else:
        print("No")
    sum /= v[i - k]
    sum *= v[i]

Submission status: Time Limit Exceeded

Solution code:
N, K = input().split()
N = int(N)
K = int(K)
scores = [int(s) for s in input().split()]
sums = []
for i in range (K-1, N):
    c = 1
    j = i
    while (j>i-K):
        c *= scores[j]
        j -= 1
    sums.append(c)

for i in range(N-K):
    if sums[i] < sums[i+1]:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))
dp = [1]
for i in range(1, n+1):
    if i < k:
        dp.append(1)
    else:
        x = 1
        for j in range(1, k+1):
            x *= a[i-j]
        dp.append(x)

dp = dp[-(n-k+1):]
for i in range(len(dp)-1):
    if dp[i] < dp[i+1]:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
n,k = map(int,input().split())
l = list(map(int,input().split()))
cnt = l[k-1]
p = 1
g = k-1
i = 0
while(i < k-1):
    cnt = cnt*l[g-1]
    g = g-1
    i = i+1

g = g+1
pr = l[g-1]
while(k < n):
    if l[k] > pr:
        print("Yes")

    else:
        print("No")
    g = g+1
    pr = l[g-1]
    k = k+1

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split())
scores = list(map(int, input().split()))

tot = 1
for i in range(K):
    tot *= scores[i]
    
past = tot
for i in range(N-K):
    tot /= scores[i]
    tot *= scores[i+K]
    if tot > past:
        print("Yes")
    else:
        print("No")
    past = tot

Submission status: Time Limit Exceeded

Solution code:
def main():
    n, k = [int(e) for e in input().split()]
    A = [int(e) for e in input().split()]

    s = A[0]
    for i in range(1, k):
        s *= A[i]

    prev = s
    for i in range(n - k):
        s //= A[i]
        s *= A[k + i]

        if prev < s:
            print('Yes')
        else:
            print('No')

        prev = s


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
#: Author - Soumya Saurav
import sys,io,os,time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"

input = sys.stdin.readline

########################################

n , k = map(int , input().split())
arr = list(map(int , input().split()))
temp = 1
h = []
for i in range(1,n+1):
	if i < k:
		temp*=arr[i-1]
	elif i == k:
		#print(i)
		h.append(temp*arr[i-1])
	else:
		#print(h)
		curr = h[-1]
		nex = curr*arr[i-1]//arr[i-k-1]
		#print(nex, arr[i-1],arr[i-k-1])
		if curr < nex:
			print("Yes")
		else:
			print("No")
		h.append(nex)

Submission status: Time Limit Exceeded

Solution code:
n,k = map(int,input().split())
a_li = list(map(int,input().split()))
ans = 1
for i in range(k):
    ans *= a_li[i]
for i in range(k,n):
    num = ans // a_li[i-k]
    num *= a_li[i]
    if num > ans:
        print("Yes")
    else:
        print("No")
    ans = num

Submission status: Time Limit Exceeded

Solution code:
N, K=map(int, input().split())
A=list(map(int, input().split()))
for i in range(K,N):
    if i==K:
        a=1
        b=1
        for j in range(K):
            a*=A[j]
            b*=A[j+1]
    else:
        a=b
        b=b/A[i-K]*A[i]
    if a<b: print('Yes')
    else: print('No')

Submission status: Time Limit Exceeded

Solution code:
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


def is_ok(n, k, a):
    res = []
    # O(n - k)
    for i in range(k - 1, n):
        mul = 1
        # O(k)
        for j in range(i - k+1, i + 1):
            mul *= a[j]
        res.append(mul)
    return res


n, k = LI()
a = LI()
base = 1
for elem in a[:k]:
    base *= elem
# print(base)
for i in range(k, n):
    # print(f'{i=}')
    # print(f'{i-k=}, {a[i-k]=}')
    # print(base, (base//a[i - k]) * a[i])
    if base < (base//a[i - k]) * a[i]:
        ans = 'Yes'
    else:
        ans = 'No'
    base = (base//a[i - k]) * a[i]
    print(ans)

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
l=[]
score=1
for i in range(k):
    score*=a[i]
l.append(score)
m=k
d=0
multi=a[m]
div=a[d]
for i in range(k+1,n+1):
    score=(score*a[m])//a[d]
    l.append(score)
    m+=1
    d+=1
old=l[0]
for i in range(1,len(l)):
    if l[i]<=old:
        print("No")
    else:
        print("Yes")
    old=l[i]

Submission status: Time Limit Exceeded

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n, k = MI()
    A = LI()
    score = [1]*n
    for i in range(0, k):
        score[k-1] *= A[i]
    for i in range(k, n):
        score[i] = (score[i-1]//A[i-k])*A[i]
        if score[i-1] < score[i]:
            print('Yes')
        else:
            print('No')



if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
#for _ in range(int(input())):
n,k=map(int,input().split())
x=[int(x) for x in input().split()]
ans=[1]*n
ans[0]=x[0]
for i in range(1,k):
  ans[i]=ans[i-1]*x[i]
c=0
for i in range(k,n):
  ans[i]=(ans[i-1]//x[c])*x[i]
  c+=1

ans=ans[k-1:]

for i in range(len(ans)-1):
  if ans[i+1]>ans[i]:print('Yes')
  else:print('No')

Submission status: Time Limit Exceeded

Solution code:
import sys
input=sys.stdin.readline

n,k=map(int,input().split())
a=list(map(int,input().split()))
b=[]
p=1
for i in range(n):
    p=p*a[i]

    if i>=k-1:
        b.append(p)
        p=p//a[i-k+1]

for i in range(1,len(b)):
    if b[i]>b[i-1]:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
count=0
ans=None
d=0
for i in range(n-k+1):
  if d==0:
    s=a[count:k+count]
    gakki=1
    d=1
  else:
    del s[0]
    s.append(a[k+count])
    count+=1
    gakki=1
  
  for w in s:
    gakki*=w
  
  
  if ans is None:
    ans=gakki
  else:
    if ans<gakki:
      print('Yes')
      ans=gakki
    else:
      print("No")
      ans=gakki

Submission status: Time Limit Exceeded

Solution code:
# import sys
# import math #sqrt,gcd,pi
# import decimal
# import queue # queue
# import bisect
# import heapq # priolity-queue
import time
# from itertools import product,permutations,\
    # combinations,combinations_with_replacement
# 重複あり順列、順列、組み合わせ、重複あり組み合わせ
# import collections # deque
# from operator import itemgetter,mul
# from fractions import Fraction
# from functools import reduce

mod = int(1e9+7)
# mod = 998244353
INF = 1<<50

def readInt():
    return list(map(int,input().split()))

def main():
    n,k = readInt()
    a = readInt()
    ans = []
    res = 1
    for i in range(n):
        x = res
        if i<k:
            res *= a[i]
        else:
            res //= a[i-k]
            res *= a[i]
            if res>x:
                ans.append("Yes\n")
            else:
                ans.append("No\n")
    print(''.join(ans))
    return

if __name__=='__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split())
A = list(map(int, input().split()))

point = 1
point_ = 1
for i in range(K):
	point *= A[i]

for i in range(N - K):
	for x in range(K):
		point_ *= A[i + x + 1]
	if point < point_:
		print("Yes")
	else:
		print("No")
	point = point_
	point_ = 1

Submission status: Time Limit Exceeded

Solution code:
n,k = map(int,input().split())

a = [0 for _ in range(n)]

a = [int(s) for s in input().split()]

a_sum = [0 for _ in range(n+1)]
a_sum[0] = 1


for i in range(1,n+1):
    a_sum[i] = a_sum[i-1] * a[i-1]


score = [0 for _ in range(n-k+1)]

for i in range(k,n+1):
    score[i-k] = int(a_sum[i]/a_sum[i-k])

#print(score)

for i in range(1,n-k+1):
    if(score[i] > score[i-1]):
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
N,K = (int(x) for x in input().split())
A = [int(x) for x in input().split()]

#print(N)
#print(K)
#print(A)

preX = 0
nowX = 1

for i in range(K,N+1):
#  print(str(i)+'学期')
  for x in range(K):
    nowX *= A[i-x-1]
#  print(nowX)
  if preX != 0:
    if preX < nowX:
      print('Yes')
    else:
      print('No')
  preX = nowX
  nowX = 1

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split())
A = list(map(int, input().split()))
P = list()
for i in range(N - K + 1):
  x = 1
  for y in range(K):
    x *= A[i + y]
  P.append(x)
pre = P[0]
for p in P[1:]:
  if pre < p:
    print("Yes")
  else:
    print("No")
  pre = p

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))

score = 0
for i in range(n-k+1):
    now = 1
    for j in range(k):
        now *= a[i+j]
    if i > 0:
        if score < now:
            print('Yes')
        else:
            print('No')
    score = now

Submission status: Time Limit Exceeded

Solution code:
from collections import deque
from functools import reduce
from operator import mul

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

effect_points = deque()

for section in range(K, N + 1):
    target_test_points = test_points[section - K : section]
    effect_points.append(reduce(mul, target_test_points))

for i in range(1, len(effect_points)):
    if effect_points[i - 1] < effect_points[i]:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))
n, k = map(int, input().split())
a = list(map(int, input().split()))
rui = [1]
t = 1
for i in range(n):
    t *= a[i]
    if i < k:
        rui += [t]
    else:
        t = t // a[i - k]
        rui += [t]
        if rui[i + 1] > rui[i]:
            print('Yes')
        else:
            print('No')
#print(rui)

Submission status: Time Limit Exceeded

Solution code:
N,K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
before = 1
for i in A[:K]:
    before *= i

for i in range(K,len(A)):
    val = before
    val /= A[i-K]
    val *= A[i]

    if(val > before):
        print("Yes")
    else:
        print("No")
    before = val

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split())
A = list(map(int, input().split()))

import functools
import operator
prod = functools.partial(functools.reduce, operator.mul)

# print(A)

# i=K+1の時、直近K回の期末テストの点数
p_K = prod(A[:K])
# print(p_K)
for i in range(K, N):
    # print(i)
    p_Kp1 = p_K / A[i-K] * A[i]
    # print(p_Kp1)
    if p_K < p_Kp1:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
s=1
for i in range(k):
    s*=a[i]
for i in range(n-k):
    ns=(s/a[i])*a[i+k]
    if ns>s:
        print("Yes")
    else:
        print("No")
    s=ns

Submission status: Time Limit Exceeded

Solution code:
a = [(input()) for i in range(2)]
tmp=a[0].split(' ')
tmp_s=a[1].split(' ')
score=[]
for i in range(int(tmp[0])-int(tmp[1])+1):
  t=1
  for j in range(int(tmp[1])):
    t=t*int(tmp_s[j+i])
  score.append(t)
for i in range(len(score)-1):
  if score[i]<score[i+1]:
    print('Yes')
  else:
    print('No')

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split())
A_list = list(map(int, input().split()))
Score_list = [1 for i in range(N+1)]

for i in range(K, N+1):
    # print(sum(A_list[0:i]))
    #
    # Score_list[i] = sum(A_list[0:i])
    # Score_list[i] = 1
    if i == K:
        for j in range(i-K, i):
            Score_list[i] *= A_list[j]
    else:
        # print(i)
        # print(A_list[i])
        Score_list[i] = int(Score_list[i-1] * A_list[i-1] / A_list[i-1-K])
    if i > K:
        if Score_list[i] > Score_list[i-1]:
            print("Yes")
        else:
            print("No")
    # print(Score_list)

# print(Score_list)

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))

results = []
result = 1

for i in range(k):
    result *= a[k - i]

for i in range(k - 1, n):
    result /= a[i - k]
    result *= a[i]
    results.append(result)
for i in range(1, len(results)):
    if results[i - 1] < results[i]:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
N,K=map(int,input().split())
a=list(map(int,input().split()))
pre=1
for i in range(K):
    pre*=a[i]
for i in range(K,N,1):
    now=pre*a[i]//a[i-K]
    if now>pre:
        print("Yes")
    else:
        print("No")
    pre=now

Submission status: Time Limit Exceeded

Solution code:
n,k = map(int,input().split()) 
a= list(map(int,input().split())) 

curr=prev=1

for i in range(k):
  curr*=a[i]
prev=curr
for i in range(k,n):
  curr*=a[i]
  curr/=a[i-k]
  if prev<curr:
    print("Yes")
  else:
    print("No")
  prev=curr

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))

ans_list = []
for i in range(k, n+1):
    multi = 1
    for i in a[i-k:i]:
        multi *= i
    else:
        ans_list.append(multi)

flg = True
for i in ans_list:
    if flg:
        befor = i
        flg = False
    else:
        if befor < i:
            print('Yes')
        else:
            print('No')
        befor = i

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
memo = [1 for i in range(n)]
a = list(map(int, input().split()))
for i in range(k, n+1, 1):
    for j in range(i-k, i, 1):
        memo[i-1] *= a[j]
for i in range(k, n, 1):
    if memo[i-1] < memo[i]:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().strip().split(" "))
scores = input().strip().split(" ")
i = 0
grade = 1
for i in range(K):
    grade *= int(scores[i])

for i in range(K, N):
    last = grade
    grade = int(grade / int(scores[i-K]))
    grade *= int(scores[i])
    if (grade > last):
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))

total = 1

for i in range(k - 1, -1, -1):
    total *= a[i]

after = total
for i in range(k + 1, n + 1):
    before = total
    after //= a[i - k - 1]
    after *= a[i - 1]

    if before < after:
        print("Yes")
    else:
        print("No")

    total = after

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
import math
#import numpy
#N = int(input())
N, K = map(int,input().split())
A = list(map(int,input().split()))
#K =int(input())
ANS = []
a = 1
for i in range(K):
    a *= A[K-i-1]
ANS.append(a)
for i in range(K,N):
    a *=A[i]
    a //= A[i-K]
    ANS.append(a)
#print(ANS)
for i in range(N-K):
    if ANS[i+1] > ANS[i]:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
#Problem C

N,K = map(int, input().split())
a = list(map(int,input().split()))
p = []
p1 = 1

for i in range(K):
    p1 *= a[i]
p.append(p1)
for i in range(N-K):
    pn = p[i]/a[i]*a[K+i]
    p.append(pn)


for i in range(N-K):
    if p[i+1] > p[i]:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
a_list = list(map(int, input().split()))

score = [1] * (n - k + 1)

for i in range(k):
    score[0] *= a_list[i]

for i in range(1, n-k+1):
    score[i] = (score[i-1] / a_list[i-1]) * a_list[k+i-1]

for i in range(len(score)-1):
    if score[i+1] - score[i] > 0:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
n,k= list(map(int, input().strip().split()))
a = list(map(int, input().strip().split()))
b=[1]*n
x=1
for i in range(k,n+1):
    for j in range(i-k,i):
        b[i-1]*=a[j]
    

for i in range(k,n):
    if b[i-1]<b[i]:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split())
l = []
Ap = 0
An = 0
i = 0
for x in input().split():
    A = int(x)
    l.append(A)
    if i < K:
        Ap = Ap + A
    else:
        An = Ap - l.pop(0) + A
        if An > Ap:
            print("Yes")
        else:
            print("No")
        Ap = An
    i = i + 1

Submission status: Time Limit Exceeded

Solution code:
n,k=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]
b=[]
c=1
for i in range(n):
    c*=a[i]
    #規定回数+1から
    if i>=k:
        d=c//a[i-k]
        e=c//a[i]
        b.append('Yes' if d>e else 'No')
        c=d

for ans in b:
    print(ans)

Submission status: Time Limit Exceeded

Solution code:
import functools
import operator

prod = functools.partial(functools.reduce, operator.mul)

N,K,*A = map(int, open(0).read().split())

p = None
j = 0
for i in range(K, N+1):
    c = prod(A[j:i])
    if p:
        if p < c:
            print('Yes')
        else:
            print('No')
    p = c
    j += 1

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin

def multiple(A,st,ed):
    res = 1
    for i in range(st,ed):
        res = res * A[i]

    return res

def main():
    n, k = [int(x) for x in stdin.readline().rstrip().split()]
    A = [int(x) for x in stdin.readline().rstrip().split()]

    H = [0] * (n-k)
    pre = multiple(A,0,k)
    H[0] = pre

    st = -1
    for i in range(k+1,n+1):
        st += 1
        cur = pre * A[i-1] / A[st]
        if cur > pre:
            print("Yes")
        else:
            print("No")
        pre = cur

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
n, k=map(int, input().split())
plist = list(map(int, input().split()))
last = 0
point = 1
ans = []
while k <= len(plist):
  for i in range(k):
    point = point * plist[i]
  if last > 0:
    if point > last:
      print("Yes")
    else:
      print("No")
  last = point
  point = 1
  del plist[0]

Submission status: Time Limit Exceeded

Solution code:
n,k = map(int, input().split())
a = list(map(int, input().split()))
c = 1
for i  in range(k):
    c *= a[i]
for i in range(n):
    if i>=k:
        c1 = c * a[i] / a[i-k]
        c2 = c
        if c1>c2:
            print("Yes")
        else:
            print("No")
        c = c1

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))

hyouten = [0]*n
hyouten[k-1] = 1
for i in range(k):
    hyouten[k-1] *= a[i]
#print(hyouten[k-1])
for i in range(k+1, n+1):
    hyouten[i-1] = hyouten[i-2]//a[i-k-1]
    hyouten[i-1] = hyouten[i-1]*a[i-1]
    if hyouten[i-1] > hyouten[i-2]:
        print("Yes")
    else:
        print("No")
#print(hyouten)

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split())
l=list(map(int,input().split()))
ans=1
for i in range(k):
    ans=l[i]*ans

for i in range(k,n):
    prevans=ans
    ans=(ans*l[i])//l[i-k]
    if ans>prevans:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split())
A = list(map(int, input().split()))

def list_seki(l):
    S = 1
    for i in range(0, len(l)):
        S *= l[i]
    return S

for x in range(K, N):
    before = list_seki(A[x-K:x])
    after = list_seki(A[x-K+1:x+1])
    if after > before:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
from itertools import accumulate
from operator import mul
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    N, K = map(int, input().split())
    A = tuple(map(int, input().split()))

    point = list(accumulate(A[:K], mul))
    for i in range(K, N):
        point.append(point[-1] * A[i] // A[i - K])
    for i in range(K, N):
        if point[i - 1] < point[i]:
            print("Yes")
        else:
            print("No")


main()

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))

total = 1

for i in range(k - 1, -1, -1):
    total *= a[i]

after = total
for i in range(k + 1, n + 1):
    before = total
    after //= a[i - k - 1]
    after *= a[i - 1]

    if before < after:
        print("Yes")
    else:
        print("No")

    total = after

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))

li = []
for i in range(n-k +1):
    tmp = a[i]
    for j in range(1, k):
        tmp *= a[i +j]
    li.append(tmp)

for i in range(len(li) -1):
    if (li[i] >= li[i+1]):
        print("No")
    else:
        print("Yes")

Submission status: Time Limit Exceeded

Solution code:
from operator import mul
from functools import reduce

n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
r = [0] * (n - k + 1)
for i in range(n - k + 1):
    r[i] = reduce(mul, a[i : i + k])

    if i > 0:
        if r[i] > r[i - 1]:
            print("Yes") 
        else: 
            print("No")

Submission status: Time Limit Exceeded

Solution code:
n, k = [int(i) for i in input().split()]
lst = [int(i) for i in input().split()]

for i in range(k - 1, n):
  if i == k - 1:
    point_con = 1
    for j in range(k):
      point_con *= lst[j]
  else:
    point_con = point_con * lst[i] / lst[i - k]
    if point_con > point_pre:
      print('Yes')
    else:
      print('No')
  point_pre = point_con

Submission status: Time Limit Exceeded

Solution code:
from collections import deque
n, k = map(int, input().split())
a = list(map(int, input().split()))

prev = 1
for i in range(k):
    prev *= a[i]

a_old = deque(a)
s = [prev]
for i in range(k, n):
    old = a_old.popleft()
    score = prev*a[i] / old
    s.append(score)
    prev = score

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

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split())
A = list(map(int, input().split()))

tmp = 1
for j in range(K):
    tmp *= A[j]
for i in range(1, N-K+1):
    ans = 1
    for j in range(K):
        ans *= A[i+j]
    # print(tmp, ans)
    if tmp < ans:
        print('Yes')
    else:
        print('No')
    tmp = ans

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split())
A = list(map(int, input().split()))
base = 1

for i in range(K):
  base *= A[i]
  
for i in range(K, N):
  bIndex = i - K
  nxt = base // A[bIndex] * A[i]
  if base >= nxt:
    print('No')
  else:
    print('Yes')
  base = nxt

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split())
A = list(map(int, input().split()))

prev = 1
for i in range(K):
    prev *= A[i]

idx = 0
for i in range(K, N):
    now = prev // A[idx] * A[i]
    if prev < now:
        ans = "Yes"
    else:
        ans = "No"
    print(ans)

    prev = now
    idx += 1

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
l=[]
score=1
for i in range(k):
    score*=a[i]
l.append(score)
m=k
d=0
multi=a[m]
div=a[d]
for i in range(k+1,n+1):
    score=(score*a[m])//a[d]
    l.append(score)
    m+=1
    d+=1
old=l[0]
for i in range(1,len(l)):
    if l[i]<=old:
        print("No")
    else:
        print("Yes")
    old=l[i]

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
s=[1]
for i in range(n):
  s.append(s[-1]*a[i])
for i in range(k+1,n+1):
  if s[i]/s[i-k]>s[i-1]/s[i-1-k]:
    print('Yes')
  else:
    print('No')

Submission status: Time Limit Exceeded

Solution code:
from collections import deque
N, K = list(map(int, input().split()))

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

score = [0]*N
dq = deque()

for i in range(0, K):
    dq.append(A[i])
score_now = 1
for i in range(len(dq)):
    score_now *= dq[i]

for j in range(K-1, N-1):
    score[j] = score_now

    left = dq.popleft()
    score_now /= left
    dq.append(A[j+1])
    score_now *= A[j+1]
score[N-1] = score_now


for k in range(K, N):
    if score[k] > score[k-1]:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
n,k = map(int , input().split())
sum = 0
a = list(map(int , input().split()))
tmp = 1
for i in range(0,k):
    tmp *= a[i]
for i in range(k,n):
    # print(tmp)
    if tmp*a[i]/a[i-k] > tmp:
        print("Yes")
    else:
        print("No")
    tmp = tmp*a[i]/a[i-k]

Submission status: Time Limit Exceeded

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
n, k = map(int, input().split())
a = list(map(int, input().split()))

now = 1
for i in range(k):
    now *= a[i]
before = now

for i in range(n - k):
    now *= a[i + k]
    now /= a[i]
    if now > before:
        print('Yes')
    else:
        print('No')
    before = now

Submission status: Time Limit Exceeded

Solution code:
import functools
import operator


def prod(arr):
    return functools.reduce(operator.mul, arr)


def main():
    N, K = (int(x) for x in input().split(" "))
    A = [int(x) for x in input().split(" ")]
    lastest_score = prod(A[0:K])
    for i in range(1, N-K+1):
        current_score = prod(A[i:i+K])
        if lastest_score < current_score:
            print("Yes")
        else:
            print("No")
        lastest_score = current_score


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
ai = list(map(int, input().split()))

ei = []

for i in range(k,n+1):
    val = 1
    for j in ai[i-k:i]:
        val *= j
    ei.append(val)


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

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
prod=1
for i in range(0,k):
    prod=prod*a[i]
i=0
for j in range(k,len(a)):
    if a[j]>a[i]:
        print("Yes")
    else:
        print("No")
    i+=1

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split())
A = list(map(int, input().split()))

lst = [0]*(N-K+1)

lst[0] = 1
for i in range(K):
    lst[0] = lst[0] * A[i]

for i in range(1,N-K+1):
    lst[i] = lst[i-1] / A[i-1]
    lst[i] = lst[i] * A[K-1+i]
    if lst[i] > lst[i-1]:
        print("Yes")
    else:
        print("No")