I was trying to solve 618E - Robot Arm from the last contest using 15683254. But (strangely?) I suffer a MLE on (pre)test 5. I thought I was using only static memory (each of the 3 arrays has fixed size), so any memory limit exceed error must occur right on the first test, if it occurs later.
I'm new to Java, so can anyone explain why I'm getting a MLE on #5? Where is the extra memory I'm using being allocated?
Thanks in advance!