ktkrsk's blog

By ktkrsk, history, 4 years ago, In English

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.

  • Vote: I like it
  • 0
  • Vote: I do not like it