Problem:


Score: 300 points

Problem Statement

M-kun is a student in Aoki High School, where a year is divided into N terms.

There is an exam at the end of each term. According to the scores in those exams, a student is given a grade for each term, as follows:

For the first through (K-1)-th terms: not given.

For each of the K-th through N-th terms: the multiplication of the scores in the last K exams, including the exam in the graded term.

M-kun scored A_i in the exam at the end of the i-th term.

For each i such that K+1 \leq i \leq N, determine whether his grade for the i-th term is strictly greater than the grade for the (i-1)-th term.

Constraints

2 \leq N \leq 200000

1 \leq K \leq N-1

1 \leq A_i \leq 10^{9}

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N K
A_1 A_2 A_3 \ldots A_N

Output

Print the answer in N-K lines.

The i-th line should contain Yes if the grade for the (K+i)-th term is greater than the grade for the (K+i-1)-th term, and No otherwise.

Sample Input 1

5 3
96 98 95 100 20

Sample Output 1

Yes
No

His grade for each term is computed as follows:

3-rd term: (96 \times 98 \times 95) = 893760

4-th term: (98 \times 95 \times 100) = 931000

5-th term: (95 \times 100 \times 20) = 190000

Sample Input 2

3 2
1001 869120 1001

Sample Output 2

No

Note that the output should be No if the grade for the 3-rd term is equal to the grade for the 2-nd term.

Sample Input 3

15 7
3 1 4 1 5 9 2 6 5 3 5 8 9 7 9

Sample Output 3

Yes
Yes
No
Yes
Yes
No
Yes
Yes



Sample input:
5 3
96 98 95 100 20


Sample output:
Yes
No

Submission status: Time Limit Exceeded

Solution code:
gakki,kiten = list(map(int,input().split()))
list_ten = list(map(int,input().split()))
list_han = [0]*(gakki - kiten+1)
ten=1

for i in range(gakki - kiten+1):
    for j in range(kiten):
        ten = list_ten[j+i]*ten
    list_han[i]=ten
    ten=1

for i in range(gakki - kiten):
    if list_han[i] < list_han[i+1]:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))
def last_k(a, i):
    p = 1
    for j in range(k):
        p=p*a[i-j]
    return p
seed = last_k(a, k-1)
for i in range(n-k):
    if seed < int(seed*a[i+k]/a[i]):
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
a = list(map(int, input().split()))
def last_k(a, i):
    p = 1
    for j in range(k):
        p=p*a[i-j]
    return p
for i in range(n-k):
    if last_k(a, i+k-1) < last_k(a, i+k):
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

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

dictS={}
dictS[0]=1

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


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

Submission status: Time Limit Exceeded

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

    score = 1
    for a in A[:K]:
        score *= a

    ans = ['Yes' if A[i + K] > A[i] else 'No' for i in range(N - K)]
    return ' '.join(ans)

print(c_marks())

Submission status: Time Limit Exceeded

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

    score = 1
    for a in A[:K]:
        score *= a

    ans = []
    for i in range(N - K):
        score_before = score
        score //= A[i]
        score *= A[i + K]
        ans.append('Yes' if score > score_before else 'No')
    return ' '.join(ans)

print(c_marks())

Submission status: Time Limit Exceeded

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

tmp = 1

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

for i in range(K,C):
  tmp_tmp = (tmp / A[i-K]) * A[i]
  if tmp < tmp_tmp:
    print("Yes")
  else:
    print("No")
  tmp = tmp_tmp

Submission status: Time Limit Exceeded

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

tmp = 1

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

for i in range(K,C):
  if tmp < (tmp / A[i-K]) * A[i]:
    print("Yes")
  else:
    print("No")
  tmp = (tmp / A[i-K]) * A[i]

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def listmul(l):
    ans=1
    for i in l:
        ans*=i
        
    return ans

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

k=k-1

l1=[]
t=0
for i in range(k,n):
    l1.append(listmul(l[t:i+1]))
    t+=1
    
for i in range(1,len(l1)):
    if(l1[i]>l1[i-1] ):print("Yes")
    else:print("No")

