← All problemsSign in

Three-People Contests

CodeChefRating 2832Open on judge ↗

Chef is organizing "Three-People Contests" for his nephews. Alice, Bob, and Charles took part in $N$ contests, where, in the $i^{th}$ contest, they got $A_i$ , $B_i$ , and $C_i$ points respectively. For each person, find the **longest** subarray $[L, R]$, such that the person gets the first place if we only consider the contests in the range $[L, R]$. The length of such subarray is $(R-L+1)$, or

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start