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:
import sys
import numpy as np
import math
import collections
import copy
from collections import deque 
from functools import reduce
from itertools import product

N, K = map(int, input().split())
An = [list(map(int, input().split()))]
An_np = np.array(An).reshape(-1)
t1 = np.prod(An_np[:K])
# t2 = np.prod(An_np[1:K+1])
for i in range(K, N):
#     print(i)
#     t1 = np.prod(An_np[i-K:i])
#     t2 = np.prod(An_np[i-K+1:i+1])
#     print(t1, t2)
    t2 = t1 // An_np[i-K] * An_np[i]
#     print(t1, t2)
    if t2 > t1:
        print("Yes")
    else:
        print("No")
    t1 = t2

Submission status: Wrong Answer

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

S=[1]
P=20988936657440586486151264256610222593863921


for n in range (N):
    if n<=K:
        S.append((A[n]*S[-1])%P)
    else:
        S.append((A[n]*S[-1]/A[n-K])%P)

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

Submission status: Wrong Answer

Solution code:
import decimal
import numpy as np
import sys

def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))

N,K = LI()
_A = LI()

A = np.array(_A, dtype='float32')
A /= float(10)

Aprod = np.zeros(N + 1, dtype=np.dtype(decimal.Decimal))
Aprod[0] = 1
Aprod[1:] = np.cumprod(A)

result = np.zeros(N+1-K,dtype=np.dtype(decimal.Decimal))
result = Aprod[K:] / Aprod[0:N+1-K]

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

s = n - k - (k - 1)
e = n - k
t = sum(a[s:e])

for i in range(n - k):
    ai = n - (n - k) + i
    t2 = t // a[ai - k]
    t2 *= a[ai]

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

Submission status: Wrong Answer

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

point = []

temp = int(a[0])
for i in range(1,k):
    temp = temp * (int(a[i]))
point.append(temp)

for i in range(k,n):
    point.append(int(point[i-k] * int(a[i]) / int(a[i-k])))

print(point)

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

Submission status: Wrong Answer

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

score_list = []

score = A[0]
for i in range(1, N):
    score = score * A[i]
    if (i > K-1):
        score = score / A[i-K]
        score_list.append(score)
    elif (i == K-1):
        score_list.append(score)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
M = 1000000007

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

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

Submission status: Wrong Answer

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

for j in range (n - k):
    ev_2 = ev_1 * a[k + j] / a[j]
    if ev_1 < ev_2 :
        print("Yes")
    else:
        print("No")
    ev_1 = ev_2

Submission status: Wrong Answer

Solution code:
from functools import reduce
from operator import mul

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

x = min(a)
a = list(map(lambda y: y//x, a))
num = reduce(mul, a[:k])
for i in range(k, n):
    num2 = reduce(mul, a[i-k+1:i+1])
    if num < num2:
        print('Yes')
    else:
        print('No')
    num = num2

Submission status: Wrong Answer

Solution code:
import numpy as np
N,K = map(int, input().split())
As = list(map(int, input().split())) 
A=np.array(As)
for x in range(N-K):
  if np.prod(A[x:K+x]) < np.prod(A[x+1:K+x+1]):
    print("Yes")
  else:
    print("No")

Submission status: Wrong Answer

Solution code:
import numpy

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

# print(a[4 - k: 4])
xs = []

def solve():
    for i in range(1, n - k + 1):
        ii = k + i
        # tmp = 1
        # for x in a[ii - k: ii]:
        #     tmp = x * tmp
        tmp = numpy.prod(a[ii - k: ii])
        prevTmp = tmp * a[ii - k - 1] / a[ii - 1]

        if prevTmp < tmp:
            xs.append('Yes')
        else:
            xs.append('No')


solve()
print(*xs, sep='\n')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split()))
b = list(map(int,input().split()))
for v in range(a[1]-a[0]):
  c=list(map(numpy.prod.b[0+v:a[0]+v]))
for m in range(a[1]-a[0]):
  if c[m+1]>c[m]:
    print("Yes")
  else:
    print("No")

Submission status: Wrong Answer

Solution code:
M = 1000000007

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

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

Submission status: Wrong Answer

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

now = 1
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:
N,K = map(int,input().split())
a = list(map(int,input().split()))

ans = []
g = 0
for i in range(N-K+1):
  k = 1
  for s in range(K):
    k *= a[s+i]%10**5
  ans.append(k)
  if len(ans)>1:
    if ans[0]<ans[1]:
      print("Yes")
    else:
      print("No")
    del ans[0]

