|  | 
|  | 
| back to board | TLE on #46 Posted by Talgat  2 Jun 2015 19:34I'm using BS + Dijkstra but I'm getting TLE, why? I optimized solution by using edges that have capacity >= 3 * 10^6, implemented BS with iterations (without "while"), but keep getting TLE.Re: TLE on #46 I had TLE 46 when i was checking for time[N] <= 1440 only after my BFS was complete. But when i moved this condition inside my BFS, to check on it after getting every new wave of vertices, i got AC in 0.078! Truly surprising, wasn't expecting to make that much difference by moving a single line. My BFS shouldn't really be that bad either... | 
 | 
|