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: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

cumsum = [0 for _ in range(N + 1)]
for i in range(N):
    cumsum[i + 1] = cumsum[i] + A[i]

for i in range(N):
    if i <= K - 1:
        continue

    prev = cumsum[i] - cumsum[i - K]
    now = cumsum[i + 1] - cumsum[i - K + 1]
    if now > prev:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(K,N):
  iscore = a_list[i]
  i_score = a_list[i-K]
  print('Yes' if iscore > i_score else 'No')

Submission status: Accepted

Solution code:
from collections import deque
n,k = map(int,input().split())
alist = list(map(int,input().split()))
frontque = deque(alist[:k])
backque =  deque(alist[k:])

for i in range(n-k):
    back = backque.popleft()
    front = frontque.popleft()
    if front < back:
        print('Yes')
    else:
        print('No')
    frontque.append(back)

Submission status: Accepted

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

j = 0
for i in arr[k:]:
	if i > arr[j]:print('Yes')
	else:print('No')
	j += 1

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	C
# CreatedDate:  2020-07-25 21:12:47 +0900
# LastModified: 2020-07-25 21:24:23 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    for i in range(n-k):
#        print("a[{}]-a[{}]:{}-{}={}".format(k+i, i, a[k+i], a[i], a[k+i]-a[i]))
        if a[k+i] > a[i]:
            print("Yes")
        else:
            print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n,k = mi()
a = li()

pre = a[0]
cnt=0
for i in range(k,n,1):
    if pre < a[i]:
        print("Yes")
    else:
        print("No")
    cnt+=1
    pre = a[cnt]

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n,k = map(int,readline().split())
a = list(map(int,readline().split()))
for i in range(n-k):
  chk = a[k+i]
  c = a[i]
  if chk > c:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

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

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

#print(res)
for b in res:
    if(b): print("Yes")
    else: print("No")

Submission status: Accepted

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

import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union
# import time
# import math, cmath
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
from collections import deque                 # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import _heapify_max, _heappop_max, _siftdown_max
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import Fraction               # Fraction(a, b) => a / b ∈ Q. note: Fraction(0.1) do not returns Fraciton(1, 10). Fraction('0.1') returns Fraction(1, 10)



def main():
    Num = Union[int, float]
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79e+308
    # inf = 2 ** 63 - 1             # (for fast JIT compile in PyPy) 9.22e+18
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input():  return sys.stdin.readline().rstrip()
    def ii():     return int(input())
    def isp():    return input().split()
    def mi():     return map(int, input().split())
    def mi_0():   return map(lambda x: int(x)-1, input().split())
    def lmi():    return list(map(int, input().split()))
    def lmi_0():  return list(map(lambda x: int(x)-1, input().split()))
    def li():     return list(input())
    def debug(x): print(x, file=sys.stderr)
    # def _heappush_max(h, item): h.append(item); _siftdown_max(h, 0, len(h)-1)
    
    
    n, k = mi()
    L = lmi()

    buf = deque(L[:k])
    for i in range(k, n):
        head = buf.popleft()
        tail = L[i]
        if head < tail:
            print('Yes')
        else:
            print('No')
        buf.append(tail)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


def solve(N: int, K: int, A: "List[int]"):
    for k in range(N-K):
        if A[k] < A[K+k]:
            print("Yes")
        else:
            print("No")
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, A)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
a = [int(x) for x in input().split()]
a.insert(0,0)
for i in range(K,N):
    if a[i-K+1]<a[i+1]:
        print("Yes")
    else: print("No")

Submission status: Accepted

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

Submission status: Accepted

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

a = list(map(lambda x: x - ma, a))

befscore = 1
score = 1
f = True
for i in range(n):
    score = score + a[i]

    if i >= k:
        score = int(score - a[i - k])
        if befscore >= score:
            print("No")
        else:
            print("Yes")

    befscore = score

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for k in range(N - K):
    
    hel = l[k]
    huel = l[k + K]
    
    if (hel < huel):
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
#N, K = (int(i) for i in input().split())
#B = [int(x) for x in input().split()]
#A = [[int(i) for i in input().split()] for i in range(N)]

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

for i in range(K, N):
    if A[i - K] < A[i]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
import sys

n, k = map(int, sys.stdin.readline().split())
a = list(map(int, sys.stdin.readline().split()))

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

Submission status: Accepted

Solution code:
import math

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

log_A = [math.log(a) for a in A]

evaluations = [0]*(N-K+1)
evaluations[0] = sum(log_A[:K])

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n,k=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("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(N):
    A[i]=math.log10(A[i])
max=0
for i in range(K):
    max+=A[i]
for i in range(K,N):
    if max<max-A[i-K]+A[i]:
        print("Yes")
        max=max-A[i-K]+A[i]
    else:
        print("No")

Submission status: Accepted

Solution code:
def resolve():
  N, K = map(int, input().split(" "))
  A = [int(x) for x in input().split(" ")]
  
  for i in range(K, N):
    if A[i-K] < A[i]:
      print("Yes")
    else:
      print("No")

if __name__ == "__main__":
  resolve()

Submission status: Accepted

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

Submission status: Accepted

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

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, K: int, A: "List[int]"):
    for k in range(N-K):
        if A[k] < A[K+k]:
            print(YES)
        else:
            print(NO)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, A)

