|
|
вернуться в форумCompiler time differences So my algo is to have a vector of pairs(value and index), sort them(used usual <algorithm> sort), and then binary searched each request - first by value, and if value was correct, by index. The program ACed, on G++11 compiler with 0.921 time. when I removed the inclusion of <cstdlib>, it ACed with 0.859(and same on G++14). But funny thing is, on Visual C++ 2010, it ACed with 0.593s time, which is astounding(to me at least) because the difference is quite noticeable(25% drop). So I guess if you are getting TLE, it's worth a try to run it with Visual C++ - you might get a pass this way. Edited by author 17.01.2015 15:10 |
|
|