How to solve the this DFS problem ?

Правка en1, от alwaysGREEEN, 2018-07-18 17:29:07

MILITARY PROBLEM

I am trying to solve this problem by running dfs from every node. I am getting TLE verdict. Please help me speed up my solution

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский alwaysGREEEN 2018-07-18 17:29:07 230 Initial revision (published)