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:
# coding: utf-8
import sys
from math import log


def change_into_int(lists):
    tmps = lists.split(' ')
    num_list = []
    for n in tmps:
        num_list.append(int(n))
    return num_list


def create_result(one_list):
    ans = 0
    for n in one_list:
        ans = ans + log(n)
    return ans


def create_lists(data, point):
    num_lists = []
    flag = 0
    count = 0
    while(flag == 0):
        tmp_list = []
        for i in range(point):
            tmp_list.append(data[i+count])
            # print(i+count)
            if i+count == len(data)-1:
                flag = 1
        count = count + 1
        ans = create_result(tmp_list)
        num_lists.append(ans)
    return num_lists


if __name__ == "__main__":
    lines = []
    result_list = []
    # 入力
    for l in sys.stdin:
        lines.append(l.rstrip('\r\n'))
    # int
    num1 = change_into_int(lines[0])
    data = change_into_int(lines[1])
    # k個分のlistを作成
    # [2,3,4,5,6]
    # [[2,3],[3,4], ...]
    result_list = create_lists(data, num1[1])
    # # 取り出して積つくる
    # for one_list in lists:
    #     result_list.append(create_result(one_list))
    # 判断
    for n in range(len(result_list)-1):
        if result_list[n] < result_list[n+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()))

for i in range(n-k):
  pre = 1
  now = 1
  for j in range(k):
    pre *= A[i+j]
    now *= A[i+j+1]
  if pre < now:
    print("Yes")
  else:
    print("No")

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
import sys


def change_into_int(lists):
    tmps = lists.split(' ')
    num_list = []
    for n in tmps:
        num_list.append(int(n))
    return num_list


def create_result(one_list):
    ans = 1
    for n in one_list:
        ans = ans * n
    return ans


def create_lists(data, point):
    num_lists = []
    flag = 0
    count = 0
    while(flag == 0):
        tmp_list = []
        for i in range(point):
            tmp_list.append(data[i+count])
            # print(i+count)
            if i+count == len(data)-1:
                flag = 1
        count = count + 1
        ans = create_result(tmp_list)
        num_lists.append(ans)
    return num_lists


if __name__ == "__main__":
    lines = []
    result_list = []
    # 入力
    for l in sys.stdin:
        lines.append(l.rstrip('\r\n'))
    # int
    num1 = change_into_int(lines[0])
    data = change_into_int(lines[1])
    # k個分のlistを作成
    # [2,3,4,5,6]
    # [[2,3],[3,4], ...]
    result_list = create_lists(data, num1[1])
    # # 取り出して積つくる
    # for one_list in lists:
    #     result_list.append(create_result(one_list))
    # 判断
    for n in range(len(result_list)-1):
        if result_list[n] < result_list[n+1]:
            print("Yes")
        else:
            print("No")

Submission status: Time Limit Exceeded

Solution code:
#testC
import numpy as np
if __name__=="__main__":
  n, k = map(int, input().split())
  score = list(map(int, input().split()))
  final_score = []
  for i in range(n):
    if i >= k-1:
      tmp = 1
      for j in np.arange(i-k+1, i+1)[::-1]:
        tmp *= score[j]
      final_score.append(tmp)
  for i in range(1, len(final_score)):
    if final_score[i] > final_score[i-1]:
      print("Yes")
    else:
      print("No")

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
import sys
from math import log


def change_into_int(lists):
    tmps = lists.split(' ')
    num_list = []
    for n in tmps:
        num_list.append(int(n))
    return num_list


def create_result(one_list):
    ans = 0
    for n in one_list:
        ans = ans + log(n)
    return ans

            
def create_lists(data, point):
    num_lists = []
    flag = 0
    count = 0
    while(flag == 0):
        tmp_list = []
        for i in range(point):
            tmp_list.append(data[i+count])
            # print(i+count)
            if i+count == len(data)-1:
                flag = 1
        count = count + 1
        num_lists.append(tmp_list)
    return num_lists


if __name__ == "__main__":
    lines = []
    result_list = []
    for l in sys.stdin:
        lines.append(l.rstrip('\r\n'))

    num1 = change_into_int(lines[0])
    data = change_into_int(lines[1])
    lists = create_lists(data, num1[1])
    for one_list in lists:
        result_list.append(create_result(one_list))

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

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
import sys


def change_into_int(lists):
    tmps = lists.split(' ')
    num_list = []
    for n in tmps:
        num_list.append(int(n))
    return num_list


