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().strip().split())
A = list(map(int, input().strip().split()))

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

for i in range(K,N):
    if A[i]>A[i-K] :
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
ZIP = lambda: zip(*(MAP() for _ in range(n)))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N, K = MAP()
    A = LIST()

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




if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
def solve():
    n, k = map(int, input().split())
    A = list(map(int, input().split()))
    tmp = 1
    for i in range(k):
        tmp *= A[i]

    for j in range(k + 1, n + 1):
        x = tmp * 1
        tmp //= A[j - k - 1]
        tmp *= A[j - 1]
        if tmp > x:
            print("Yes")
        else:
            print("No")


solve()

Submission status: Time Limit Exceeded

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

cumpro=[]

pro=1
for i in range(n):
    pro*=a[i]
    cumpro.append(pro)

ans=[cumpro[k-1]]

for j in range(k,n):
    ans.append(cumpro[j]/cumpro[j-k])

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

Submission status: Time Limit Exceeded

Solution code:
import math 

N, K = map(int, input().split())
scores = list(map(int, input().split()))
l = []
for i in range(N - K + 1):
  l += [math.prod(scores[i:i+K])]

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

Submission status: Time Limit Exceeded

Solution code:
# cook your dish here
n,k = map(int, input().split(' '))
li = list(map(int,input().strip().split()))[:n]
p=1
c=1
for i in range(0,k):
    p = p*li[i];
for j in range(k,n):
    c = p/li[j-k]
    c = c*li[j]
    if c > p:
        print("Yes")
    else :
        print("No")
    p = c

Submission status: Time Limit Exceeded

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n,k = map(int,readline().split())
a = list(map(int,readline().split()))
c = 1
for i in range(k):
  c *= a[i]
  
for i in range(n-k):
  chk = c*a[k+i]//a[i]
  if chk > c:
    print('Yes')
  else:
    print('No')

Submission status: Time Limit Exceeded

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

scores = []
for i in range(K,N+1):
    p = 1
    for k in range(K):
        p *= A[i-k]
    scores.append(p)

l = len(scores)-1
for i in range(l):
    print(["No","Yes"][scores[i+1]>scores[i]])

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
a = [int(i) for i in input().split()]
s = [0 for i in range(n)]
p = [0 for i in range(n)]

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

p[k-1] = s[k-1]
for i in range(k, n):
  p[i] = int(s[i] / s[i-k])

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

Submission status: Time Limit Exceeded

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

temp1 = gakki[0]
for i in range(1,K):
    temp1 *= gakki[i]

for i in range(N - K):
    temp2 = int(temp1 / gakki[i] * gakki[K + i])
    if temp1 < temp2:
        print("Yes")
    else:
        print("No")
    temp1 = temp2

Submission status: Time Limit Exceeded

Solution code:

#!/usr/bin/python
# -*- coding: utf-8 -*-

import numpy as np

def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(input()))
    return np.array(x)

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

past = 1
now = 1


for j in range(0,K):
    past = past*A[j]

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

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))
b = []
start = 1

for i in range(k):
  start *= a[i]
  
b.append(start)

score = start

for i in range(k, n):
  score = score / a[i-k] * a[i]
  b.append(score)
  
for i in range(n-k):
  if b[i] < b[i + 1]:
    print('Yes')
  else:
    print('No')

Submission status: Time Limit Exceeded

Solution code:
N,K=list(map(int,input().split()))
a_list=list(map(int,input().split()))
a_mul = [1]
for i,a in enumerate(a_list):
  a_mul.append(a_mul[i] * a)

for i in range(K+1,N+1):
  iscore = a_mul[i]//a_mul[i-K]
  i_score = a_mul[i-1]//a_mul[i-1-K]
  print('Yes' if iscore > i_score else 'No')

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split())
a=list(map(int,input().split()))
#まずk学期までの
p=1
for i in range(k):
    p*=a[i]


for i in range(n-k):
    tmp=p
    p//=a[i]
    p*=a[i+k]
    #print(p)
    if p>tmp:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

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

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

prev = score
for i,j in zip(range(K, N), range(N-K)):
    score /= A[j]
    score *= A[i]
    print("Yes" if score > prev else "No")
    prev = score

Submission status: Time Limit Exceeded

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

for i in range(n - k + 1):
    score = 1
    for j in range(k):
        score *= a_list[i + j]
    if i != 0:
        if prev < score:
            print("Yes")
        else:
            print("No")
    prev = score

Submission status: Time Limit Exceeded

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

