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: Wrong Answer

Solution code:
n,k = map(int,input().split())
a = list(input().split())
count = 0
tmp = 1
check = []
for _ in range(n - k + 1):
    for i in range(k):
        tmp *= int(a[i + count])
    check.append(tmp)
    tmp = 1
    count += 1
print(check)

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

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
A = list(map(int, input().split()))
#N,K=5 ,3
#A=[96, 98, 95, 100, 20]
ten=[0]*(N-K+1)
a=200000*(10**9)
#for i in range(K):
 #   a*=A[i]
#print(a)   
ten[0]=a
for i in range(1,(N-K+1)):
    ten[i]=ten[i-1]*(A[K+i-1]/A[i-1])
#print(ten)
for i in range(1,N-K+1):
    #print(ten[i])
    if ten[i]>ten[i-1]:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
import itertools
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

N,K = MI()

A = LI()

multi = {}
for j in range(N-K+1, N+1):
    target = A[j-K:j]
    ans = 1
    for t in target:
        ans = ans * t
    multi[j] = ans

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

lastScore = 0
for i in range(0,N):
    if (i >= K):
        score = 1
        for j in range(0,K):
            score *= A[i-j]
        if (lastScore < score):
            print("Yes")
        else:
            print("No")

        lastScore = score

Submission status: Wrong Answer

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

score = 0
for i in range(len(A)-K+1):
    if i >= 1:
        if score >= np.prod(A[i:K+i]):
            print("No")
        else:
            print("Yes")
    score = np.prod(A[i:K+i])

Submission status: Wrong Answer

Solution code:
import numpy as np

n, k = map(int, input().split())
a = [int(x) for x in input().split()]

result = [0]*n

for i in range(k-1, n):
    result[i] = np.prod(a[i-k+1:i+1])

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

Submission status: Wrong Answer

Solution code:
import numpy

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

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

tempScore = []
scoreSet = []

for i in range(N-K+1):
    for j in range(K):
        tempScore.append(scores[j+i])
    scoreSet.append(tempScore)
    tempScore = []

scoreSet = numpy.prod(scoreSet, axis = 1)

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

Submission status: Wrong Answer

Solution code:
import numpy as np
n, k = map(int, input().split())
a = list(map(int, input().split()))
eva = []
eva.append(np.prod(a[:k]))
for i in range(n-k):
    p = eva[i]//a[i]
    p *= a[k+i]
    eva.append(p)
# print(eva)
for i in range(n-k):
    # print(eva[i])
    if eva[i+1] > eva[i]:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

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

now = 0
pre = 0
for i in range(0,n[1]):
    now += a[i]

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

Submission status: Wrong Answer

Solution code:
def main():
    N, K = map(int, input().split())
    As = list(map(int, input().split()))
    hyouka = [0]*(N-K+1)
    kekka = 1
    for i in range(N-K+1):
        if i == 0:
            for j in As[i:i+K]:
                kekka *= j
                hyouka[i]=kekka
        else:
            kekka = kekka/As[i-1]*As[i+K-1]
            hyouka[i]=int(kekka)
    print(hyouka)
    for j in range(len(hyouka)):
        if j>0:
            if hyouka[j] > hyouka[j-1]:
                print('Yes')
            else:
                print("No")

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import numpy as np
n, k = map(int, input().split())
A = list(map(int, input().split()))
A = np.array(A)

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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
N, K = map(int, sys.stdin.readline().split())
A = list(map(int, sys.stdin.readline().split()))
DP = [1] * (2 * 10 ** 6)
DP[K - 1] = np.prod(A[0:K])

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

Submission status: Wrong Answer

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

num = 1
for i in range(k):
	num *= arr[i]
res = [num]
f = True
for i in range(k,n):
	num *= arr[i]
	num //= arr[k-i]
	res.append(num)
	if res[-1] <= res[-2]:
		print("No")
	else:
		print("Yes")

Submission status: Wrong Answer

Solution code:
#3

n, k = map(lambda x: int(x), input().split())
list_a =  list(map(lambda x: int(x), input().split()))
list_score = []

for i in range(n):
    if i < k - 1:
        continue
    list_score.append(sum(list_a[i-2:i+1])/k)
# print(list_score)

score_before = list_score[0]
for score in list_score[1:]:
    if score_before < score:
        print('Yes')
        score_before = score
        continue
    print('No')
    score_before = score

Submission status: Wrong Answer

