← All problemsSign in

Evil Infection

CodeChefRating 2723Open on judge ↗

$N$ people ordered $N$ takeouts at the same place. The arrival time of the $i^{th}$ takeout is $X_i$, and the arrival time of the $i^{th}$ person is $Y_i$ where $X_i < Y_i$. Also $X_1 < X_2 < \ldots < X_N$ and all $X_i, Y_i$ values are distinct (i.e. $X_i \ne X_j$ for all $i, j$; $Y_i \ne Y_j$ for all $i,j$; $X_i \ne Y_j$ for all $i,j$). Originally, everyone could happily get their own takeout,

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