← All problemsSign in

Valet Parking

CodeChefRating 2397Open on judge ↗

Your friend works as a valet where $N$ cars show up in a shift. The $i$-th car will arrive $T_i$ seconds after the current moment, and the car can wait for at most $Y_i$ seconds. That is, your friend can only start parking the car from time $T_i$ to $T_i+Y_i$ (inclusive). Additionally, it takes $X_i$ time to park the $i$-th car, which means he cannot park any other cars for $X_i$ seconds starti

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