← All problemsSign in

ChefTown Parade

CodeChefRating 1882Open on judge ↗

ChefTown is the biggest city and the capital of ChefLand. There are N beautiful buildings: restaurants, museums, living houses with large kitchens and so on. Every building has its height. For every i (1- Imagine, that we have a segment [L,R]. - Let K=R-L+1 be the length of this segment, and B be a list of heights of the buildings that belong to this segment. - Let's sort B in non-decreasing ord

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