|  | 
|  | 
| back to board | Discussion of Problem 1322. SpyTime Limit Exceeded Posted by VladG  2 Oct 2006 23:08I 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?
Re: Time Limit Exceeded Posted by VladG  2 Oct 2006 23:31I 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!!!
 | 
 | 
|