Page 1 of 1

11883 - Repairing a Road

Posted: Mon Nov 01, 2010 8:13 am
by asif_iut

Code: Select all

cut after AC

Re: 11883

Posted: Tue Nov 02, 2010 6:09 pm
by bm_anas
After a quick overview i found a bug to your problem. you take the input N and R and instead of taking R roads you are taking N roads of information.

However if you correct this i think you will get tle.......
In the warshall() function u used a loop
for( double x = 0.00; x <= v[z][l]; x += eps ) where your eps is 1e-6
this will lead to tle......

Re: 11883

Posted: Tue Nov 02, 2010 8:09 pm
by asif_iut
thanks a lot bm_anas...i made a stupid error as well as reduced the eps to 1e-2 and AC!!!! thanks once again... :D

Re: 11883

Posted: Wed Nov 03, 2010 5:14 am
by rujialiu
asif_iut wrote:thanks a lot bm_anas...i made a stupid error as well as reduced the eps to 1e-2 and AC!!!! thanks once again... :D
oops, this is not the intended way to solve this problem. The test cases are not strong enough but I admit that I have no idea how to generate good ones. Any one has some ideas?

Re: 11883

Posted: Fri Nov 05, 2010 5:56 pm
by asif_iut
oops, this is not the intended way to solve this problem. The test cases are not strong enough but I admit that I have no idea how to generate good ones. Any one has some ideas?
what should have been the idea for solving this problem??

Re: 11883

Posted: Sat Nov 06, 2010 10:02 am
by rujialiu
asif_iut wrote:what should have been the idea for solving this problem??
you may take a look at this: http://en.wikipedia.org/wiki/Ternary_search

Re: 11883

Posted: Mon Nov 08, 2010 8:12 pm
by bm_anas
I solved this problem using Dijkstra and Differentiation..... :D