How to reduce memory for my submissions

Hi,

I have been observing, for my past few practice problem submissions, that my memory is always becoming more than what the top submissions are.

An example:
Question: http://www.codechef.com/problems/GRANAMA
Solution: http://www.codechef.com/viewsolution/6813758

I have come across some generic ways, but have never really seen them work in practice.

Is there some non-idempotency in codechef? For example, I just copy-pasted one of the top submissions (which has a memory of 1.6M), but even then my submission has a memory of 2M.

Repetition question. Answer here:

http://discuss.codechef.com/questions/33116/memory-foot-print-of-code