Need help on problem AKBAR — SPOJ

Правка en1, от MS1908, 2019-11-28 05:10:31

I'm currently trying to solve problem AKBAR from SPOJ. My idea is to do BFS from each soldier based on strength of that soldier, and then if there is a city that is protected by 2 soldiers, or if in the end, there is a city that is not protected then the answer is No, otherwise Yes. But for some reason, my code got WA verdict. Any help on why this happened will be really appreciated.

My code: https://ideone.com/7cGTFC

Теги #bfs, #spoj

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский MS1908 2019-11-28 05:10:31 497 Initial revision (published)