report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Subarray minimum - MarisaOJ: Marisa Online Judge

Subarray minimum

Time limit: 1000 ms
Memory limit: 256 MB
Consider an array $A$ consisting of $n$ integers. For each subarray of length $k$, find its minimum value. ### Input - The first line contains two integers $n,k$. - The second line contains $n$ integers $A_i$. ### Output - Print $n - k + 1$ integers, the $i^{th}$ is the minimum value in the subarray $A_{i,i+k-1}$. ### Constraints - $1 \le n,k \le 10^5$. - $1 \le A_i \le 10^9$. ### Example Input: ``` 3 2 1 2 3 ``` Output: ``` 1 2 ```
Monotonic queue
Nearest position
Subarray minimum
Peak Product
Histogram
Maximum subsequence value
Deleting digits
Electric poles
Planting flowers
Ring road
Prefix minimum
Knee surgery
Topic
Data structure
Rating 1300
Solution (0) Solution