s = 1
for i in range(k):
    s *= li[i]

for i in range(k, n):
    t = s * li[i]
    t //= li[i-k]

    if s < t:
        print('Yes')
    else:
        print('No')
        
    s = t

Submission status: Time Limit Exceeded

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

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

for i in range(K,N):
    before=now
    now/=A[i-K]
    now*=A[i]
    if now > before:
        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 = 1
for j in range(K):
    b *= A[j]

for i in range(1, N-K+1):
    a = 1
    for j in range(K):
        a *= A[i+j]
    print('Yes' if a > b else 'No')
    b = a

Submission status: Time Limit Exceeded

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

for i in range(n):
    if i < k:
        a1 = a1*a[i]
    else:
        a2 = a1
        a1 = a[i]*a1//a[i-k]
        if a1 > a2:
            print('Yes')
        else:
            print('No')

Submission status: Time Limit Exceeded

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n,k = readInts()
A = readInts()
pa = 1
i = 0
while i < k:
    pa *= A[i]
    i += 1
while i < n:
    nya = pa
    pa = A[i] * pa // A[i-k]
    if nya < pa:
        print('Yes')
    else:
        print('No')
    i += 1

Submission status: Time Limit Exceeded

Solution code:
def main():
    n, k= map(int, input().split())
    a = list(map(int, input().split()))
    pre = -1
    for i in range(n-k+1):
        now = 1
        for b in a[i:k+i]:
            now *= b
        if pre == -1:
            pre = now
            continue
        if pre < now:
            print('Yes')
        else:
            print('No')
        pre = now
    
    
if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

from functools import reduce
prod = reduce(lambda x,y: x*y, an[:k])

for i in range(k, n):
    prod_next = prod // an[i - k] * an[i]
    print(['No', 'Yes'][prod_next > prod])
    prod = prod_next

Submission status: Time Limit Exceeded

Solution code:
import sys
import re
import math
import collections
import decimal
import bisect
import itertools
import fractions
import functools
import copy
import heapq
import decimal
import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10 ** 9)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===

def main():
    n, k = ns()
    a = na()

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

    prev = tmp

    for i in range(k, n):
        crnt = (prev // a[i - k]) * a[i]

        print("Yes" if crnt > prev else "No")
        prev = crnt


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

point = []
for i in range(K - 1, N):
    p = 1
    for j in range(i - (K - 1), i + 1):
        p = p * A[j]
    point.append(p)


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

Submission status: Time Limit Exceeded

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


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

  S = [1]*(N+1)
  for i in range(1, N+1):
    S[i] = S[i-1] * A[i-1]

  score = []
  for i in range(K, N+1):
    score.append(S[i]/S[i-K])

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


if(__name__ == '__main__'):
  main()

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]

res = []
for i in range(k, n):
    curr = prev // a[i - k] * a[i]
    res.append(curr > prev)
    prev = curr

#print(res)
for b in res:
    if(b): print("Yes")
    else: print("No")

Submission status: Time Limit Exceeded

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

numbers=[]

for n in range(N-K+1):
    suuji=A[n:n+K]
    answer=1
    for k in suuji:
        answer*=k
    numbers.append(answer)

for k in range(N-K):
    if numbers[k]<numbers[k+1]:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
aas = list(map(int, input().split()))
scores = []
cnt = 0
tmp = 1
for i in range(n):
    tmp *= aas[i]
    if i >= k-1:
        scores.append(tmp)
        tmp //= aas[i-(k-1)]
for i in range(1,len(scores)):
    if scores[i] > scores[i-1]:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split())
A=list(map(int,input().split()))
ave=[0 for i in range(n-k+1)]

for i in range(n-k+1):
    temp=1
    for s in range(i,i+k):
        temp*=A[s]
    ave[i]=temp

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

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split())
A = [0] + list(map(int, input().split()))
score = [0]*(N+1)

score[1] = A[1]
for i in range(2, K+1):
    score[i] = score[i-1]*A[i]

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

Submission status: Time Limit Exceeded

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

ans = [0] * (n-k+1)

for i in range(n-k+1):
    for j in range(k):
        if j == 0:
            ans[i] = a[i+j]
        else:
            ans[i] *= a[i+j]

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
A = list(map(int, input().split()))
keep = 1

for i in range(k):
    keep *= A[i]


for j in range(n - k):
    if A[k + j] > A[j]:
        print("Yes")
    else:
        print("No")
    keep = keep * A[k + j] / A[j]