Solution code:
import numpy as np
n, k=map(int, input().split())
plist = list(map(int, input().split()))
last = 0
point = 1
ans = []
while k <= len(plist):
  point = np.prod(plist[:k])
  if last > 0:
    if point > last:
      print("Yes")
    else:
      print("No")
  last = point
  del plist[0]

Submission status: Wrong Answer

Solution code:
import numpy as np
n,k=map(int,input().split())
a=list(map(int,input().split()))
s=np.prod(a[:k])

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

Submission status: Wrong Answer

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

for i in range(k,n+1):
    for j in range(i-k,k):
        result = result * a[j]
    if bkresult == 0:
        bkresult = 0
    elif bkresult < result:
    	print("Yes")
    else:
	    print("No")
    bkresult = result
    result = 1

Submission status: Wrong Answer

Solution code:
import numpy as np
N, K = map(int, input().split())
A = list(map(int, input().split()))
A = np.array(A)

for i in range(0, N - K):
    before = A[i:i+K].prod()
    after = A[i+1:i+1+K].prod()

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

Submission status: Wrong Answer

Solution code:
import numpy as np
n, k=map(int, input().split())
plist = list(map(int, input().split()))
last = 0
point = 1
ans = []
while k <= len(plist):
  point = np.prod(plist[:k])
  print(point)
  if last > 0:
    if point > last:
      print("Yes")
    else:
      print("No")
  last = point
  del plist[0]

Submission status: Wrong Answer

Solution code:
import numpy as np

N, K = map(int, input().split())
points = np.array(list(map(int, input().split())))

# まずK回分の演算結果をリストに入れる
hyotens = []
for i in range(N - K + 1):
    hyotens.append(np.prod(points[i:i+K]))

# リストを１つずつ差分比較し、YesNoを出力する(ループ)
for j in range(len(hyotens) - 1):
    if hyotens[j] < hyotens[j+1]:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#M-SOLUTIONS C
import numpy as np
n, k = map(int, input().split())
a = list(map(int, input().split()))
temp1 = 0
temp2 = 0
for i in range(n-k+1):
  if 0 in a[i:k+1]:
    print('No')
  else:
    temp2 = np.prod(a[i:k+i])
    if i > 0:
      if temp2 > temp1:
        print('Yes')
      else:
        print('No')
  temp1 = temp2

Submission status: Wrong Answer

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

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

t = 0
s = 1
k_k = k
temp = []
while k != n+1:
  for i in range(t, k):
    alpha = a[i]
    s = s * alpha
  temp.append(s)
  k = k + 1
  t = t + 1
  s = 1
print(k)

for i in range(0, k_k-1):
  t_s = temp[i]
  t_t = temp[i+1]
  if t_s < t_t:
    print("Yes")
  else:
    print("No")

Submission status: Wrong Answer

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

input = sys.stdin.readline

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

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

pre = np.prod(A[:k])


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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python
# -*- coding: UTF-8 -*-

import sys


def get_ints():
    return map(int, sys.stdin.readline().strip().split())


def std_in():
    return sys.stdin.readline().strip()


def calc_score(a, f, e):
    score = 1

    for i in range(f, e):
        score *= a[i]
    return score


def main():
    n, k = get_ints()
    a = list(get_ints())

    score = calc_score(a, 0, k)
    print(score)

    for i in range(k, n):
        if a[i-k] == 0:
            n_score = calc_score(a, i-k+1, i+1)
        else:
            n_score = int(score / a[i-k] * a[i])

        if n_score > score:
            print("Yes")
        else:
            print("No")
        score = n_score


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import numpy as np

N, K = map(int, input().split())
A = input().split()
A = [int(s) for s in A]
scores = []

for i in range(N-K+1):
    scores.append(np.prod(A[i:K+i]))

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

Submission status: Wrong Answer

Solution code:
import numpy as np

n,k= map(int,input().split())
a = list(map(int,input().split()))
target = a[0:k]
p = np.prod(target)
for i in range(n-k):
    ans = (p // a[i]) * a[i+k]
    # print(ans)
    if ans > p:
        print("Yes")
    else:
        print("No")
    p = ans

Submission status: Wrong Answer

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

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

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

print(pi)

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

for i in range(N-K):
    x=np.prod(A[i:i+K])
    y=np.prod(A[i+1:i+K+1])
    print('Yes' if x < y else 'No')

Submission status: Wrong Answer

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

t = 1
for i in range(k):
    t *= lis[i]

print(t)

for i in range(k, n):
    tmp = lis[i-(k-1):i+1]
    
    a = 1
    for j in tmp:
        a *= j
    
    if a > t:
        print('Yes')
    else:
        print('No')
    
    t = a
    a = 1

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))
b = []
for i in range(n - k + 1):
  p = 1
  for j in range(k):
    p *= a[i + j]
  b.append(p)
