← All problemsSign in

Pretty Boxes

CodeChefRating 2929Open on judge ↗

Taeyeon has a large collection of $N$ pretty boxes (numbered $1$ through $N$). For each valid $i$, the $i$-th box has two attributes $S_i$ and $P_i$, representing the size and beauty of the box respectively, and it can fit inside each box $j$ such that $S_i \le S_j$. (Don't ask why a box can fit into another box with the same size.) Yoona's birthday is coming very soon, so Taeyeon decided to gi

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