
-----------------------------------
A.J
Wed Oct 21, 2009 5:21 pm

#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

-----------------------------------
Tony
Wed Oct 21, 2009 5:39 pm

RE:#5 on DWITE
-----------------------------------

2
1 2
2 2
5
1 2
1 3
3 2
1 4
4 1 

2nd case -- the cycle is 2 -> 2 -> 2

3rd case -- the cycle is 1 -> 4 -> 1

-----------------------------------
Dan
Wed Oct 21, 2009 5:43 pm

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.

-----------------------------------
Analysis Mode
Wed Oct 21, 2009 10:53 pm

RE:#5 on DWITE
-----------------------------------
The answer in this case:

2 
1 2 
2 2

is 1 right?

-----------------------------------
Tony
Wed Oct 21, 2009 11:23 pm

Re: RE:#5 on DWITE
-----------------------------------
The answer in this case:

2 
1 2 
2 2

is 1 right?
yes.
