#P1440. 求m区间内的最小值
求m区间内的最小值
Description
Given a sequence with terms, for each term, find the minimum within the interval consisting of the previous numbers before it. If there are fewer than previous numbers, start from the first number. If there are no previous numbers, output .
Input Format
The first line contains two integers , .
The second line contains positive integers, which form the given sequence .
Output Format
Output lines, one integer per line. The -th number is the minimum among the numbers before in the sequence.
6 2
7 8 1 4 3 2
0
7
7
1
1
3
Hint
For of the testdata, it is guaranteed that , .
Translated by ChatGPT 5
京公网安备 11011102002149号