|
|
back to boardCommon Board1031. Time LImmit Exceded I use simple dynamic programing and get TLE. Have you calculated your time for this problem, becose almost everyone has got TLE.??? Re: 1031. Time Limit Exceded Do you use loops like for(i=CurrentStation-1; i>=InitialStation; i--) { if(Cost[i]+ticketcost(i,CurrentStation)<Cost[Current...] ? If yes, you should get TLE if you traverse all stations but not those nearer that L3. I got accepted in 1.94 sec on my first try. Re: 1031. Time Limit Exceded > Do you use loops like > > for(i=CurrentStation-1; i>=InitialStation; i--) { > if(Cost[i]+ticketcost(i,CurrentStation)<Cost [Current...] ? > >>>I think no. > If yes, you should get TLE if you traverse all stations but > not those nearer that L3. I got accepted in 1.94 sec on my > first try. I use this i:=Curent_Statin; while (i>Initial_Station) and (Distance(Curent,i)<L3) do .... Re: 1031. Time Limit Exceded Ha. I got ACC with 2:89 sek. I think the time limmit was 2:00 sek????? Re: 1031. Time Limit Exceded > Ha. > I got ACC with 2:89 sek. > I think the time limmit was 2:00 sek????? > New time limit is 3 seconds. |
|
|