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:
def INT():
    return int(input())

def MI():
    return map(int, input().split())

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

N, K = MI()
A = LI()
score = 1

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

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

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=[]
alr=0
for i in range(k-1,n):
    
    if alr==0:
        score=f(al[i-k+1:i+1])
        alr=1
    else:
        first=al[i-k]
        last=al[i]
        score=(score//first)*last
    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:
from functools import reduce
n,k=map(int,input().split())
a=list(map(int,input().split()))

d=list(map(lambda i:reduce(lambda x,y:x*y,a[i:i+k]),range(n-k+1)))
dd=list(map(lambda x,y:'Yes' if y>x else 'No',d[:-1],d[1:]))
list(map(print,dd))

Submission status: Time Limit Exceeded

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

prev = 0
point = 1
for i in range(N):
    if i < K:
        point *= A[i]
    else:
        prev = point
        point *= A[i]
        point /= A[i-K]
        if prev < point:
            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 = []
for i in range(k,n+1):
    hoge = 1
    for j in range(i-k, i):
        hoge *= a[j]
    score.append(hoge)
    if len(score) >= 2:
        if score[i-k] >score[i-1-k]:
            print("Yes")
        else:
            print("No")

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline
import numpy as np

n, k = map(int, input().split())
AA =[]
c =False
for a in input().strip().split():

    if not c:
        AA.append(int(a))
        if len(AA) == k:
            next = sum(AA)
            c = True
    else:
        base = next
        AA = AA[1:]
        AA.append(int(a))
        next = sum(AA)
        if next - base <= 0:
            print("No")
        else:
            print("Yes")

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)
for i in range(k, n):
    old = a_old.popleft()
    score = prev*a[i] / old
    if score <= prev:
        print('No')
    else:
        print('Yes')
    prev = score

Submission status: Time Limit Exceeded

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

for i in range(K, N):
    last = grade;
    grade = int(grade / scores[i-K])
    grade *= 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()))
sum = 0
last = 0
for num in range(K):
  last += A[num]
for i in range(1,N-K+1):
  for j in range(K):
    sum += A[i+j]
  if last < sum:
    print("Yes")
  else:
    print("No")
  last = sum
  sum = 0

Submission status: Time Limit Exceeded

Solution code:
def main():
    N, K = map(int, input().split())
    A = [int(i) for i in input().split()]

    test_sum = 1
    for i in A[:K]:
        test_sum *= i


    for i in range(K, N):
        before_sum = test_sum
        test_sum //= A[i - K]
        test_sum *= A[i]

        if test_sum > before_sum:
            print("Yes")
        else:
            print("No")


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
import math

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

ans = 0
sm = 1
for i in range(k):
    sm *= aL[i]

prev = sm

for i in range(1, n - k + 1):
    j = i + k - 1
    sm = sm // aL[i - 1]
    sm = sm * aL[j]
    if prev < sm:
        print("Yes")
    else:
        print("No")
    prev = sm

Submission status: Time Limit Exceeded

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

P_before = 1
for k in range(K):
    P_before = P_before*A[k]
    
P_before


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

Submission status: Time Limit Exceeded

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue, copy, array

# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
# from decimal import Decimal
# from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, K = il()
    A = il()

    ret = [1] * N
    ret[0] = A[0]
    for n in range(1, N):
        ret[n] *= A[n] * ret[n - 1]
        if n >= K:
            ret[n] //= A[n - K]

    for k in range(K, N):
        if ret[k - 1] < ret[k]:
            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()))
score = 1
for j in range(k):
    score *= a[j]

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys
# import math
# import decimal

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

pt = A[0]
for i in range(0, K):
    pt = pt * A[i]

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

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]

def prod(i, k):
    ret = 1
    for j in range(i-k, i):
        ret *= A[j]
    return ret

for i in range(k+1, n+1):
    now = prod(i, k)
    if now <= pre:
        print('No')
    else:
        print('Yes')
    pre = now

Submission status: Time Limit Exceeded

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

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

# print(before_score)

this_term_score = 1
for i in range(N-K):
    for j in range(K):
        this_term_score *= A[K+i-j]
    if this_term_score > before_score:
        print("Yes")
        # print("this_term_score",this_term_score)
        # print("before_score",before_score)
        # print("\n")
    else:
        print("No")
        # print("this_term_score",this_term_score)
        # print("before_score",before_score)
        # print("\n")
    before_score = this_term_score
    this_term_score = 1

Submission status: Time Limit Exceeded

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

