https://www.acmicpc.net/problem/14465
import sys
n, k, b = map(int, sys.stdin.readline().split())
arr = [0] * (n+1)
answer = sys.maxsize
prefix_sum = [0] * (n+1)
for _ in range(b):
i = int(sys.stdin.readline())
arr[i] = 1
for i in range(1, n+1):
prefix_sum[i] = prefix_sum[i-1] + arr[i]
for i in range(k, n+1):
answer = min(answer, prefix_sum[i] - prefix_sum[i-k])
print(answer)
좋은 정보 얻어갑니다, 감사합니다.