def create_result(one_list):
    ans = 1
    for n in one_list:
        ans = ans * n
    return ans

            
def create_lists(data, point):
    num_lists = []
    flag = 0
    count = 0
    while(flag == 0):
        tmp_list = []
        for i in range(point):
            tmp_list.append(data[i+count])
            # print(i+count)
            if i+count == len(data)-1:
                flag = 1
        count = count + 1
        num_lists.append(tmp_list)
    return num_lists


if __name__ == "__main__":
    lines = []
    result_list = []
    for l in sys.stdin:
        lines.append(l.rstrip('\r\n'))

    num1 = change_into_int(lines[0])
    data = change_into_int(lines[1])
    lists = create_lists(data, num1[1])
    for one_list in lists:
        result_list.append(create_result(one_list))

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

Submission status: Time Limit Exceeded

Solution code:
# 1行目
p_str=input().split()
(N,K)=[int(n) for n in p_str]
# 2行目
p_str=input().split()
p_int=[int(n) for n in p_str]
(A,B)=(1,1)
for i in range(N-K):
  (A,B)=(1,1)
  for j in range(K):
    B += p_int[i+j]
  for j in range(K):
    A += p_int[i+j+1]
#  print(B,A,i)
  if B < A :
    print("Yes")
  else:
    print("No")

Submission status: Time Limit Exceeded

Solution code:
# 1行目
p_str=input().split()
(N,K)=[int(n) for n in p_str]
# 2行目
p_str=input().split()
p_int=[int(n) for n in p_str]
(A,B)=(1,1)
for i in range(N-K):
  (A,B)=(1,1)
  for j in range(K):
    B *= p_int[i+j]
  for j in range(K):
    A *= p_int[i+j+1]
#  print(B,A,i)
  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()))
hyoukaL = []

hyouka = 1
for q in range(K):
    hyouka *= A[K-1-q]
hyoukaL += [hyouka]

for p in range(K+1,N+1):
    hyouka = (hyouka//A[p-K-1])*A[p-1]
    hyoukaL += [hyouka]


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

Submission status: Time Limit Exceeded

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

for p in range(K-1,N):
    hyouka = 1
    for q in range(K):
        hyouka *= A[p-q]
    hyoukaL += [hyouka]

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

Submission status: Time Limit Exceeded

Solution code:
n, k = map(lambda x: int(x), input().split())
list_a =  list(map(lambda x: int(x), input().split()))

score = 1
for each in list_a[0:k]:
    score *= each
    
for i, next_score in enumerate(list_a[k:]):
    score_before = score
    score = score_before * next_score / list_a[i]
    if score > score_before:
        print('Yes')
        continue
    print('No')

Submission status: Time Limit Exceeded

Solution code:
n, k = map(lambda x: int(x), input().split())
list_a =  list(map(lambda x: int(x), input().split()))


scores = list_a[0:k]
score_first_time = list_a
score = 1
for each in scores:
    score *= each
    
for i, next_score in enumerate(list_a[k:]):
    score_before = score
    score = score_before * next_score / list_a[i]
    if score > score_before:
        print('Yes')
        continue
    print('No')

Submission status: Time Limit Exceeded

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

def main():
    n,k = map(int, input().split())
    A = list(map(int, input().split()))
    
    score = 1
    for a in A[:k]:
        score*=a
    
    for i in range(k,n):
        tmp_score = score//A[i-k] * A[i]
        if tmp_score > score:
            print("Yes")
        else:
            print('No')
        score = tmp_score
main()

Submission status: Time Limit Exceeded

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

def main():
    n,k = map(int, input().split())
    A = list(map(int, input().split()))
    
    scores= []
    score = 1
    for a in A[:k]:
        score*=a
    scores.append(score)
    
    for i in range(k,n):
        score = score//A[i-k] * A[i]
        scores.append(score)
    
    for i in range(n-k):
        if scores[i] < scores[i+1]:
            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()))

sei=[1]*2
b=1
for i in a[:k]:
  sei[0] *= i
for i, j in zip(a[:n-k], a[k:]):
  sei[1] = sei[0] / i * j

  if sei[0]<sei[1]:
    print("Yes")
  else:
    print("No")
  sei[0]=sei[1]

Submission status: Time Limit Exceeded

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

sei=[1]*2
b=1
for i in range(k):
  sei[0]*=a[i]
