Изменения рейтингов за последние раунды временно удалены. Скоро они будут возвращены. ×

Help with spoj problem AKBAR

Правка en1, от paramsingh, 2016-03-10 18:56:00

Hi there. I've been trying to solve http://www.spoj.com/problems/AKBAR/ for some time, but the only thing I can seem to come up with is starting a BFS from each of the soldiers as the source until the soldier's strength depth. However, that approach gives me a TLE. Any help regarding how to solve this problem would be appreciated. Thanks.

Here's the code for my approach that I tried (TLE): https://gist.github.com/paramsingh/81d728295e6bd01860a0

Теги spoj, bfs

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский paramsingh 2016-03-10 18:56:00 482 Initial revision (published)