Source limit error

Getting source limit error in this question .

how to reduce source limit in code ?

link : http://www.spoj.com/problems/LASTDIG/

Here is link to my solution : http://ideone.com/xKpbHN

Approach : storing last digit of first 4 power of 1 to 20 (Eg 3^1,3^2,3^3,3^4)

in an array and then answering queries.

I just want to know how to remove source limit error??

this might be helpful!

https://discuss.codechef.com/questions/46429/the-last-digit

1 Like

please share your solution

EDited!!!

THanks !!!
btw i was able to reduce size by trying different approach!!

1 Like