Submission status: Time Limit Exceeded

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n,k = LI()
a = LI()
tmp = 1
for i in range(k):
    tmp *= a[i]

for i in range(k, n):
    tmp1 = tmp
    tmp1 *= a[i]
    tmp1 //= a[i-k]
    if tmp < tmp1:
        print('Yes')
    else:
        print('No')
    tmp = tmp1

Submission status: Time Limit Exceeded

Solution code:
n,k=map(int,input().split())
a=[int(x) for x in input().rstrip().split()]
ruiseki=[a[0]]
for i in range(1,n):
    if k<=i:
        ruiseki.append((a[i]*ruiseki[i-1])//(a[i-k]))
    else:
        ruiseki.append((a[i]*ruiseki[i-1]))

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

Submission status: Time Limit Exceeded

Solution code:
import math
import collections
import fractions
import itertools
import functools
import operator

def solve():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    ruiseki = [1]
    for i in range(1, n+1):
        ruiseki.append(a[i-1]*ruiseki[i-1])
    for i in range(k-1, n-1):
        if ruiseki[i+1]//ruiseki[i-k+1] >= ruiseki[i+2]//ruiseki[i+2-k]:
            print("No")
        else:
            print("Yes")
    return 0

if __name__ == "__main__":
    solve()

Submission status: Time Limit Exceeded

Solution code:
def Calculator(n, K):
    ans = 1
    for i in range(K):
        ans = ans* n[i]
    return ans

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

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

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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)
#print(a)
l=0
k=n[1]
for i in range(0,n[0]-n[1]):
  x//=m[l]
  x*=m[k]
  a.append(x)
  #print(a)
  l+=1
  k+=1
for i in range(0,len(a)-1):
    if(a[i]<a[i+1]):
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

# 累積積
AC = [1]
for a in A:
    AC.append(AC[-1]*a)
AC.pop(0)
# print(AC)

for i in range(k,n):
    if (i-1)-k < 0:
        prev = AC[i-1]
    else:
        prev = AC[i-1] / AC[(i-1)-k]
    
    if i-k < 0:
        now = AC[i]
    else:
        now = AC[i] / AC[i-k]
    # print(prev)
    # print(now)
    # print((i-1)-(k))
    # print(i-1)
    # print("****")
    # print(i-(k))
    # print(i)
    if prev < now:
        print("Yes")
    else:
        print("No")
    # print("----------")

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
#import math
#import numpy
#N = int(input())
def main():
    import sys
    input = sys.stdin.readline
    N, K = map(int,input().split())
    A = list(map(int,input().split()))
    #K =int(input())
    ANS = []
    a_ = 1
    for i in range(K):
        a_ *= A[K-i-1]
    #ANS.append(a)
    for i in range(K,N):
        if A[i-K] < A[i]:
            print("Yes")
        else:
            print("No")
        
        
        #ANS.append(a)
    #print(ANS)
    

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

S = []
cnt = 0
for i in range(K-1,N):
    s = 1
    for j in range(i,i-K,-1):
        s *= A[j]
    S.append(s)
    
    if cnt == 0:
        cnt += 1
        continue
    print("Yes" if S[cnt-1]<S[cnt] else "No")
    cnt += 1

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

Solution code:
"""
    Satwik_Tiwari ;) .
    24th july , 2020  - Friday
"""

#===============================================================================================
#importing some useful libraries.
from __future__ import division, print_function

from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase

from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter  # Counter(list)  return a dict with {key: count}
from itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]
from itertools import permutations as permutate
from bisect import bisect_left as bl
#If the element is already present in the list,
# the left most position where element has to be inserted is returned.
from bisect import bisect_right as br
from bisect import bisect
#If the element is already present in the list,
# the right most position where element has to be inserted is returned

#==============================================================================================
#fast I/O region
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")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

# inp = lambda: sys.stdin.readline().rstrip("\r\n")

#===============================================================================================
#some shortcuts

