← All problemsSign in

Elevator Rides

CSESDynamic ProgrammingOpen on judge ↗

There are n people who want to get to the top of a building which has only one elevator. You know the weight of each person and the maximum allowed weight in the elevator. What is the minimum number of elevator rides? Input The first input line has two integers n and x: the number of people and the maximum allowed weight in the elevator. The second line has n integers w_1,w_2,\dots,w_n: the wei

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