Counting Trees
CodeChefOpen on judge ↗
Mr. Devu Singh has a farm. The farm is represented as a matrix, divided into rows and columns, with each element being equal to 1, if the corresponding area in the farm contains a tree, and 0 otherwise. Every element in the farm can contain atmost one tree. Mr. Devu Singh loves his farm. However, Devu Singh has a short memory. He cannot remember which of the elements in the farm has a tree in the
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