|
|
вернуться в форумWhat happened with my program on Test #24? My algorithm is linear, except the quicksort procedure. It gets TLE at Test #24. What happened? I have checked the program multiple times. Thanks. Re: What happened with my program on Test #24? It's very weird - almost happened to me too (0.934 sec, dunno which test). After that I switched to 'int' and kept 'double' only for boundaries - it became 0.5 sec. Then I precalculated 1.0/(y[i+1]-y[i]) - timing didn't change. Then I suspected it was some anti-qsort case, tried to random-shuffle, even tried heapsort - no matter, still 0.5 sec. Then I've noticed that I am submitting it as GCC instead of VisualC (was testing another problem before on GCC/clang) - got 0.171 sec with same code :) GCC suxx. Dunno if it's input or sorting or what. I was using scanf/printf (cin/cout are slower in VisualC even with iostream::sync_with_stdio(false)). |
|
|