21FA - 07 Cactus Farm
CodeChefOpen on judge ↗
Porco the Porcupine has a farm and is trying to grow a line of cactuses to the right of his farm. The line has plots of soil in a line and a cactus seed in each. He also has a machine that holds a line of $n$ hoses such that hoses can hover above the $i$-th to $(i + n - 1)$-th (inclusive) plot for some $i$. If he activates the hoses, special water drops below which instantly grow the cactus seed.
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