Getting Flowers
CodeChefOpen on judge ↗
Romeo wants to get some roses for Juliet and so he goes into a garden. The garden is in the shape of a H x W rectangle, where there are H rows and W columns. Each unit square of the garden has 1 to 100 flowers in it. Romeo has to grab as many flowers as possible, subject to the following restrictions: He starts by choosing any square in the first row, and collects the flowers on that square. Then
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