temp = 1
list = []

for i in range(0, K):
  temp *= A[i]

list.append(temp)

for i in range(K, N):
  temp /= A[i-K]
  temp *= A[i]
  
  list.append(temp)

answer = []
n = len(list)

for i in range(1, n):
  if list[i] <= list[i-1]:
    answer.append("No")
  else:
    answer.append("Yes")
    
print("\n".join(answer))

Submission status: Time Limit Exceeded

Solution code:
import os
import heapq
import sys
import math
import bisect
import operator
from collections import defaultdict
from io import BytesIO, IOBase
def gcd(a,b):
    if b==0:

        return a
    else:
        return gcd(b,a%b)
def power(x, p,m):
    res = 1
    while p:
        if p & 1:
            res = (res * x) % m
        x = (x * x) % m
        p >>= 1
    return res
def inar():
    return [int(k) for k in input().split()]


# def bubbleSort(arr,b):
#     n = len(arr)
#     for i in range(n):
#         for j in range(0, n - i - 1):
#             if arr[j] > arr[j + 1] and b[j]!=b[j+1]:
#                 arr[j], arr[j + 1] = arr[j + 1], arr[j]
#                 b[j],b[j+1]=b[j+1],b[j]
def lcm(num1,num2):
    return (num1*num2)//gcd(num1,num2)

def main():
    #for _ in range(int(input())):
    #n=int(input())
    n,k=inar()
    arr=inar()
    res=[]
    dp=[]
    for i in range(k):
        if i==0:
            dp.append(arr[i])
            continue
        dp.append(arr[i]*dp[-1])
    j=0
    for i in range(k,n):
        dp.append((arr[i]*dp[-1])//arr[j])
        if dp[i]>dp[i-1]:
            res.append("Yes")
        else:
            res.append("No")
        j+=1
    for i in range(len(res)):
        print(res[i])














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")

if __name__ == "__main__":
    main()

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)


for j in range(k,n):
    if j==k:
        a=cumpro[k-1]
        b=cumpro[j]/cumpro[j-k]
    else:
        a=cumpro[j-1]/cumpro[j-1-k]
        b=cumpro[j]/cumpro[j-k]

    if b>a:
        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
ans=[]
for i in range(k):
    s *= a[i]
ans.append(s)
for i in range(k, n):
    s = s * a[i] // a[i - k]
    ans.append(s)
    if ans[i - k] < ans[i - k + 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()))

cr = 1
for a in A[:k]:
    cr *= a

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

Submission status: Time Limit Exceeded

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

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

for i in range(k):
    ans[0] *= a[i]
for i in range(1, n-k+1):
    ans[i] = (ans[i-1] / a[i-1]) * a[k+i-1]

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

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

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

Submission status: Time Limit Exceeded

Solution code:
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()))
S = 1
for j in range(K):
  S = S * A[j]
for i in range(K,N):
  T = (S // A[i-K])*A[i]
  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()))
v = 1
for i in range(n):
	w = v * a[i]
	if i >= k:
		w /= a[i-k]
		print('Yes' if v < w else 'No')
	v = w

Submission status: Time Limit Exceeded

Solution code:
import sys, math, itertools, collections, bisect 
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n, k = map(int, input().split())
A = list(map(int, input().split()))
for i in range(k-1, n):
    #print(A[i])
    now = 1
    for j in range(k):
        now *= A[i-j]
    if i == k-1:
        before = now
    else:
        #print(now, before)
        if before < now:
            print("Yes")
        else:
            print("No")
        before = now

Submission status: Time Limit Exceeded

Solution code:
N,K=map(int,input().split())
A=list(map(int,input().split()))
s=1
for x in range(K):
  s*=A[x]