mod = 1000000007
def inp(): return sys.stdin.readline().rstrip("\r\n") #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
# def graph(vertex): return [[] for i in range(0,vertex+1)]
def zerolist(n): return [0]*n
def nextline(): out("\n")  #as stdout.write always print sring.
def testcase(t):
    for p in range(t):
        solve()
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def lcm(a,b): return (a*b)//gcd(a,b)
def power(a,b):
    ans = 1
    while(b>0):
        if(b%2==1):
            ans*=a
        a*=a
        b//=2
    return ans
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))
def isPrime(n) :
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

#===============================================================================================
# code here ;))

def solve():
    n,k = sep()
    a = lis()
    curr  = 1
    for i in range(k):
        curr*=a[i]
    temp = []
    for i in range(k,n):
        if(a[i] > a[i-k]):
            temp.append('Yes')
        else:
            temp.append('No')
    for i in range(len(temp)):
        print(temp[i])




testcase(1)
# testcase(int(inp()))

Submission status: Time Limit Exceeded

Solution code:
"""
    Satwik_Tiwari ;) .
    24th july , 2020  - Friday
"""

#===============================================================================================
#importing some useful libraries.
from __future__ import division, print_function

from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase

from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter  # Counter(list)  return a dict with {key: count}
from itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]
from itertools import permutations as permutate
from bisect import bisect_left as bl
#If the element is already present in the list,
# the left most position where element has to be inserted is returned.
from bisect import bisect_right as br
from bisect import bisect
#If the element is already present in the list,
# the right most position where element has to be inserted is returned

#==============================================================================================
#fast I/O region
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")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

# inp = lambda: sys.stdin.readline().rstrip("\r\n")

#===============================================================================================
#some shortcuts

mod = 1000000007
def inp(): return sys.stdin.readline().rstrip("\r\n") #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
# def graph(vertex): return [[] for i in range(0,vertex+1)]
def zerolist(n): return [0]*n
def nextline(): out("\n")  #as stdout.write always print sring.
def testcase(t):
    for p in range(t):
        solve()
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def lcm(a,b): return (a*b)//gcd(a,b)
def power(a,b):
    ans = 1
    while(b>0):
        if(b%2==1):
            ans*=a
        a*=a
        b//=2
    return ans
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))
def isPrime(n) :
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

#===============================================================================================
# code here ;))

def solve():
    n,k = sep()
    a = lis()
    curr  = 1
    for i in range(k):
        curr*=a[i]
    temp = [curr]
    for i in range(k,n):
        curr*=a[i]
        curr//=a[i-k]
        temp.append(curr)
    for i in range(1,len(temp)):
        if(temp[i] > temp[i-1]):
            print('Yes')
        else:
            print('No')




testcase(1)
# testcase(int(inp()))

Submission status: Time Limit Exceeded

Solution code:
debug_mode=True
debug_mode=False
def dprint(x):
    if debug_mode: print(x)

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

score_k=1 # k学期までの評点
for i in range(k):
    score_k *= a[i]

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

Submission status: Time Limit Exceeded

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

# C - Marks
N, K = map(int, input().split())
A = list(map(int, input().split()))
score = 1

for i in range(N):
	if i < K:
		score *= A[i]
	else:
		new_score = score * A[i] // A[i-K]
		
		if new_score > score:
			print('Yes')
		else:
			print('No')
		
		score = new_score

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from collections import deque
from functools import lru_cache
import bisect
import re
import queue
import copy
import decimal


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


def solve():
    N, K = Scanner.map_int()
    A = Scanner.map_int()
    S = 1
    for i in range(K - 1):
        S *= A[i]
    for i in range(K, N):
        if A[i - K] < A[i]:
            print('Yes')
        else:
            print('No')


def main():
    # sys.setrecursionlimit(1000000)
    # sys.stdin = open("sample.txt")
    solve()


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
# C - Marks
from functools import reduce
from operator import mul


def main():
    N, K, *A = map(int, open(0).read().split())
    top_idx, prev_score = 0, reduce(mul, A[:K])
    res = []
    for top, cur in zip(A, A[K:]):
        cur_score = prev_score // top * cur
        res.append("Yes" if cur_score > prev_score else "No")
        prev_score = cur_score
    print("\n".join(res))


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

