Red Blue Flowers
Chef has a garden containing $N$ cells. The $i$-th cell has $R_i$ red flowers and $B_i$ blue flowers. Chef can collect only one type of flowers (either red or blue) from each cell. Let $X$ denote the total number of red flowers Chef collects and $Y$ denote the total number of blue flowers Chef collects. Chef wants to **maximize** the value of $\mathrm{min}(X, Y)$. Can you help Chef? ### Input -
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