if __name__ == '__main__':
    main()

Submission status: Accepted

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 = 1

Submission status: Accepted

Solution code:
import sys
import re
import math
import collections
import decimal
import bisect
import itertools
import fractions
import functools
import copy
import heapq
import decimal
import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10 ** 9)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===

def main():
    n, k = ns()
    a = na()

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

    for i in range(k, n):
        # crnt = (prev // a[i - k]) * a[i]

        print("Yes" if a[i] > a[i-k] else "No")
        # prev = crnt


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N,K = 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("No")

Submission status: Accepted

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

for k in range(N-K):
    if A[k]<A[k+K]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

for i in range(k, n):

    if li[i-k] < li[i]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
# print('input >>')
N, K = map(int,(input().split()))
As = list(map(int,(input().split())))

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

# print('-----output-----')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np    # cumsum
# from bisect import bisect_left, bisect_right

def solve():
    N, K = MI()
    A = LI()

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

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 25 20:54:45 2020

@author: naoki
"""

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

for i in range(N-K):
    a = A[i]
    b = A[i+K]
    if a<b:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
from decimal import Decimal

n,k = map(int,input().split())
a = list(map(lambda x:Decimal(int(x)),input().split()))

m = max(a)

for i in range(len(a)):
    a[i] = a[i]/m
temp = Decimal(1)
res = []
for i in range(k):
    temp *= a[i]

res = [temp]
for i in range(k,n):
    temp *= a[i]
    temp /= a[i-k]
    res.append(temp)
for i in range(len(res)-1):
    if(res[i] < res[i+1]):
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n, k = 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('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools


#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]

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

for i in range(K, N):
  ans = A[i]-A[i-K]
  if(ans<=0):
    print("No")
  else:
    print("Yes")

Submission status: Accepted

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

prev_grade = 1.

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

Submission status: Accepted

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

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

resolve()

Submission status: Accepted

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

ans_list = []

for i in range(n-k):
  if a[i + k] > a[i]:
    ans_list.append('Yes')
  else:
    ans_list.append('No')

for j in range(len(ans_list)):
  print(ans_list[j])

Submission status: Accepted

Solution code:
from collections import deque
n,k = map(int,input().split())
a = list(map(int,input().split()))
Q = deque()
for i in range(k):
  Q.append(a[i])
for i in range(k,n):
  head = Q.popleft()
  end = a[i]
  if head<end:
    print('Yes')
  else:
    print('No')
  Q.append(end)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

#!/usr/bin/python
# -*- coding: utf-8 -*-

import numpy as np

def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(input()))
    return np.array(x)

N,K = 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('No')

Submission status: Accepted

Solution code:
import os
import heapq
import sys
import math
import operator
from collections import defaultdict
from io import BytesIO, IOBase


"""def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)"""

"""def pw(a,b):
    result=1
    while(b>0):
        if(b%2==1): result*=a
        a*=a
        b//=2
    return result"""



def inpt():
    return [int(k) for k in input().split()]


def main():
    n,k=map(int,input().split())
    ar=inpt()
    j=0
    for i in range(k,n):
        if(ar[j]<ar[i]):
            print('Yes')
        else:
            print('No')
        j+=1


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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:

def main():
  n, k = map(int, input().split())
  A = tuple(map(int, input().split()))

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



main()

Submission status: Accepted

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

first = 0
last = 0

for i in range(NK[1], NK[0]):
    first = A[i - NK[1]]
    last = A[i]
    if (first < last):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

import functools


def judge(n, k, bs):
    for i in range(k, n):
        prev_first = bs[i - k]
        new_last = bs[i]
        yield prev_first < new_last


def main():
    n, k = (int(x) for x in input().split())
    bs = [int(b) for b in input().split()]
    for res in judge(n, k, bs):
        if res:
            print("Yes")
        else:
            print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

if __name__=='__main__':
    n,k,a=readinput()
    main(n,k,a)

Submission status: Accepted

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

def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    for i in range(k, n):
        if a[i-k] < a[i]:
            print("Yes")
        else:
            print("No")

if __name__ == '__main__':
    main()

Submission status: Accepted

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

for i in range(K, N):
    if A[i-K] < A[i]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

for i,j in zip(range(K, N), range(N-K)):
    print("Yes" if A[i] > A[j] else "No")

Submission status: Accepted

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

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

Submission status: Accepted

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


for i in range(K,N):
  # print(i,K, A[i], A[K])
  if A[i-K]<A[i]:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
import math as m

n,k = map(int,input().split())
a = list(map(int,input().split()))
prev = 1
for i in range(k):
  prev += m.log(a[i])
for i in range(k,n):
  cur = prev + m.log(a[i])
  cur -= m.log(a[i-k])
  print("Yes" if cur > prev else "No")
  prev = cur

Submission status: Accepted

Solution code:



def m():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    for i in range(N-K):
        left = A[i]
        right = A[K+i]
        if left < right:
            print('Yes')
        else:
            print('No')


m()

Submission status: Accepted

Solution code:
N, K = map(int, input().split())
scores = list(map(int, input().split())) # スペース区切りを受け取る場合

# 積の同じ部分は考慮しなくて良い
for i in range(K, N):
    bef = scores[i - K]
    aft = scores[i]

    if aft > bef:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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