x = 0
tf = True
for i in b:
  if i > x:
    if not(x == 0):
      print("Yes")
    x = i
  else:
    tf = False
    print("No")

Submission status: Wrong Answer

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

for i in range(n):
    if i < k:
        if a[i-k] < a[i]:
            print('Yes')
        else:
            print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np

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

r = np.cumprod(A, dtype='int64')

before = r[K-1]
for i in range(K, N):
    after = before // A[i-K]
    after *= A[i]

    if after > before:
        print('Yes')
    else:
        print('No')

    before = after

Submission status: Wrong Answer

Solution code:
def prod(A):
    ans = 1
    for a in A:
        ans *= a
    return ans


def solve():
    N, K = [int(x) for x in input().split()]
    A = [int(x) for x in input().split()]
    p = prod(A[0:K + 1])
    for i in range(K, N):
        if p / A[i - K] * A[i] > p:
            print('Yes')
        else:
            print('No')
        p /= A[i - K]


if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, k = map(int, input().split())
    a = np.cumprod(list(map(int, input().split())))
    for i in range(k, n):
        if i != k and a[i-1]/a[i-1-k] < a[i]/a[i-k]:
            print('Yes')
        elif i == k and a[i-1] < a[i]/a[i-k]:
            print('Yes')
        else:
            print('No')
    
            
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

prev=1
start = a[0:k]
for i in start:
    prev *= i
ans = []
for i in range(k+1,n+1):
    tmp = a[i-k:i]
    res = 1
    for i in tmp:
        res *= i
    if prev >= res:
        ans.append('No')
    else:
        ans.append('Yes')
        prev = res
print('\n'.join(ans))

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import itertools
from functools import reduce
from collections import deque

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

seiseki = deque([])
seiseki2 = []
for i in range(N):
    seiseki.append(A[i])
    if i == K-1:
        seiseki2.append(reduce(lambda a, b: a * b, seiseki, 1))
    elif i > K - 2:
        seiseki2.append(
            seiseki2[-1] / A[i - (N-K) + 1] * A[i])

zenkai = seiseki2[0]
for i in range(1, N - K+1):
    if seiseki2[i] > zenkai:
        print("Yes")
    else:
        print("No")
    zenkai = seiseki2[i]

Submission status: Wrong Answer

Solution code:
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
import itertools
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

N,K = MI()

A = LI()

result = {}
for i in range(N-K+1, N+1):
    target = A[i-K:i]
    ans = 1
    for t in target:
        ans = ans * t
    result[i] = ans
    if i-1 in result:
        if result[i] > result[i-1]:
            print("Yes")
        else:
            print("No")

Submission status: Wrong Answer

Solution code:
import numpy as np


N, K = map(int, input().split())
A = np.array([1] + list(map(int, input().split())), np.int64)

PA = np.cumprod(A)
ans = []
f = ['No', 'Yes']
for i in range(K + 1, N + 1):
    s = PA[i] // PA[i - K]
    ps = PA[i - 1] // PA[i - K - 1]
    ans.append(f[bool(ps < s)])

