ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1090. In the Army Now

Show all messages Hide all messages

I use mergesort and I have TLE#3 Why? dimozzz 31 Jan 2007 22:12
It's your memory allocation problem (+) Vladimir Yakovlev (USU) 31 Jan 2007 23:13
You shouldn't allocate memory for auxiliary array every time in your recursive method. You allocate this array O(K*log(N)) times. Try to allocate it only one time.
Thank you very much. I have AC with Java too.