For problem 1114F - Please, another Queries on Array?:
Does someone has an idea why this submission 49746866 gets WA test 3 (with 17M memory) while this one 49746950 gets MLE in the same test (with 256M Memory) where the only difference in the power function (Iterative vs Recursive)?
In iterative code, you defined
p
asunsigned int
, but in recursive one it isint
, so, if we suppose thattemp
can be negative (because of a wrong in range query, for example), there will be no issues in iterative code, but there will be infinite calls in recursive code (because p < 0).Thank you, that was a silly mistake :D