B=[]
for y in range(N-K):
  B.append(s)
  s=(s//A[y])*A[K+y]
B.append(s)
for z in range(N-K):
  if B[z]<B[z+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
    for j in range(i-K, i):
        Score_list[i] *= A_list[j]
    if i > K:
        if Score_list[i] > Score_list[i-1]:
            print("Yes")
        else:
            print("No")

# print(Score_list)

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]
text=""
for i in range(K,N):
    if A[i]>A[i-K] :
        text+="Yes\n"
    else:
       text+="No\n"
print("{}".format(text))

Submission status: Time Limit Exceeded

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

old = 0

for i in range(k,n+1):
  new=1
  for j in range(i-k,i):
    new*=a[j]
  if i != k:
    if new > old:
      print("Yes")
    else:
      print("No")
  old = new

Submission status: Time Limit Exceeded

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

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()

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


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

score = 1
for i in range(k):
  score *= arr[i]

s = 0

for i in range(k, n):
  tmp = score * arr[i] // arr[s]
  if tmp > score:
    print("Yes")
  else:
    print("No")
  score = tmp
  s += 1

Submission status: Time Limit Exceeded

Solution code:
"""
    こんにちは。これはクシャルです
    
    Author : thekushalghosh (クシャル)
    Team   : CodeDiggers
 
    I prefer Python language over the C++ language :p :D
        
    Visit my website : thekushalghosh.github.io
"""
import sys,math,cmath,time,itertools
start_time = time.time()
##########################################################################
################# ---- THE ACTUAL CODE STARTS BELOW ---- #################
    
def solve():
    n,k = invr()
    a = inlt()
    q = 1
    for i in range(len(a)):
        if i < k:
            q = q * a[i]
        else:
            w = q * a[i] // a[i - k]
            if w > q:
                qw = "Yes"
            else:
                qw = "No"
            print(qw)
            q = w
    
################## ---- THE ACTUAL CODE ENDS ABOVE ---- ##################
##########################################################################
 
def main():
    global tt
    if not ONLINE_JUDGE:
        sys.stdin = open("input.txt","r")
        sys.stdout = open("output.txt","w")
    t = 1
    for tt in range(t):
        solve()
    if not ONLINE_JUDGE:
        print("Time Elapsed :",time.time() - start_time,"seconds")
        sys.stdout.close()
    
#---------------------- USER DEFINED INPUT FUNCTIONS ----------------------#
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    return(input().strip())
def invr():
    return(map(int,input().split()))
 
#------------------ USER DEFINED PROGRAMMING FUNCTIONS ------------------#
def counter(a):
    q = [0] * max(a)
    for i in range(len(a)):
        q[a[i] - 1] = q[a[i] - 1] + 1
    return(q)

def counter_elements(a):
    q = dict()
    for i in range(len(a)):
        if a[i] not in q:
            q[a[i]] = 0
        q[a[i]] = q[a[i]] + 1
    return(q)

def string_counter(a):
    q = [0] * 26
    for i in range(len(a)):
        q[ord(a[i]) - 97] = q[ord(a[i]) - 97],1
    return(q)
 
def factors(n):
    q = []
    for i in range(1,int(n ** 0.5) + 1):
        if n % i == 0: q.append(i); q.append(n // i)
    return(list(sorted(list(set(q)))))
 
def prime_factors(n):
    q = []
    while n % 2 == 0: q.append(2); n = n // 2
    for i in range(3,int(n ** 0.5) + 1,2):
        while n % i == 0: q.append(i); n = n // i
    if n > 2: q.append(n)
    return(list(sorted(q)))

def transpose(a):
    n,m = len(a),len(a[0])
    b = [[0] * n for i in range(m)]
    for i in range(m): 
        for j in range(n): 
            b[i][j] = a[j][i]
    return(b)

#-----------------------------------------------------------------------#
        
  
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
    input = sys.stdin.readline
main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
import sys
import numpy

YES = "Yes"
NO = "No"

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

scores = [0] * K
pre = 0
for i in range(N):
    scores[i % K] = A[i]
    cur = numpy.prod(scores)

    if i >= K:
        if cur > pre:
            print(YES)
        else:
            print(NO)
    pre = cur

Submission status: Time Limit Exceeded

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

    flag = 0
    for i in range(K, N):
        if flag==0:
            mae = 1
            for j in range(i-K, i-1):
                mae = mae * A[j]
            ato = mae / A[i-K] * A[i]
            flag=1
        else:
            ato = mae / A[i-K] * A[i]

        if mae < ato:
            print("Yes")
        else:
            print("No")
        
        mae = ato

Submission status: Time Limit Exceeded

Solution code:
import collections
d = collections.deque()

N, K = map(int, input().split())
A = [int(i) for i in input().split()]
for _ in range(K):
    d.append(A[_])


for i in range(K,N):
    sum_1 = sum(d)
    d.popleft()
    d.append(A[i])
    sum_2 = sum(d)
    if sum_1 < sum_2: print('Yes')
    else: print('No')

Submission status: Time Limit Exceeded

Solution code:
terms = [int(i) for i in input().split(" ")]
scores = [int(i) for i in input().split(" ")]

N = terms[0]
K = terms[1]

baseScore = 1

for i in range(K):
    baseScore *= scores[i]

tempScore = 1
for i in range(K,N):
    for j in range(K):
        tempScore *= scores[i - j]
    if tempScore > baseScore:
        print('Yes')
    else:
        print('No')
    baseScore = tempScore
    tempScore = 1

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, 1):
    prev = score;
    score /= A[i-K];
    score *= A[i];
    if prev < score:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

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

prev = 1
curr = 1
prev_a = []
for i in range(n):
    prev_a.append(alist[i])
    prev = curr
    curr *= alist[i]
    if i >= k:
        curr /= prev_a.pop(0)
        curr = int(curr)
        if prev < curr:
            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 = [0] * (n - k + 1)
for i in range(n - k + 1):
    p = 1
    for j in range(i, i + k):
        p *= a[j]
    s[i] = p
for i in range(n - k):
    print('Yes' if s[i] < s[i + 1] else 'No')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split())
