|
|
вернуться в форумПоказать все сообщения Спрятать все сообщенияI get "Time Limit Exceeded" error on 9 test. Time: 0.281, Size: 424KB I implemented Burrows - Wheeler algorithm in C++ in quite straight forward way (even without sorting). What could be the problem and how it is possible to make it faster? I found the problem. It was using 'string' class instead of just char array. Probably when a string is long (100000 characters) then C++ allocate its memory in chucnks which make its access much more slower (or maybe because some limit checks). Anyway, when I changes it to char array, it's running time was at least 10 time faster!!! |
|
|