|
|
вернуться в форумMemory limit exceeded I am writing my solution in Java and I constantly getting "Memory Limit Exceeded" error on 10th test. I used ArrayList<Integer> to store 'programs' and 'rollbacks'. Then lately I changed it TIntArrayList, to store 'int' as a basic type, but still it does not solve the problem. I saw solutions in Java, that people used less than 10Mb of memory. What am I doing wrong? Edited by author 23.03.2014 18:03 Edited by author 23.03.2014 18:04 Re: Memory limit exceeded Fully rewrote the algorithm, to calculate the solution each time in runtime, without using memory for each clone, but then my solutions exceeds Time limitation on 9th test. I also do not understand why we get a number 'm' - number of educational program. How this number could help us to solve the problem? Re: Memory limit exceeded Finally solved it. The main trick was to find a way to make clone operation without coping all the clone memory. |
|
|