for i in range(n-k):
  sei[1]=sei[0]/a[i]*a[i+k]

  if sei[0]<sei[1]:
    print("Yes")
  else:
    print("No")
  sei[0]=sei[1]

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
# O(n) solution (Accepted)
# Author : code_marshal

n, k = map(int, input().split())
a = list(map(int, input().split()))
m, j = 1, 0
for i in range(n):
    m*=a[i]
    if i>=k:
        n = m//a[i]
        m//=a[j]
        j+=1
        if n<m: print('Yes')
        else: print('No')

Submission status: Time Limit Exceeded

Solution code:
# O(n) solution (Accepted)
# Author : code_marshal

n, k = map(int, input().split())
a = list(map(int, input().split()))
l, m, j = [], 1, 0
for i in range(n):
    l.append(a[i])
    m*=a[i]
    if i>=k:
        n = m//a[i]
        m//=l[j]
        j+=1
        if n<m: print('Yes')
        else: print('No')

Submission status: Time Limit Exceeded

Solution code:
# O(n) solution (Accepted)
# Author : code_marshal

n, k = map(int, input().split())
a = list(map(int, input().split()))
l, m = [], 1
for i in range(n):
    l.append(a[i])
    m*=a[i]
    if i>=k:
        n = m//a[i]
        m//=l.pop(0)
        if n<m: print('Yes')
        else: print('No')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

evaluation = 1

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

for i in range(k, n+1):
    if i == n:
        break
    #print(a[i], a[i-k])
    next_evaluation = a[i]*evaluation//a[i-k]
    if evaluation < next_evaluation:
        print('Yes')
    else:
        print('No')
    evaluation = next_evaluation

Submission status: Time Limit Exceeded

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

i = n - k
score_prev = 1
for i in range(k):
    score_prev *= A[i]
#print(score_prev)
for i in range(k, n):
    score_now = score_prev*A[i]//A[i-k]
#    print(score_now)
    if score_now > score_prev:
        print('Yes')
    else:
        print('No')
    score_prev = score_now

Submission status: Time Limit Exceeded

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

B = [1] * (N+1)
B[1] = A[0]

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

for i in range(K+1, N+1):
    if B[i-1]/B[i-1-K] < B[i]/B[i-K]:
        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, A[0]]

for i in range(2, N+1):
    B.append(B[i-1]*A[i-1])

for i in range(K+1, N+1):
    if B[i-1]/B[i-1-K] < B[i]/B[i-K]:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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

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

wk = 1
li_answer = list()
for idx, v in enumerate(li_a):
    prev = wk
    if idx <= (k - 1):
        wk = wk * v
    else:
        wk = wk * v // li_a[idx - k]
        if prev >= wk:
            print('No')
        else:
            print('Yes')

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

Submission status: Time Limit Exceeded

Solution code:
from functools import reduce

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

# 評点計算

# s[0]~s[k-2]まで0埋め
s = [0 for _ in range(k-1)]

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

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

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

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):
	next = prev // A[i-K] * A[i]
	print('Yes' if next > prev else 'No')
	prev = next

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a,b=map(int,input().split())
k=list(map(int,input().split()))
aa=k[:b]
gou=1
while aa:
  gou*=aa.pop()
for i in range(1,a-b+1):
  goub=(gou/k[-1+i])*k[b+i-1]
  #print(gou,goub)
  if gou<goub:
    print("Yes")
  else:
    print("No")
  gou=goub

Submission status: Time Limit Exceeded

Solution code:
a,b=map(int,input().split())
k=list(map(int,input().split()))
aa=k[:b]
gou=1
while aa:
  gou*=aa.pop()
for i in range(1,a-b+1):
  c=k[i:b+i]
  goub=1
  while c:
    goub*=c.pop()
  if gou<goub:
    print("Yes")
  else:
    print("No")
  gou=goub

Submission status: Time Limit Exceeded

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

# 評点計算
# s[i-1]: i学期の評点
s = [0 for _ in range(k)]
for i in range(n - k + 1):
    p = 1
    for j in range(k):
        p *= a[i + j]
    s.append(p)

# 出力
for i in range(n - k):
    print("Yes" if s[k + i + 1] > s[k + i] else "No" )

Submission status: Time Limit Exceeded

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

ans = [1] * (N-K+1)

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