Submission status: Wrong Answer

Solution code:
M = 1000000007

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

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

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 = [np.prod(scores[:k])]
for i, (l, r) in enumerate(zip(scores, scores[k:])):
  if i < n - k:
  	ans.append(ans[-1] / l * r)

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

tmp = []

s = n - k - (k - 1)
e = n - k
tmp.append(sum(a[s:e]))

c = 0
for i in range(n - k):
    ai = n - (n - k) + i
    t = tmp[c] // a[ai - k]
    t *= a[ai]

    if tmp[c] < t:
        print('Yes')
    else:
        print('No')

    tmp.append(t)
    c += 1

Submission status: Wrong Answer

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

ans = []
g = 0
for i in range(N-K+1):
  k = 1
  for s in range(K):
    k *= np.sqrt(a[s+i])
  ans.append(k)
  if len(ans)>1:
    if ans[0]<ans[1]:
      print("Yes")
    else:
      print("No")
    del ans[0]

Submission status: Wrong Answer

Solution code:
import numpy as np

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

l = n - k + 1
lis = [0]*l
#0, 1, 2
for i in range(l):
  lis[i] = np.prod(a[i:i+k])

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

Submission status: Wrong Answer

Solution code:
M = 10**9 + 7


def prod(A):
    ans = 1
    # print(A)
    for a in A:
        ans *= a % M
        # print(ans)
    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])  # K学期目の評点
    ans = []
    # print(p)
    for i in range(K, N):
        # print(A[i - K], A[i])
        # print(p // A[i - K] * A[i] % M, p)
        if p // A[i - K] * A[i] % M > p:
            ans.append('Yes')
            # print('Yes')
        else:
            ans.append('No')
            # print('No')
        p = p // A[i - K] * A[i] % M
    print('\n'.join(ans))


if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
from sys import stdin
import numpy as np

def main():
	readline = stdin.readline
	A = [list(map(int, readline().split()))][0]
	N = A[0]
	K = A[1]
	A = [list(map(int, readline().split()))][0]
	score = np.array(A)
	grade = np.zeros(N - K + 1)

	for i in [0]*(N-K):
		if(i == 0):
			temp = np.prod(score[i:K+i])
			grade[i] = temp
		temp = np.prod(score[i+1:K+i+1])
		grade[i+1] = temp
		if(grade[i] < grade[i + 1]):
			print("Yes")
		else:
			print("No")

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import numpy as np
tmp=[int(i) for i in input().split(' ')]
tmp_s=np.array([int(i) for i in input().split(' ')])
score=np.zeros(tmp[0]-tmp[1]+1)
for i in range(tmp[0]-tmp[1]+1):
  if i==0:
    score[0]=np.prod(tmp_s[:tmp[1]])
  else:
    if tmp_s[i-1]==0:
      score[i]=np.prod(tmp_s[i:i+tmp[1]+1])
    else:
      score[i]=tmp_s[i+tmp[1]-1]*score[i-1]/tmp_s[i-1]
    
    if score[i-1]<score[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()))

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

Submission status: Wrong Answer

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

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

preserve = 0
temp = 1

for i in range(K-1,N):
    for j in range(i-K+1,i+1):
        temp *= A_list[j]
    
    if preserve == 0:
        preserve = temp
        temp = 1
    
    else:
        if preserve < temp:
            print("Yes")
        else:
            print("No")
        
        temp = 1

Submission status: Wrong Answer

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

c1 = 0
c2 = K
while True:
    K1 = np.prod(P_list[c1:c2])
    K2 = np.prod(P_list[c1+1:c2+1])
    if K2 > K1:
        print('Yes')
    else:
        print('No')
    c1 += 1
    c2 += 1
    if c2 == N:
        break

Submission status: Wrong Answer

Solution code:
# [] = list(map(int, input().split()))
# = map(int, input().split())

# C
import numpy as np
[n, k] = list(map(int, input().split()))
aList = list(map(int, input().split()))
aList_kai = []
last = np.prod(aList[0:k])
aList_kai.append(last)
now = 0

for i in range(1, n-k+1):
    now = np.prod(aList[i:i+k])
    if now > last:
        print("Yes")
    else:
        print("No")
    last = now

Submission status: Wrong Answer

Solution code:
import numpy as np
 
N,K=map(int, input().split())
A=list(map(int, input().split()))
 
x=np.prod(A[0:K])
 