l=list(map(int,input().split()))
dp=[0]*(n)
m=1
for i in range(n):
    dp[i]=m*l[i]
    m*=l[i]
x=[dp[k-1]]
j=0
m=1

for i in range(k,n):
    
    x.append(dp[i]//dp[i-k])
    if x[-1]>x[-2]:
        print("Yes")
    else:
        print("No")
    j+=1

Submission status: Time Limit Exceeded

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

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

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

for t in range(1,len(test)):
  if test[t-1] < test[t]:
    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=[0]*(n-k+1)
r=1
for i in range(k):
    r=r*a[i]
ans[0]+=r
for i in range(1,n-k+1):
    ans[i]+=(ans[i-1]*a[i+k-1])//a[i-1]
for j in range(1,n-k+1):
    if ans[j]>ans[j-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()))
B = []
a = 1
for i in range(K):
    a *= A[i]
B.append(a)
for i in range(N - K):
    a //= A[i]
    a *= A[K + i]
    B.append(a)
    ans = 'No'
    if a > B[i]:
        ans = 'Yes'
    print(ans)

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):
  point_con = 1
  for j in range(i - k + 1, i + 1):
    point_con *= lst[j]
  if i != k - 1:
    if point_con > point_pre:
      print('Yes')
    else:
      print('No')
  point_pre = point_con

Submission status: Time Limit Exceeded

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

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

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

    conf = tmp

Submission status: Time Limit Exceeded

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

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):
    a=1
    b=1
    for j in range(K):
        a*=A[i-K+j]
        b*=A[i-K+j+1]
    if a<b: 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(n):
    if i < k:
        score *= a[i]
    else:
        pre = score
        score = score//a[i-k]*a[i]
        if score > pre:
            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()))

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

Submission status: Time Limit Exceeded

Solution code:
#n=int(input())
n,k=map(int,input().split())
l=list(map(int,input().split()))
mul=1
for i in range(k):
  mul=mul*l[i]
z=mul
j=0
for i in range(k,n):
  z=z//l[j]
  z=z*l[i]
  if z>mul:
    print('Yes')
  else:
    print('No')
  j+=1
  mul=z

Submission status: Time Limit Exceeded

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

prod = [1] * (n + 1)
prod[1] = A[0]
for i in range(2, n + 1):
    prod[i] = prod[i - 1] * A[i - 1]

pre_score = prod[k]

for i in range(k + 1, n + 1):
    score = prod[i] // prod[i - k]
    if score > pre_score:
        print('Yes')
    else:
        print('No')
    pre_score = score

Submission status: Time Limit Exceeded

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


for gakki in range(k+1,n+1):
    pre = A[gakki-k-1:gakki-1]
    #pre_ = 1
    #for p in pre:
        #pre_ *= p

    
    k_gakki = A[gakki-k:gakki]
    #k_gakki_ = 1
    #for ga in k_gakki:
        #k_gakki_ *= ga
    
    #if pre_ < k_gakki_:
    if pre[0] < k_gakki[-1]:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

Solution code:
def main():
    n, k = [int(x) for x in input().split()]
    scores = [int(x) for x in input().split()]
    former = 0
    rank = 1
    for score in scores[:k]:
        rank *= score

    for shift in range(n - k):
        former = rank
        rank //= scores[shift]
        rank *= scores[shift + k]
        if former < rank:
            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):
    if i>=k:
        c1 = 1
        c2 = 1
        for j in range(i-k+1,i+1):
            c1 *= a[j]
            c2 *= a[j-1]
        if c1>c2:
            print("Yes")
        else:
            print("No")