for j in range(1,N-K+1):
    ans[j] = ans[j-1] * A[j+K-1] / A[j-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 = [1]+list(map(int,input().split()))
 
for i in range(1,N+1):
  A[i] = A[i-1]*A[i]
 
for i in range(K+1, N+1):
  prev = A[i-1] // A[i-K-1]
  now = A[i] // A[i-K]
  if now > 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()))
prev = 1
for i in range(K):
  prev *= A[i]

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

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin, stdout, setrecursionlimit
from collections import deque, defaultdict, Counter
from heapq import heappush, heappop
import math

rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()	
rli = lambda: map(int, stdin.readline().split())
rlf = lambda: map(float, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')

def main():
	n, k = rli()
	A = list(rli())
	prev, score = 1, 1
	for i, a in enumerate(A):
		prev = score
		score *= a 
		if i >= k:
			score //= A[i-k]
			if score > prev:
				print("Yes")
			else:
				print("No")
	stdout.close()

if __name__ == "__main__":
	main()

Submission status: Time Limit Exceeded

Solution code:
def main():
    N, K = input_ints()
    A = input_int_list_in_line()

    hyouten = 1

    for i in range(K):
        hyouten *= A[i]
    
    for i in range(N-K):
        new_hyouten = hyouten / A[i] * A[i+K]

        if hyouten < new_hyouten:
            print('Yes')
        else:
            print('No')
        
        hyouten = new_hyouten



def input_ints():
    line_list = input().split()

    if len(line_list) == 1:
        return int(line_list[0])
    else:
        return map(int, line_list)


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


def input_int_tuple_list(n: int):
    return [tuple(map(int, input().split())) for _ in range(n)]


main()

Submission status: Time Limit Exceeded

Solution code:
N,K = map(int, input().split())
A = list(map(int, input().split()))
num = 1
data = []
for j in range(N-K+1):
    for t in range(j, j+K):
        num = num*A[t]
    data.append(num)
    num = 1
num = 1
for i in range(0, N - K):
    if data[num] > data[num - 1]:
        print("Yes")
    elif data[num] <= data[num - 1]:
        print("No")
    num+=1

Submission status: Time Limit Exceeded

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

ans = [0]*(n-k+1)
ans[0] = sum(a[0:k])
for i in range(1,n-k+1):
    ans[i] = sum(a[i:k+i])
    if ans[i-1] < ans[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()))

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

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

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

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:
from functools import reduce
from operator import mul

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

p_score = reduce(mul, a[:k])
answers = []
for i in range(k, n):
    answers.append(a[i-k] < a[i])
for ans in answers:
    if ans:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
from functools import reduce
from operator import mul

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

p_score = reduce(mul, a[:k])
scores = [p_score]
for i in range(k, n):
    score = scores[-1]/a[i-k]*a[i]
    scores.append(score)
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=list(map(int, input().split()))

sei=[1]*2
cou=0
while True:
  if cou==n-k:
    break
  for i in range(cou,cou+k):
    sei[0]*=a[i]
    sei[1]*=a[i+1]
  if sei[0]<sei[1]:
    print("Yes")
    sei=[1]*2
  else:
    print("No")
    sei=[1]*2
  cou+=1

Submission status: Time Limit Exceeded

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

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

#print(score)
for i in range(1,n-k+1):
    if score[i-1] < score[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()))

score = 1

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

for j in range(k,n):
    score_before = score
    score =  score * a[j] // a[j-k]
    #print('score_befor',score_before)
    #print('score',score)
    if score_before < score:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3

from pprint import pprint
from collections import deque, defaultdict
import itertools
import math
import sys

sys.setrecursionlimit(10 ** 6)
INF = float('inf')


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

s = [1] * (N+1)
for i in range(N):
    s[i+1] = s[i] * A[i]
# pprint(s)

prev = s[K]
for i in range(K+1, N+1):
    # print(f'i = {i}')
    # print(f's[i] = {s[i]}, s[i-K] = {s[i-K]}')
    score = s[i] // s[i-K]
    # print(f'score = {score}')
    if prev < score:
        print('Yes')
    else:
        print('No')
    prev = score

Submission status: Time Limit Exceeded

Solution code:
a,b=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]
l=[]
for i in range(0,(a-b)+1):
    p=1
    for j in range(i,i+b):
        p=p*c[j]
    l.append(p)
    if(len(l)==1):
        pass
    else:
        if(l[len(l)-1]>l[len(l)-2]):
            print('Yes')
        else:
            print('No')

Submission status: Time Limit Exceeded