Submission status: Time Limit Exceeded

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

scores = []

s = 0
score = 1
for i in range(k):
    score *= a[i]

scores.append(score)
for i in range(k,n):
    score = score // a[s] * a[i]
    s += 1
    scores.append(score)

#print(scores)
for i in range(len(scores)-1):
    if scores[i+1] > scores[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()))

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

for i in range(N-K):
    q = (p//A[i])*A[i+K]
    if q > p:
        print('Yes')
    else:
        print('No')
    p = q

Submission status: Time Limit Exceeded

Solution code:
from collections import defaultdict,deque
import math
def gcd(a,b):
    return b if not a%b else gcd(b,a%b)
def lcm(a,b):
    return (a*b)//gcd(a,b)

def main():
    n,k=map(int, input().split())
    a=[int(i) for i in input().split()]
    tmp = 0
    res = []
    for i in range(k-1,n):
        past=0
        tmp = 1
        for j in range(i,i-k,-1):
            tmp*=a[j]

        res.append(tmp)

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


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
N,K = map(int,input().split())
A = list(map(int,input().split()))
for i in range(N-K):
    mae = 1
    ato = 1
    for j in range(K):
        #print(i,j)
        mae = mae*A[K-j+i-1]
        #print(A[K-j+i-1])
        ato = ato*A[K-j+i]
        #print(A[K-j+i])
    if mae < ato:
        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=[]
for j in range(K-1,N):
    score=1
    for i in range(j-K+1,j+1):
        score*=A[i]
    s.append(score)
    
for i in range(len(s)-1):
    if s[i]<s[i+1]:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

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

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

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

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]
for i in range(k,n):
  cur = (prev//a[i-k])*a[i]
  print("Yes" if cur > prev else "No")
  prev = cur

Submission status: Time Limit Exceeded

Solution code:
ma = lambda :map(int,input().split())
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
n,k = ma()
A = list(ma())
s = 1
zeros = [0 for i in range(n+1)]
for i in range(k):
    s*=A[i]
    if A[i] ==0:
        zeros[i] +=1
        zeros[min(n,i+k)] -=1
for i in range(1,n+1):
    zeros[i] += zeros[i-1]
for i in range(k,n):
    if zeros[i] >0:
        f = False
        yn(f)
        continue
    if A[i] > A[i-k]:
        f =True
    else:
        f=False
    yn(f)

Submission status: Time Limit Exceeded

Solution code:
def main():
    N, K = list(map(int, input().split(' ')))
    Ai = list(map(int, input().split(' ')))
    # print(Ai)
    P = []
    for n in range(K-1, N):
        # print(Ai[n-2], Ai[n-1], Ai[n], Ai[n-2]*Ai[n-1]*Ai[n])
        # P.append(Ai[n-2]*Ai[n-1]*Ai[n])
        # t = Ai[n-K:n]
        P.append(sum(Ai[n-K+1:n+1]))
        # print(n-K+1, n)
        # print(Ai[n-K+1:n+1])
            
    # print(P)
    for i in range(len(P)-1):
        if P[i+1] > P[i]:
            print('Yes')
        else:
            print("No")
        

main()

Submission status: Time Limit Exceeded

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

prev = -1
for i in range(K-1, N):
    prod = 1
    # print('prod')
    for k in range(K):
        prod *= A[i-k]
        # print(A[i-k])
    if prev != -1:
        if prev < prod:
            print('Yes')
        else:
            print('No')
    prev = prod

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

now = 1

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

for i in range(k,n):
    ima = now * a[i]
    ima //= a[i-k]
    if ima > now:
        print("Yes")
    else:
        print("No")
    now = ima

Submission status: Time Limit Exceeded

Solution code:
from functools import reduce

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

cum = [0] * (n - k + 1)
for i in range(n - k + 1):
    cum[i] = reduce(lambda x, y: x * y, a[i:i + k])

for i in range(1, len(cum)):
    if cum[i] > cum[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()))
scores=[]
for i in range(N-K+1):
  score=1
  for j in range(i,i+K):
    score*=A[j]
  scores.append(score)

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

Submission status: Time Limit Exceeded

Solution code:
#n=int(input())
n,k=map(int,input().split())
al=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
def f(l):
    res=1
    for li in l:
        res=res*li
    return res
sc=[]
for i in range(k-1,n):
    score=f(al[i-k+1:i+1])
    sc.append(score)
for i in range(n-k):
    if sc[i+1]>sc[i]:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split())
