
i don't think you need to cache anything. If you try just
the input 1 100000 then caching doesn't pay.
Another problem that may cause a WA is that you don't
initialize your array before using it. So discard your array,
send your code, and you'll be fine