Solution code:
a,b=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]
l=[]
for i in range(0,(a-b)+1):
    p=1
    for j in range(i,i+b):
        p=p*c[j]
    l.append(p)
for i in range(1,len(l)):
    if(l[i]>l[i-1]):
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

Solution code:

n, k = [int(x) for x in input().strip().split()]
arr = [int(x) for x in input().strip().split()]

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

for i in range(k, len(arr)):
    curr = (last*arr[i])//arr[i-k]
    if curr>last:
        print('Yes')
    else:
        print('No')
    last= curr

Submission status: Time Limit Exceeded

Solution code:
tmp = (input().split(' '))
n = int(tmp[0])
k = int(tmp[1])
tmp = input().split(' ')
grades = []
for i in range(len(tmp)):
  grades.append(int(tmp[i]))
  
curr_res = grades[0]
prev_res = grades[0]

for i in range(1,k):
  curr_res = curr_res * grades[i]
  
j = k
while j < n:
  prev_res = curr_res
  curr_res = curr_res/grades[j-k]
  curr_res = curr_res*grades[j]
  if curr_res > prev_res:
    print('Yes')
  else:
    print('No')
  j+=1

Submission status: Time Limit Exceeded

Solution code:
from functools import reduce
from operator import mul

N,K,*A = map(int,open(0).read().split())
base = reduce(mul,A[:K])
for i in range(K,N):
    score = base // A[i-K] * A[i]
    print("Yes" if base < score else "No")
    base = score

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

dictS={}
dictS[0]=1

for n in range (1,N+1):
    if n-1<K:
        dictS[n]=A[n-1]*dictS[n-1]
    else:
        dictS[n]=A[n-1]*dictS[n-1]/A[n-1-K]

    if n>K:
        if dictS[n]>dictS[n-1]:
            print('Yes')
        else:
            print('No')

Submission status: Time Limit Exceeded

Solution code:
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations

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

    cumprod = []

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

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
import sys
read = sys.stdin.readline
import time
import math
import itertools as it
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()
# ------------------------------

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

# -----------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)

Submission status: Time Limit Exceeded

Solution code:
for _ in range(1):
    n,m = map(int,input().split())
    l = list(map(int,input().split()))
    ans = 1
    for i in range(m):
        ans = ans*l[i]
        
    for i in range(m,n):
        ans1 = ans*l[i]//l[i-m]
        if(ans<ans1):
            print('Yes')
        else:
            print('No')
        ans = ans1

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split(' '))
a = [int(tmp) for tmp in input().split(' ')]
point = 1

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

for i in range(n - k):
    f_point = point // a[i] * a[k+i]
    if point < f_point:
        print('Yes')
    else:
        print('No')
    
    point = f_point

Submission status: Time Limit Exceeded

Solution code:
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations

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

    tmp = 1

    for i in range(N):
        prev_tmp = tmp
        tmp *= A[i]

        if i > K - 1:
            tmp //= A[i-K]

            if tmp > prev_tmp:
                print('Yes')
            else:
                print('No')

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int,input().split())
A = [int(i) for i in input().split()]
scores = []
hyotei = 1

for i in range(0,n-k+1):
    for j in range(i,i+k):
        hyotei *= A[j]
    scores.append(hyotei)
    hyotei = 1
    
for i in range(n-k):
    if scores[i+1]>scores[i]:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations

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

    eval = []
    tmp = 1

    for i in range(N):
        tmp *= A[i]

        if i >= K - 1:
            eval.append(tmp)
            tmp //= A[i-(K-1)]
    
    for i in range(1, len(eval)):
        if eval[i] > eval[i-1]:
            print('Yes')
        else:
            print("No")

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
from functools import reduce
import operator

n, k = map(int, input().split())
a = list(map(int, input().split()))
cnt, precnt = 0, reduce(operator.mul, a[:k])

for i in range(1, n-k+1):
    cnt = reduce(operator.mul, a[i:k+i])
    if cnt > precnt:
        print("Yes")
    else:
        print("No")
    precnt = cnt

Submission status: Time Limit Exceeded

Solution code:
from operator import mul
from functools import reduce
n, k = map(int, input().split())
A = list(map(int, input().split()))
before = reduce(mul, A[:k])

for i in range(1, n-k+1):
    tmp = reduce(mul, A[i:k+i])
    if tmp > before:
        print("Yes")
    else:
        print("No")
    before = tmp