I had a perfectly good algorithm. It was a memoized recursion. The problem was that my program printed something like blah*10^27 and they were asking for an exact answer.