Блог пользователя ktkrsk

Автор ktkrsk, история, 4 года назад, По-английски

Hi, I'm trying to solve this SPOJ problem. The simplest BFS for each node works for C++ but not for C#(time constrains). I tried to optimize it a little by spliting the graph into strongly connected components but to no avail — the TLE is still here. I'm wondering is it possible to solve this problem in C# or is the dataset too big / time constrait too low? Is there some special algorithm to solve this problem faster than BFS for each node seperated into SCC? Please help.

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится