|
|
back to boardA USEFUL HINT for those TLE authors!!! Many people got TLE on this problem. However, there are ways to avoid TLE. I viewed some topics before, and they told me to use vectors instead of float numbers. I tried, but it doesn't work for my bad programming. After that, I tried to think another way... Many people got TLE, but they only use 7 or 8 sec. Here is a method to make the time derive to half: First, find all avaliable task, and assume the staring point is No.0 then, instead of calculating all the shortest paths, we can calculate this: Shortest from No.1 to No.0 and No.2, (add them up) Shortest from No.3 to No.2 and No.4, (add them up) ...... thus we can easily save half of the time, and My program got AC in 2.8 sec (previously TLE) Sorry for my bad English. Good luck for EVERYONE~ |
|
|