← Back to topics
Topic

SuperClimber

m
mbalunovic
Hi, I am solving SuperClimber with matrix multiplication...

I am getting Memory limit exceeded on 21 & 22 test but I don't know why...
Can anybody help?
s
syntax_error
probably cause you're creating a new matrix in each of your recursion calls
. try powering it using the bitwise operations, or you can use the recursion with a pointer to the original matrix.
p
picsel
Yeah, you don't even need recursion :) Powering can be done with simple loop also
d
demjan0001
recursion is ok, just u r returning always matrix and it's too many memory ...
try to change it to void ...
m
mbalunovic
Thanks :D

I changed powering and removed unnecessary mod operations and it passed...