for i in range(N-K):
    y = int(x/A[i])*A[K+i]
    print('Yes' if x < y else 'No')
    x = y

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)
tmp2=np.prod(a[:k])
for i in range(k,n):
    tmp1=tmp2
    tmp2=np.prod(a[i-k+1:i+1])
    if tmp2>tmp1:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
N, K = map(int, input().split())
A = list(map(int, input().split()))
temp = 1
semester = [0 for _ in range(N)]

for i in range(N - K + 1):
    temp = 1
    for i in range(K):
        temp *= A[i]
    semester[i] = temp
    print(temp)

for i in range(N - K):
    if semester[i] < semester[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()))
A = []

def getRate(list, int1, int2):
    value = 1
    for i in range(int1, int2):
        value = value * list[i]
    return value

Rate = getRate(a, 0, K)

for i in range(1, N-K+1):
    if Rate < getRate(a, i, K + i):
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

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

for j in range (n - k):
    ev_2 = ev_1 * a[k + j] // a[j]
    if ev_1 < ev_2 :
        print("Yes")
    else:
        print("No")
    ev_1 = ev_2

Submission status: Wrong Answer

Solution code:
N,K=input().split()
N=int(N)
K=int(K)
scores=input().split()
scores=[int(i) for i in scores]
count=0
boad=0
for gakki in range(K,N+1):
  score=1
  for i in scores[gakki-K:gakki]:
    score*=i
  if count==0:
    count+=1
    boad=score

    continue
  elif score>boad:
    print('Yes')
    continue
  else:
    print('No')
    
  boad=score

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

marks = list(map(int, input().split(' ')))

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

Submission status: Wrong Answer

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

for j in range (n - k):
    ev_2 = ev_1 * a[k + j] // a[j]
    print(ev_1, ev_2)
    if ev_1 < ev_2 :
        print("Yes")
    else:
        print("No")
    ev_1 = ev_2

Submission status: Wrong Answer

Solution code:
import numpy as np

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

def checker(i):
  l1 = A[i-K+1:i:]
  b = np.prod(l1)
  i1 = A[i-K]
  i2 = A[i]
  score1 = b * i1
  score2 = b * i2
  if score1 < score2:
    return "Yes"
  else:
    return "No"

for i in range(K,N):
  print(checker(i))

Submission status: Wrong Answer

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

S=[1]
P=20988936657440586486151264256610222593863921


for n in range (N):
    if n<K:
        S.append((A[n]*S[-1])%P)
    else:
        S.append((A[n]*S[-1]/A[n-K])%P)