print('\n'.join(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import functools
import operator
n,k=map(int,input().split())
a=list(map(int,input().split()))
a1=a[k-1:]
result = functools.reduce(operator.mul, a1)
print(a1)
for i in range(n-k):
    if result<result/a[i]*a[i+k]:
        print('Yes')
    else:
        print('No')
    result=result/a[i]*a[i+k]

Submission status: Wrong Answer

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

p = 0
for i in range(K+1,N+1):
    print(["No","Yes"][p < A[i]])
    p = A[i-K+1]

Submission status: Wrong Answer

Solution code:
import numpy as np

n, k = map(int, input().split())
a = list(map(int, input().split()))
score = [0] * (n+1)

for i in range(k, n+1):
    score[i] = np.prod(a[i-k:i])
    if i == k:
        continue
    print('Yes' if score[i-1] < score[i] else 'No')

Submission status: Wrong Answer

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

for i in range(k, n):
    bef = a[i-1] * a[i-2] * a[i-3]
    cur = a[i] * a[i-1] * a[i-2]
    if cur > bef:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
N,K = map(int,input().split())
A = np.array(list(map(int,input().split())))
A_low = np.prod(A[:K])
A_high = A_low
for i,j in enumerate(range(K,N)):
    A_high = (A_low//A[i])*A[j]
    if(A_high > A_low):
        print('Yes')
    else:
        print('No')
    A_low = A_high

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
A = list(map(int, input().split()))
#N,K=5 ,3
#A=[96, 98, 95, 100, 20]
ten=[0]*(N-K+1)
a=1
#for i in range(K):
 #   a*=A[i]
#print(a)   
ten[0]=a
for i in range(1,(N-K+1)):
    ten[i]=ten[i-1]*(A[K+i-1]/A[i-1])
#print(ten)
for i in range(1,N-K+1):
    #print(ten[i])
    if ten[i]>ten[i-1]:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
from decimal import *
N,K = map(int,input().split())
A = [i*0.0001 for i in list(map(int,input().split()))]
a = 1
for i in range(K):
    a *= A[i]
#print(a)
for i in range(N - K):
    b = a / A[i] * A[i+K]
    #print(b)
    if a < b:
        print("Yes")
    else:
        print("No")
    a = b
#print(a*a*a**10)

Submission status: Wrong Answer

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

res = N - K
last = A[K-3] * A[K-2] * A[K-1]

for i in range(1, res+1):
  mul = A[K+i-3] * A[K+i-2] * A[K+i-1]
  if mul > last:
    print("Yes")
  else:
    print("No")
  last = mul

Submission status: Wrong Answer

Solution code:
import numpy as np

n, k = map(int, input().split())
a = list(map(int, input().split()))
score = [0] * (n+1)

for i in range(k, n+1):
    score[i] = np.prod(a[i-k:i])

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

Submission status: Wrong Answer

Solution code:
N,K=map(int,input().split())
A=list(map(int,input().split()))
s=1
for x in range(K):
  s*=A[x]
before=s
after=(before//A[0])*A[K]
for y in range(N-K):
  before=after
  after=(before//A[y])*A[K+y]
  if before<after:
    print("Yes")
  else:
    print("No")

Submission status: Wrong Answer

Solution code:
from numpy import prod

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

first_term = prod(a[:k])
for i in range(1, n - k + 1):
    term = first_term / a[i - 1]
    term = term * a[k+i-1]
    if int(term) > int(first_term):
        print('Yes')
    else:
        print('No')
    first_term = int(term)

Submission status: Wrong Answer

Solution code:
#C
N, K = map(int, input().split())
A = list(map(int, input().split()))
p=[]
import numpy as np
for i in range(N-K+1):
    ans=np.prod(A[i:i+K])
    p.append(ans)

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

Submission status: Wrong Answer

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

L = []
ave = sum(A[:k])

L.append(ave)

for i in range(n-k-1):
    #print(A[i],A[k+i])
    ave = ave - A[i] + A[k+i]
    L.append(ave)

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

Submission status: Wrong Answer

Solution code:
import functools
import operator

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

prod = functools.partial(functools.reduce, operator.mul)
tmp_sum_prod = 0
for c, i in enumerate(range(K, N+1)):
    start_idx = max(0, i-K)
    sum_prod = prod(A[start_idx:i])
    if c == 0:
        tmp_sum_prod = sum_prod
    else:
        if sum_prod > tmp_sum_prod:
            print('Yes')
        else:
            print('No')

Submission status: Wrong Answer

Solution code:
import math

def pulse_num(n):
    return n + 1
if __name__ == "__main__":
    N, K= list(map(int, input().split()))
    A = list(map(int, input().split()))

    if N-1 <= K:
        A = [N] * len(A)
    else:
        for k in range(K):
            B = [1] * len(A)
            for i in range(N):
                if A[i] != 0:
                    if i - A[i] - 0.5 < 0:
                        low = 0
                    else:
                        low = math.ceil(i - A[i] - 0.5)
                    if i + A[i] + 0.5 > N - 1:
                        high = N - 1
                    else:
                        high = math.floor(i + A[i] + 0.5)
                    B[low:high+1] = list(map(pulse_num, B[low:high+1]))
                    B[i] -= 1
            A = B

    for a in A:
        print(a, end=' ')

Submission status: Wrong Answer

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


if __name__ == '__main__':
	main()

Submission status: Wrong Answer

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

# 累積の積
accum_list = [1] * n

tmp_accum = 1
for i in range(n) :
    a = a_list[i]
    accum_list[i] = tmp_accum * a
    tmp_accum *= a

# print(tmp_accum)
# print(accum_list)
accum_list.insert(0,1)

print(accum_list)
prev_point = -9999
for i in range(k,n+1) :
    # print(i)
    hoge = accum_list[i]
    fuga = accum_list[i-k]
    current_point = hoge // fuga
    # print(hoge,fuga,current_point,prev_point)
    if (prev_point == -9999) :
        prev_point = current_point
        continue

    if (prev_point < current_point) :
        print("Yes")
    else :
        print("No")
    
    prev_point = current_point

Submission status: Wrong Answer

Solution code:
#for _ in range(int(input())):
n,k=map(int,input().split())
x=[int(x) for x in input().split()]
ans=[1]*n
ans[0]=x[0]
for i in range(1,k):
  ans[i]=ans[i-1]*x[i]
c=0
for i in range(k,n):
  ans[i]=(ans[i-1]//x[c])*x[i]
  c+=1
print(ans)
ans=ans[k-1:]
print(ans)
for i in range(len(ans)-1):
  if ans[i+1]>ans[i]:print('Yes')
  else:print('No')

Submission status: Wrong Answer

Solution code:
def resolve():
    '''
    code here
    '''
    N, K = [int(item) for item in input().split()]
    As = [int(item) for item in input().split()]

    prev_score = 1
    for i in range(K):
        prev_score *= As[i]

    for i in range(K,N):
        if prev_score < prev_score // As[i - K] * As[i]:
            print('Yes')
        else:
            print('No')
        

if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
N,K=map(int,input().split())
A=list(map(int,input().split()))
Key=A[0]+A[K-1]
for i in range(1,N-K+1):
  key=A[i]+A[K+i-1]
  if key>Key:
    print('Yes')
    Key=key
  else:
    print('No')
    Key=key

Submission status: Wrong Answer

Solution code:
import numpy as np


def function(N, K, A):
    pre = [int(A[i]) for i in range(K)]
    for i in range(1, N-K+1):
        now = [int(A[i]) for i in range(i, K+i)]
        if np.prod(now) > np.prod(pre):
            print('Yes')
        else:
            print('No')
        pre = now


if __name__ == '__main__':
    numbers = input().split()
    N = int(numbers[0])
    K = int(numbers[1])
    A = input().split()
    function(N, K, A)

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np

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

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

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

Submission status: Wrong Answer

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

sum=1

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

hoge=[0 for i in range(n)]
nga=[0 for i in range(n)]

MOD=10**9+7
for i in range(k-1,n):
    sum*=a[i]
    nga[i]=nga[i-1]
    if(sum>MOD):
        nga[i]+=sum//MOD
        sum=sum%MOD
    hoge[i]=sum
    if(sum<MOD):
        sum+=MOD
        nga[i]-=1
    sum=sum//a[i-k+1]

for i in range(k,n):
    #print(hoge[i-1],hoge[i],end=" ")
    if nga[i-1]<nga[i]:
        print("Yes")
    elif nga[i-1]==nga[i]:
        if hoge[i-1]<hoge[i]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Submission status: Wrong Answer

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

a_s_h = []
for idx in range(0, n-(k-1)):
  tmp_a_s_h = 1
  for jdx in range(0, k):
    tmp_a_s_h = tmp_a_s_h*a_s[idx+jdx]
  a_s_h.append(tmp_a_s_h)
for idx in range(1, len(a_s_h)):
    print("Yes" if a_s_h[idx-1] < a_s_h[idx] else "No", "\t", idx, a_s_h[idx-1], a_s_h[idx])

Submission status: Wrong Answer

Solution code:
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
import itertools
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

N,K = MI()

A = LI()

result = {}
for i in range(N-K+1, N+1):
    target = A[i-K:i]
    ans = 1
    for t in target:
        ans = ans * t
    result[i] = ans

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N,K=map(int,input().split())
A=list(map(int,input().split()))
A_max=max(A)
for i in range(N):
    A[i]=A[i]/A_max
ans=list()
tmp=1
for i in range(K):
    tmp=tmp*A[i]
for i in range(K,N):
    tmp_old=tmp
    tmp=tmp_old*A[i]/A[i-K]
    if tmp_old<tmp:
        ans.append('Yes')
    else:
        ans.append('No')
for i in ans:
    print(i)