← Back to topics
Topic

z-cycle WA in the last test case

h
hendrik
Someone please help me...
I got WA in the last test case..


This is my code:
http://www.z-trening.com/new/www/html/submit.php?submit=7100049911&subm_code=1

Thx
h
hendrik
found any bugs...?? or errors?? or wrong algorithms?
g
gates
why result must be cost of 2 flows? with that you can get both flows going through same vertex
h
hendrik
thx for replying...so what's the correct one?
could u please tell me..?
g
gates
bellman ford
h
hendrik
bellman ford? I have used bellman ford in my program...
u mean there are bugs in bellman ford part?
g
gates
Your solution are 2 flows,am I right?
h
hendrik
ok2..so is this what u mean? I must set 1->1' 1 flow? and 2-2' .. n-n' 1 flow?
h
hendrik
@gates. : I think I am on the right path now.. but I got TLE ..Any idea?...I really needs your help Thx..

@ all: Please help me...
g
gates
you have MLE, but it shows TLE
f
fushar
how to use bellman-ford in this problem?
d
dejandenib
The last test case is wrong. Or i understood the task wrong. From the node number 1 there are only two edges and they both point to node number 2.So there doesn't exist a cycle which doesn't visit node 2 twice.
I just hope admin fixes this soon.
And VEEEERRRYYYY weird. How so many submissions got accepted !?!?!