[Community Puzzle] Smooth Factory


#1

https://www.codingame.com/training/medium/smooth-factory

Send your feedback or ask for help here!

Created by @JBM,validated by @bbb000bbbyyy,@Zorg1 and @Niako.
If you have any issues, feel free to ping them.


#2

My solution looks fine in theory, but timeouts in the big number test (rest is fine). Then I created another solution with memoization of results but this one goes out of memory in the the big number test. :frowning:
It looks I miss some idea from number theory that would allow cutting computation needs dramatically.


#3

Okay problem solved. Thanks @Kecsapo :slight_smile: