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 = list(map(int, input().split())) 
a = list(map(int, input().split())) 
b = [] 
m = 1 
for i in range(k): 
  m*=a[i] 
  b.append(m) 
m=0 
for i in range(k, len(a)): 
  b.append(round(b[m]/a[i-k])*a[i]) 
  m +=1
for i in range(1, len(b)): 
  if b[i] > b[i-1]: 
    print("Yes") 
  else: 
    print("No")

Submission status: Wrong Answer

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


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

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):
    prod = eva[i]//a[i]*a[i+k]
    eva.append(prod)
# 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 numpy as np


N, K = map(int, input().split())
A = np.array(input().split(), np.int64)

PA = np.cumprod(A)
ans = []
f = ['No', 'Yes']
for i in range(K, N):
    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:
n,k=map(int,input().split())
a=list(map(int, input().split()))

for i in range(k,n):
    if a[i-3]*a[i-2]*a[i-1]<a[i-2]*a[i-1]*a[i]:
        print("Yes");
    else :
        print("No");

Submission status: Wrong Answer

Solution code:
import numpy as np

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a = [(input()) for i in range(2)]
print(a)
tmp=a[0].split(' ')
tmp_s=a[1].split(' ')
score=[]
for i in range(int(tmp[0])-int(tmp[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 = list(map(int,input().split()))
target = a[0:k]
p = np.prod(target)
for i in range(n-k):
    target = a[i+1:i+k+1]
    ans = np.prod(target)
    # print(p)
    if ans > p:
        print("Yes")
    else:
        print("No")
    p = ans

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import numpy as np
if __name__ == "__main__":
    NK=input().split(" ")
    N,K=int(NK[0]),int(NK[1])
    A=input().split(" ")
    A=[int(i) for i in A]
    A=np.array(A,dtype=np.uint64)
    V=np.ones(K,dtype=np.uint64)
    # e=1e-14
    moveMeanA=np.convolve(A,V,mode='valid')
    # print(moveMeanA.dtype)
    dMoveMeanA=moveMeanA[1:]-moveMeanA[:-1]
    # print(dMoveMeanA.dtype)
    for i in (dMoveMeanA>0):
        print("Yes" if i else "No")

Submission status: Wrong Answer

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

p_sekiwa = np.prod(an[0:k])

for i in range(k,len(an)):
    sekiwa = int((p_sekiwa*an[i])/an[i-k])
    if sekiwa>p_sekiwa:
        print('Yes')
    else:
        print('No')
    p_sekiwa = sekiwa

Submission status: Wrong Answer

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

import numpy as np

A = np.array(A)

Base = np.prod(A[:K])
for n in range(N-K):
  Tgt_i = np.prod(A[n:K+n])
  Tgt_i1 = np.prod(A[n+1:K+n+1])
  if Tgt_i < Tgt_i1:
    print('Yes')
  else:
    print('No')

Submission status: Wrong Answer

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

s = 1
d = 1
last = 0
for i in range(n):
    s *= a[i]
    if i - k >= 0:
        d*=a[i-k]
        s = s % 1000000007
        d = d % 1000000007
    num = s // d

    #print(f'{num} {last}')
    if i-1 >= k-1:
        if last >= num:
            print('No')
        else:
            print('Yes')
    last = num

Submission status: Wrong Answer

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

def main():
    n,k=map(int, input().split())
    a=[int(i) for i in input().split()]
    tmp = 0
    res = []
    tmp = 1
    ind = 0
    for i in range(n-k):
        if(a[ind] < a[ind+k]):
            res.append(1)
        else:
            res.append(0)
        ind += 1


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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math


def _run(n, k, a_list):
    integral_windows = [0] * (len(a_list) + 1)
    for i in range(len(a_list)):
        integral_windows[i + 1] = integral_windows[i] + math.log(a_list[i])

    sliding_size = n - k
    for i in range(sliding_size):
        sum_value_a = integral_windows[k + i] - integral_windows[i]
        sum_value_b = integral_windows[k + i + 1] - integral_windows[i + 1]
        if sum_value_a < sum_value_b:
            print("Yes")
        else:
            print("No")


def _main():
    N, K = map(int, input().split())
    A_list = list(map(int, input().split()))
    _run(N, K, A_list)


if __name__ == "__main__":
    _main()

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np

def Ss():
  return sys.stdin.readline().rstrip().split(' ')

def Is():
  ss = Ss()
  return map(int, ss) if len(ss) > 1 else int(ss[0])

n, k = Is()
scores = [*Is()]

ans = []
for i in range(n-k+1):
  ans.append(np.prod(scores[i:i+k]))

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

Submission status: Wrong Answer

Solution code:
N,K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
score = [1 for x in range(N-K+1)]
for k in range(len(score)):
    for j in range(K):
        score[k] *= A[K+k-1-j]
for i in range(1,len(score)):
    if score[i] > score[i-1]:
        print("Yes")
    else:
        print("No")
print(score)

Submission status: Wrong Answer

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

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

for i in range(k, n):
    if a[i]>a[i-k]:
        print('Yes')
    else:
        print("N0")

Submission status: Wrong Answer

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

ans = 1
pre = 1

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

ans = pre

for i in range(k,n):
    ans /= a[i-k]
    ans *= a[i]
    if(ans > pre):
        print("yes")
    else:
         print("No")
    pre = ans

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(n - k):
    term = first_term / a[i]
    term = term * a[k+i]
    if int(term) >= int(first_term):
        print('Yes')
    else:
        print('No')
    first_term = int(term)

Submission status: Wrong Answer

Solution code:
import os
import sys
from io import BytesIO, IOBase
def gcd(a, b) : 
    if (a == 0) : 
        return b 
          
    return gcd(b % a, a)

def modInverse(a, m) : 
    g = gcd(a, m) 
    if (g != 1) : 
        return 1/a
    else : 
        return power(a, m-2, m)
      
# To compute x^y under modulo m 
def power(x, y, m) : 
    if (y == 0) : 
        return 1
          
    p = power(x, y // 2, m) % m 
    p = (p * p) % m 
  
    if(y % 2 == 0) : 
        return p  
    else :  
        return ((x * p) % m) 

MOD = 10**9 + 7

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

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

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



        




































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

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

Submission status: 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])):
  t=1
  for j in range(int(tmp[1])):
    t=t*int(tmp_s[j])
  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())
