SEGMENT MAXIMA
CodeChefOpen on judge ↗
In the King's court, there is a bitter rivalry between the Mathematician and the Jester. The King gives both of them an array A, and then the Mathematician begins asking the jester: "What is the maximum value of the elements of the array between position i and j?" The jester, being lazy, doesn't compute the maximum of all the elements, instead he just computes the maximum between the value A[i] a
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