← All problemsSign in

Maximise Score

CodeChefRating 3074Open on judge ↗

You are given $N$ segments where each segment is of the form $[L_i,R_i]$ $(1 \leq L_i \leq R_i \leq N)$. It is ensured that for any two segments $X$ and $Y$, one of the following conditions hold true: - $X \cap Y = X $, - $X \cap Y = Y $, or - $X \cap Y = \emptyset$ (empty set) Note that $\cap$ denotes the [intersection](https://en.wikipedia.org/wiki/Intersection_(set_theory)) of segments. In

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