|
|
back to boardi just found no of storngly connected components and got ac in 0.562 sec after eliminating stack overflow with pragma. how to make it so fast as 0.031 sec and so little memory? You don't have to find strongly connected components. You can just sort vertices topologically and here you will find an answer :) But for topological sorting, graph must be DAG(directed acyclic)? i just keep getting stack overflow,could you please tell me how to eliminate it? |
|
|