an = list(map(int, input().split()))

p_sekiwa = np.prod(an[0:k])
# print(p_sekiwa)
for i in range(k,len(an)):
    sekiwa = np.prod(an[i-k+1: i+1])
    #print(sekiwa)
    if sekiwa>p_sekiwa:
        print('Yes')
    else:
        print('No')
    p_sekiwa = sekiwa

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

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(n - k):
    term = first_term / a[i]
    term = term * a[k+i]
    if int(term) > int(first_term):
        print('Yes')
    else:
        print('No')
    first_term = int(term)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

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

Submission status: Wrong Answer

Solution code:
from copy import deepcopy
import numpy as np


nk = input().split()
n = int(nk[0])
k = int(nk[1])
ajs = input().split()
ajs = np.array([int(aj) for aj in ajs])
ajs = ajs / ajs.max()

ak_current = ajs[:k].cumprod()[-1]

for i in range(k, n):
  ak_tmp = deepcopy(ak_current)

  ak_tmp =  ak_tmp / (ajs[i-k]) * (ajs[i])
  
  if ak_tmp > ak_current:
    print('Yes')
  else:
    print('No')
    
  ak_current = ak_tmp

Submission status: Wrong Answer

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

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

num = n-k

ans = [0] * (num+1)
ans[0] = 1

for i in range(num+1):
    ans[0] *= a[i]

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

print(ans)

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

Submission status: Wrong Answer

Solution code:
import math
n,k = map(int,input().split())
a = list(map(int,input().split()))
prod = [math.log(a[0])]*(n+1)
for i in range(n):
	prod[i+1] = prod[i] + math.log(a[i])

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

Submission status: Wrong Answer

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

point = 1
for i in range(0,k):
    point *= li[i]

for i in range(1,k):
    point_new = 1
    for j in range(i,k+i):
        point_new *= li[j]
    if point_new <= point:
        print('No')
        point = point_new
    else:
        print('Yes')
        point = point_new

Submission status: Wrong Answer

Solution code:
import numpy as np


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

    tmp = np.prod(A_int_list[:K])
    for i in range(1, N - K + 1):
        if tmp < np.prod(A_int_list[i:K + i]):
            print("Yes")
        else:
            print("No")

        tmp = np.prod(A_int_list[i:K + i])


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import numpy as np


N, K = map(int, input().split())
A = np.array(input().split(), np.int32)

PA = np.cumprod(A)
ans = []
f = ['No', 'Yes']
for i in range(K, N):
    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:
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(n - k):
    term = first_term / a[i]
    term = term * a[k+i]
    if term > first_term:
        print('Yes')
    else:
        print('No')
    first_term = term

Submission status: Wrong Answer

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

import numpy as np

Base = np.prod(A[:K])
for n in range(N-K):
  Tgt_i = np.prod(A[n:K+n])
  Tgt_i1 = np.prod(A[n+1:K+n+1])
  if Tgt_i < Tgt_i1:
    print('Yes')
  else:
    print('No')

Submission status: Wrong Answer

Solution code:
n, k = map(int, input().split())
al = list(map(int, input().split()))
for i in range(k, n):
    print('yes' if al[i] > al[i - k] else 'No')

Submission status: Wrong Answer