for i in range (K+1,N+1):
    if S[i]>S[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 = list(map(int, input().split()))
a_list.insert(0, 0)
# print(a_list)

pre = 0
for i in range(n - k + 1):
    # print(f"{1 + i} {k + i}")
    # p[1 + i]
    start = 1 + i
    end = k + i
    if pre == 0:
        p = np.prod(a_list[start:end + 1])
    else:
        p = p / a_list[start - 1] * a_list[end]
    # print(p)
    
    if i == 0:
        pre = p
    else:
        if p > pre:
            print("Yes")
        else:
            print("No")
        pre = p

Submission status: Wrong Answer

Solution code:
import numpy as np

n, k = map(int, input().split())
A = np.array(input().split(), dtype=np.int64)
score = np.array([0 for i in range(n- k + 1)], dtype = np.int64)
wknum = 1
for i  in range(k):
    wknum *= A[i]

score[0] = wknum

for i in range(n - k):
    wknum = 1
    point = k + i
    for j in range(k):
        wknum *= A[point - k + j + 1]
    score[i + 1] = wknum
    if score[i + 1] <= score[i]:
        print('No')
    else:
        print('Yes')

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 = 0
s = 1
for i, a in enumerate(A):
    if i < K:
        s = a
        B = s
    else:
        s = A[i-K]
        B = a
        if B != 0 and B < s:
            print('Yes')
        elif B != 0 and B >= s:
            print('No')
        B = s

Submission status: Wrong Answer

Solution code:
terms, graded_terms = input().split(" ")
grade_list = [i for i in input().split(" ")]
x1 = 0
x2 = int(graded_terms)
for i in range(int(terms)-int(graded_terms)):
    if grade_list[int(x2)] > grade_list[int(x1)]:
        print("Yes")
    else:
        print("No")
    x1 += 1
    x2 += 1

Submission status: Wrong Answer

Solution code:
import numpy as np

N, K = map(int, input().split())
A_list = list(map(int, input().split()))
tmp = [1] * (N+1)

for i in range(K, N+1):
    tmp[i] = np.prod(A_list[i-K:i])

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

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 = [np.prod(scores[:k])]
for i, (l, r) in enumerate(zip(scores, scores[k:])):
  if i < n - k:
  	ans.append(ans[-1] / l * r)
print(ans)

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

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
a = list(map(int,input().split()))
from collections import deque
a_num = 1
for i in range(0,M):
  a_num = a_num*a[i]  
d = deque()
d.append(a_num)
for i in range(M,N):
  a_num =(a_num/a[i-1])*a[i]
  d.append(a_num)
  if i>M-1:
    if d[i-M]<d[i-M+1]:
      print("Yes")
    else:
      print("No")

Submission status: Wrong Answer

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

score = []

for i in range(n - k + 1): #iはスタート地点
  seki = 1
  for j in range(i, i + k): #Aのj番目の要素をかける
    seki = seki * A[j]
  score.append(seki)
  
for i in range(len(score) - 1):
  if score[i] <= score[i + 1]:
    print("Yes")
  else:
    print("No")

Submission status: Wrong Answer

Solution code:
from sys import stdin
def main():
  readline = stdin.readline
  N, K = map(int, readline().split())
  A = tuple(map(int, readline().split()))
  pre = 1
  for i in range(K):
    pre *= A[i]
  for i in range(1,N - K + 1):
    z = (pre // A[i - 1]) * A[i + K - 1]
    if pre < z:
      print("Yes")
    else:
      print("No")

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 = []
for i in range(0, N-K+1):
    res.append(A[i:i+K])

res = np.array(res)
res_mul = np.prod(res, axis=1)

tmp = res_mul[0]
for r in res_mul[1:]:
    if tmp < r:
        print('Yes')
    else:
        print('No')
    tmp = r

Submission status: Wrong Answer

Solution code:
import numpy as np
 
N,K=map(int, input().split())
A=list(map(int, input().split()))
 
x=np.prod(A[0:K])
 
for i in range(N-K):
    y = x/A[i]*A[K+i]
    print('Yes' if x < y else 'No')
    x = y

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()))
temp = 1
semester = [0 for _ in range(N)]

for i in range(N - K + 1):
    for i in range(K):
        temp *= A[i]
    semester[i] = temp
    print(temp)

for i in range(N - K):
    if semester[i] < semester[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()))
 
x=np.prod(A[0:K])

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

res = np.cumprod(risu[0: K])[K - 1]

for i in range(K + 1, N +1):
    if np.cumprod(risu[i - K: i])[K - 1] > res:
        print('Yes')
    else:
        print('No')
    res = np.cumprod(risu[i - K: i])[K - 1]

Submission status: Wrong Answer

Solution code:
M = 10**9 + 7


def prod(A):
    ans = 1
    # print(A)
    for a in A:
        ans *= a % M
        # print(ans)
    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])  # K学期目の評点
    # print(p)
    for i in range(K, N):
        # print(A[i - K], A[i])
        # print(p // A[i - K] * A[i] % M, p)
        if p // A[i - K] * A[i] % M > p:
            print('Yes')
        else:
            print('No')
        p = p // A[i - K] * A[i] % M


if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
M = 1000000007

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

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

Submission status: Wrong Answer

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

length = len(a)
res = [1] * length
for i in range(n-k-1, n):
    for j in range(k):
        if i-k+1 < 0:
            break
        res[i] *= a[i-j]

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

Submission status: Wrong Answer

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

dictS={}
dictS[0]=1

p=170141183460469231731687303715884105727

for n in range (1,N):
    if n<K:
        # S.append(A[n]*S[-1])
        dictS[n]=(A[n]*dictS[n-1])%p

    else:
        # S.append(A[n]*S[-1]/A[n-K])
        dictS[n]=(A[n]*dictS[n-1]/A[n-K])%p

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

n,k = map(int, input().split())
a=list(map(int, input().split()))  
count=0
pre_total=0
for i in range(k-1,len(a)) :
    count=1
    
    for j in range(0,k):
        if j == 0:
            count*=a[i]
        else:
            j=i-j
            count*=a[j]
        
        
    if pre_total != 0 :
        if pre_total < count :
            print("Yes")
        else :
            print("No")
        
        pre_total=count

Submission status: Wrong Answer

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