A = list(map(int, input().split()))
prefix = [1] * (N + 1)
for i, a in enumerate(A, 1):
    prefix[i] = prefix[i - 1] * a

for i in range(K + 1, N + 1):
    prev = prefix[i - 1] // prefix[i - K - 1]
    cur = prefix[i] // prefix[i - K]
    if cur > prev:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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

ans = [True] * (n-k)
now = 1
for i in range(n):
    if i < k:
        now *= a[i]
        continue
    old = now
    now /= a[i-k]
    now *= a[i]
    ans[i-k] = now > old
for v in ans:
    print("Yes" if v else "No")

Submission status: Time Limit Exceeded

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

for i in range(k, n):
    if a[i] > a[i - k]:
        print('Yes')
    else:
        print('No')
    score *= a[i]

Submission status: Time Limit Exceeded

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

b=list()
x=1

for i in range(k):
    x*=a[i]
b.append(x)
for i in range(k, n):
    x/=a[i-k]
    x*=a[i]
    b.append(x)
x=0
for i in b:
    if x==0:
        x=i
    else:
        if x<i:
            x=i
            print("Yes")
        else:
            x=i
            print("No")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
import copy
N, K = map(int, input().split())
A = list(map(int, input().split()))

before = 1

for i in range(K, 0, -1):
    before *= A[K-i]
for i in range(K, N):
    after = (before//A[i-K])*A[i]
    if before < after:
        print('Yes')
    else:
        print('No')
    before = copy.deepcopy(after)

Submission status: Time Limit Exceeded

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

hyouten = [0] * (N)

# 評点計算
for i in range(K-1, N):
    tmp = A[i]
    for j in range(1,K):
        tmp *= A[i-j]
    hyouten[i] = tmp

for i in range(K, N):
    if hyouten[i] > hyouten[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()))
tb = 1
for i in range(K):
  tb *= A[i]
for i in range(K,N):
  t = tb // A[i-K]
  t *= A[i]
  if t > tb:
    print("Yes")
  else:
    print("No")
  tb = t

Submission status: Time Limit Exceeded

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect, bisect_left, bisect_right

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, K = MAP()
A = LIST()

# b = A[K:]

B = []
tmp = 1
for a in A[:K]:
    tmp *= a
for i in range(N - K):
    tmp2 = tmp / A[i] * A[K + i]
    if tmp < tmp2:
        print("Yes")
    else:
        print("No")
    # print(tmp, tmp2)
    tmp = tmp2

Submission status: Time Limit Exceeded

Solution code:
n,k  = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
start = 1
for i in range(k):
    start*=a[i]
for i in range(n-k):
    ele = a[i+k]
    new = (start//a[i])*ele
    if new<=start:
        print("No")
    else:
        print("Yes")
    start = new

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
import os
import sys
from io import BytesIO, IOBase
# from collections import defaultdict as dd
# from collections import deque as dq
# import itertools as it
# from math import sqrt, log, log2
# from fractions import Fraction

def main():
    t = 1
    for _ in range(t):
        # n = int(input)
        n, k = map(int, input().split())
        nums = list(map(int, input().split()))

        prod = 1
        for i in range(k):
            prod *= nums[i]
        
        prev = prod
        start = 0
        for ind in range(k, n):
            new = prev * nums[ind] / nums[start]

            if new > prev:
                print("Yes")
            else:
                print("No")
            start += 1
            prev = new



        




































# region fastio
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
 
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
# endregion
 
if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
N,K = map(int,input().split( ))
A = list(map(int,input().split( )))
start = 1
for i in A[:K]:
    start *= i
for tail,head in zip(A,A[K:]):
    if start < start/tail*head:
        print('Yes')
    else:
        print('No')
    start = start/tail*head

Submission status: Time Limit Exceeded

Solution code:

def main():
  n, k = map(int, input().split())
  A = tuple(map(int, input().split()))

  prev = None
  s = 1
  for i in range(n):
    s *= A[i]
    if i >= k - 1:
      if i >= k:
        s //= A[i - k]
        if s > prev:
          print('Yes')
        else:
          print('No')

      prev = s



main()

Submission status: Time Limit Exceeded

Solution code:
n, k, *A = map(int, open(0).read().split())
s = 1
for a in A[:k]:
    s *= a
B = [s]
for i in range(k, n):
    s *= A[i]
    s //= A[i-k]
    B.append(s)

for b0, b1 in zip(B, B[1:]):
    if b0 < b1:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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