← All problemsSign in

Trump and Matrix

You are given N*N matrix A filled with integers, which represents map of a state. Donald Trump wants to go from a position (sx,sy) to cell (dx,dy) . From cell (x, y) Donald can go to (x+1, y), (x, y+1), (x-1, y), (x, y-1). But Donald has many enemies which control many cells. If A[x][y]=P then this cell is in control of his enemy P(0 Input First line contains number T donating number of testc

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