← All problemsSign in

Machine Gun

CodeChefRating 2468Open on judge ↗

Country X has a military zone framed as a grid of size MxN. Each point of the grid could be free, occupied by a machine gun or by a protector. A machine gun at point (x, y) could automatically attack other guns at points (x-2, y-2), (x-2, y+2), (x+2, y-2) and (x+2, y+2). So we could not put two guns at points which make them destroy each others, unless there is a protector exactly in the middl

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start