Shizukas Photoframes
CodeChefOpen on judge ↗
Shizuka has $N$ photos of herself, each in a photoframe. The $i^{th}$ photoframe has width $W_i$ and height $H_i$ . A photoframe $i$ can fit inside another photoframe $j$ if $W_i$ ≤ $W_j$ and $H_i$ ≤ $H_j$. But if we allow rotation of photoframes by $90$ degrees, a photoframe $i$ can fit inside another photo frame $j$ if either $W_i$ ≤ $W_j$ and $H_i$ ≤ $H_j$ (when photoframe i is not rotated)
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