Solution code:
N, K = map(int, input().split())
score = list(map(int, input().split()))
hyouten = [1 for i in range(N-K+1)]
#i学期の評点。
for i in range(N-K+1):
  newlist = score[i:i+K]
  for j in newlist:
    hyouten[i] = hyouten[i] * j

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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


for i in range(1,N-K+1):
    score = 1
    p_score = 1

    for j in range(i, i+K):
        score = score * A[j]
        p_score = p_score * A[j-1]

    if score > p_score:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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


for i in range(1,N-K+1):
    score = 1
    p_score = 1

    for j in range(i, i+K):
        score = score * A[j]
        p_score = p_score * A[j-1]

    if score > p_score:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

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

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


for i in range(1, N-K+1):
    score = 1
    p_score = 1

    for j in range(i, i+K):
        score = score * A[j]
        p_score = p_score * A[j-1]

    if score > p_score:
        print("Yes")
    else:
        print("No")

Submission status: Time Limit Exceeded

Solution code:
#import 
#=input()
#int(input())
n,k=map(int,input().split())
a=list(map(int,input().split()))
#=[list(map(int,input().split())) for _ in range()]

for i in range(k,n):
    q = 1
    w = 1
    for j in range(k):
        q *= a[i-k+j]
        w *= a[i-j]
    if q < w:
        print('Yes')
    else:
        print('No')

Submission status: Time Limit Exceeded

Solution code:
N,K = map(int, input().split())
A = list(map(int, input().split()))
b = 1
c = 1
a = 0
while K < N:
    for i in range(a,K):
        b *= A[i]
    for j in range(a+1,K+1):
        c *= A[j]
    if c > b:
        print("Yes")
    else:print("No")
    b=1
    c=1
    K += 1
    a += 1

Submission status: Time Limit Exceeded

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


s1 = 1
s2 = 1
for i in range(k):
  s1 = s1 * a[i]
  s2 = s2 * a[i+1]

if s1 < s2:
  print("Yes")
else:
  print("No")


for i in range(1,n-k):
  s1 = s2
  s2 = int(s1 / a[i] * a[k+i])
    
  if s1 < s2:
    print("Yes")
  else:
    print("No")

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

score = 1
for a in A[:K]:
    score *= a

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

    score = tmp

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int, input().split())
a = [ int(x) for x in input().split() ] # list型で代入される。
t = []
p = 1

for i in range(n):
    if i < k:
        p *= a[i]
    else:
        p //= a[i-k]
        p *= a[i]

    if i >= k-1:
        t.append(p)

    if i >= k and t[len(t)-2] < t[len(t)-1]:
        print('Yes')
    elif i >= k and t[len(t)-2] >= t[len(t)-1]:
        print('No')

Submission status: Time Limit Exceeded

Solution code:
n, k = map(int,input().split())
a = input().split()
ls = []
times = 1

for j in range(0,(n-k)+1):
    for i in range(j,j+k):
        times *= int(a[i])
    ls.append(times)
    times = 1

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

Submission status: Time Limit Exceeded

Solution code:
def marks_C():
    N, K = map(int, input().split())
    scores = tuple(map(int, input().split()))

    for i, k in enumerate(range(K, N)):

        total_i = 1
        for s in scores[i:k]:
            total_i *= s

        total_i2 = 1
        for s in scores[i + 1:k + 1]:
            total_i2 *= s

        if total_i2 > total_i:
            print('Yes')
        else:
            print('No')

marks_C()

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
import functools
import operator

N, K = map(int, input().split())
performance = list(map(int, input().split()))
performance_A = []

for i in range(0, N-K+1):
  performance_A.append(performance[i:i+K])

for i in range(len(performance_A)-1):
  if functools.reduce(operator.mul, performance_A[i]) < functools.reduce(operator.mul, performance_A[i+1]):
    print("Yes")
  else:
    print("No")

Submission status: Time Limit Exceeded

Solution code:
#MSOL C 修正

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

def checker(i):
  l1 = A[i-K+1:i:]
  i1 = A[i-K]
  i2 = A[i]
  if i1 < i2:
    return "Yes"
  else:
    return "No"

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