No Queries No Fun
Maybe Fulu is not so good at writing codes for median elements, but solving problems with queries is really easy for him. Today, he decided to give you one hard problem with queries from his national contest. You are given two sequences $A$ and $B$, each with length $N$ ($1$-indexed), and $Q$ queries. There are four types of queries: - $1\; l\; r$ — find $\mathrm{max}(A_l, A_{l+1}, \dots, A_r)$ -
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start