largest time: caching doesn't help

You would think that precomputing a solution table (it's pretty small) and simply returning the cached solution for the given input set would yield a very low time per case (basically a single hash lookup) and that solution is in fact accepted, but the precomputation time doesn't seem to be amortized over the small number of cases, so it doesn't seem to do very well in the runtime ranking (though runtime has high variance.)

A version with a static solution table did OK but not great, up to 63% in Python3. Amusingly that run did well in memory usage as well.

edit: caching permutations is an alternative to some math (or library calls) in the permutation version, which might or might not help since math is pretty fast.

Comments (0)