Posted: Wed Oct 21, 2009 5:21 pm Post subject: #5 on DWITE
THe question stated that "We know that one (and only one) cycle exists, and we want to find its length.", but the 2nd and the 3rd testcases had 2 cycles on them...
My program solved everything excpet for those 2 particular testcases, assuming that there were only one cycle...only
Sponsor Sponsor
Tony
Posted: Wed Oct 21, 2009 5:39 pm Post subject: RE:#5 on DWITE
Posted: Wed Oct 21, 2009 5:43 pm Post subject: RE:#5 on DWITE
The edges are directional so well there may be mutipal cycles if you ignore the direction between the nodes there should only be one if you consider wich way the edge is going.
For example in 2nd case (that was used not in the sample) node 2 is a dead end and does not form a loop with the other nodes.
Computer Science CanadaHelp with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Analysis Mode
Posted: Wed Oct 21, 2009 10:53 pm Post subject: RE:#5 on DWITE
The answer in this case:
2
1 2
2 2
is 1 right?
Tony
Posted: Wed Oct 21, 2009 11:23 pm Post subject: Re: RE:#5 on DWITE