Lord Neel
CodeChefOpen on judge ↗
Lord Neel has ordered you to make a new civilization on a planet and you have to design the terrain of the planet. The planet has N blocks of land. The first block is the godly block you cannot change its height. For the next N-1 blocks, you can cut them to any height you want. You want to maximize the sum of difference between the heights of adjacent blocks. Find the maximum sum of differences po
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