Help me on "SPOJ — CAPCITY" [ TLE ]

Revision en1, by codexaxor, 2019-06-27 20:48:47

In this problem I have applied normal DFS technique. But when I got TLE for the first time then I shift all i/o to scanf/printf thought it would be helpful. Then I googled for this problem and there used SCC(strongly connected components) technique. Now I want to know why 2-DFS technique is faster from 1-DFS technique here. Would someone explain this for me. my solution in c++ solution problem link problem on SPOJ

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English codexaxor 2019-06-27 20:48:47 525 Initial revision (published)