Pudge and his Subsequence
CodeChefOpen on judge ↗
Pudge has a lot of love for numbers. One day, he found an array of numbers of size $n$ and decided to give a task to his friend Necro to see if he is able to do it. He asked Necro to create a subsequence of size k. But everything in life comes at a cost. Similarly, every subsequence $s$ has a cost associated with it. Pudge defines the cost as the minimum between: - The maximum of all numbers at
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