Ki_sum1 = np.prod(A[:K])

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

Submission status: Wrong Answer

Solution code:
from operator import mul
from functools import reduce

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

hyouten_count = N - K

result_list = []

result = 1
result_before = 1

for i in range(K-1, N):
    result = 1
    # print(num)
    # result = 1
    num = i-K+1
    result = reduce(mul, A[num:i+1])
    # for j in range(K):
    #     result = result * A[i - j]
    # print(result)
    # print(result)
    # result_list.append(result)
    if result_before == 1:
        pass
    elif result > result_before:
        print('Yes')
    else:
        print('No')
    result_before = result


# for n in range(1, len(result_list)):
#     if result_list[n] > result_list[n-1]:
#         print('Yes')
#     else:
#         print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np

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

A_past = np.prod(A[:K])

for i in range(N-K):
  A_now = np.prod(A[i+1:i+1+K])
  #print(f"{A_now}, {A_past}")
  if A_now > A_past:
    print("Yes")
  else:
    print("No")
  A_past = A_now

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, k = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
p = 1
for i in range(k):
  p *= arr[i]
grades = [p]
for i in range(k, n):
  p /= arr[i-k]
  p *= arr[k]
  grades.append(p)
for i in range(1, len(grades)):
  if grades[i] > grades[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()))
score=[]
for i in range(n-k+1):
  score.append(A[k-i]*A[k-i-1]*A[k-i-2])
for r in range(n-k):
  if score[r]-score[r-1]>0:
    print('YES')
  else:
    print('No')

Submission status: Wrong Answer

Solution code:
import numpy as np

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

res = np.cumprod(risu[0: K])

for i in range(K + 1, N +1):
    if np.cumprod(risu[i - K: i])[K - 1] > res[K - 1]:
        print('Yes')
    else:
        print('No')
    res = np.cumprod(risu[i - K: i])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
M = 1000000007

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

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

Submission status: Wrong Answer

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

dictS={}
dictS[0]=1

p=9007199254740997

for n in range (1,N):
    if n<K:
        # S.append(A[n]*S[-1])
        dictS[n]=(A[n]*dictS[n-1])%p

    else:
        # S.append(A[n]*S[-1]/A[n-K])
        dictS[n]=(A[n]*dictS[n-1]/A[n-K])%p

for i in range (K,N):
    if dictS[i]>dictS[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()))

b = [1]
c = 1

for i in range(n):
    c = c * a[i]
    b.append(c)

for j in range(k,n):
    if b[j+1]/b[j+1-k] - b[j]/b[j-k] > 0:
        print('Yes')
    else:
        print('Mo')

Submission status: Wrong Answer

Solution code:
N,K=input().split()
N=int(N)
K=int(K)
scores=input().split()
scores=[int(i) for i in scores]
mass=[]
for gakki in range(K,N+1):
  score=1
  for i in scores[gakki-K:gakki]:
    score*=i
  mass.append(score)

for index,num in enumerate(mass[1:]):
  if num>mass[index]:
    print("Yes")
  else:
    print('NO')

Submission status: Wrong Answer

Solution code:
n,k= map(int, input().split()) 
lst = [] 
lst2 = []
sum=0
j=0
lst = [int(item) for item in input().split()] 
for i in range(n):
	if i==0:
		while i<k-1:
			sum=sum+lst[i]
			i=i+1
	else:
		sum=sum-lst[j]
		sum=sum+lst[i]
		j=j+1
	lst2.append(sum)

x=len(lst2)
for i in range(1,x):
	if lst2[i]>lst2[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()))

dictS={}
dictS[0]=1

p=92709568269121

for n in range (1,N):
    if n<K:
        # S.append(A[n]*S[-1])
        dictS[n]=(A[n]*dictS[n-1])%p

    else:
        # S.append(A[n]*S[-1]/A[n-K])
        dictS[n]=(A[n]*dictS[n-1]/A[n-K])%p

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

Submission status: Wrong Answer

Solution code:
M = 1000000007

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

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

Submission status: Wrong Answer

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

length = len(a)
res = [1] * length
for i in range(n-k-1, n):
    for j in range(k):
        if i-k+1 < 0:
            break
        res[i] *= a[i-j]

ans = []
for i in range(n-k):
    if res[n-i-1] > res[n-i-2]:
        cur = 'Yes'
    else:
        cur = 'No'
    ans.append(cur)
for i in reversed(ans):
    print(i)

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):
    if a[i] > a[i-3]:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()