report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Yet another problem - FlandreOJ: Flandre Online Judge

Yet another problem

Time limit: 1000 ms
Memory limit: 256 MB
Given an array $A$ of $n$ integers and $q$ queries, each is an integers $k$. For each query, find the longest subarray contains only elements not bigger than $k$. ### Input - The first line contains 2 integers $n, q$. - The second line contains $n$ integers $A_i$. - The next $q$ lines, each line contains an integer $k$, a query. ### Output - Print $q$ lines, the $i^{th}$ is the answer to query $i$. ### Constraints - $1 \le n \le 10^5$. - $0 \le |A_i|, |k| \le 10^9$. ### Example Input: ``` 6 4 -2 5 6 10 -5 0 -10 5 -4 11 ``` Output: ``` 0 2 1 6 ```
Disjoint Set Union (DSU)
DSU
Component sum
Minimum spanning tree
Parking
Remove edge
Yet another problem
Assignment query on tree
Watering
Minimum spanning tree 2
Fatal meal
Statement
All pairs
Query on tree
Minimum spanning tree 3
Topic
DSU
Rating 1200
Solution (2) Solution