Solution code:
import numpy as np
if __name__ == "__main__":
    NK=input().split(" ")
    N,K=int(NK[0]),int(NK[1])
    A=input().split(" ")
    A=[int(i) for i in A]
    A=np.array(A)
    V=np.ones(K,dtype=np.float64)/float(K)
    e=1e-14
    moveMeanA=np.convolve(A,V,mode='valid')
    print(moveMeanA)
    dMoveMeanA=moveMeanA[1:]-moveMeanA[:-1]
    print(dMoveMeanA)
    for i in (dMoveMeanA>e):
        print("Yes" if i else "No")

Submission status: Wrong Answer

Solution code:
from copy import deepcopy
import numpy as np


nk = input().split()
n = int(nk[0])
k = int(nk[1])
ajs = input().split()
ajs = np.array([int(aj) for aj in ajs])

ak_current = ajs[:k].cumprod()[-1]

for i in range(k, n):
  ak_tmp = deepcopy(ak_current)

  ak_tmp =  ak_tmp / int(ajs[i-k]) * int(ajs[i])
  
  if ak_tmp > ak_current:
    print('Yes')
  else:
    print('No')
    
  ak_current = ak_tmp

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from copy import deepcopy
import numpy as np


nk = input().split()
n = int(nk[0])
k = int(nk[1])
ajs = input().split()
ajs = np.array([int(aj) for aj in ajs])

ak_current = ajs[:k].cumprod()[-1]

for i in range(k, n):
  ak_tmp = deepcopy(ak_current)
  print(ak_tmp)
  ak_tmp =  ak_tmp / int(ajs[i-k]) * int(ajs[i])
  
  if ak_tmp > ak_current:
    print('Yes')
  else:
    print('No')
    
  ak_current = ak_tmp

Submission status: Wrong Answer

Solution code:
import numpy as np
#C
n,k = map(int,input().split())
a = list(map(int,input().split()))

hyouten = []

for i in range(n-k+1):
    hyouten.append(np.prod(a[i:i+k]))

    if i>0:
        if hyouten[i] > hyouten[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()))

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: 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 = r[i] // r[i-K]

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

    before = after

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import os
import sys
from io import BytesIO, IOBase
def gcd(a, b) : 
    if (a == 0) : 
        return b 
          
    return gcd(b % a, a)

def modInverse(a, m) : 
    g = gcd(a, m) 
    if (g != 1) : 
        return -1 
    else : 
        return power(a, m-2, m)
      
# To compute x^y under modulo m 
def power(x, y, m) : 
    if (y == 0) : 
        return 1
          
    p = power(x, y // 2, m) % m 
    p = (p * p) % m 
  
    if(y % 2 == 0) : 
        return p  
    else :  
        return ((x * p) % m) 

MOD = 10**9 + 7
def main():
    t = 1
    for _ in range(t):
        # n = int(input)
        n, k = map(int, input().split())
        nums = list(map(int, input().split()))

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

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



        




































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

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

res = list()

res.append(np.prod(a[:k]))
tmp = res[0]

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import os
import sys
from io import BytesIO, IOBase
def gcd(a, b) : 
    if (a == 0) : 
        return b 
          
    return gcd(b % a, a)

def modInverse(a, m) : 
    g = gcd(a, m) 
    if (g != 1) : 
        return -1 
    else : 
        return power(a, m-2, m)
      
# To compute x^y under modulo m 
def power(x, y, m) : 
    if (y == 0) : 
        return 1
          
    p = power(x, y // 2, m) % m 
    p = (p * p) % m 
  
    if(y % 2 == 0) : 
        return p  
    else :  
        return ((x * p) % m) 

MOD = 10**9 + 7
def main():
    t = 1
    for _ in range(t):
        # n = int(input)
        n, k = map(int, input().split())
        nums = list(map(int, input().split()))

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

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



        




































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

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

Submission status: Wrong Answer

Solution code:
import sys
import math
sys.setrecursionlimit(int(1e6))

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

i_l = 0
for i_r in range(k, n):
  #print('i_l, i_r = ', i_l, i_r)
  if A[i_l] > A[i_r]:
    print('No')
  else:
    print('Yes')

  i_l = i_l + 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

now = 1

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

Submission status: Wrong Answer

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

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

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

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

if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
from copy import deepcopy
import numpy as np


nk = input().split()
n = int(nk[0])
k = int(nk[1])
ajs = input().split()
ajs = np.array([int(aj) for aj in ajs])

ak_current = ajs[:k].cumprod()[-1]

for i in range(k, n):
  ak_tmp = deepcopy(ak_current)

  ak_tmp =  int(ak_tmp * ajs[i] / ajs[i-k])
  
  if ak_tmp > ak_current:
    print('Yes')
  else:
    print('No')
    
  ak_current = ak_tmp

Submission status: Wrong Answer

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

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

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

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

# b = A[K:]

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

Submission status: Wrong Answer

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:
    continue
  if new > old:
    print("Yes")
  else:
    print("No")
  old = new