Co-operate with House
CodeChefOpen on judge ↗
Doctor house as we all know hates clinic duty and Doctor Cuddy assigned him his favorite job. Doctor house has n patients and he mentally estimates the co-operation value of the ith patient to be ai. The ith patient takes ti time for the appointment. Doctor House plans on working only for t units. He wants you to write a program such that he maximises co-operation and works at most t units. Out
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