You are viewing a single comment's thread. Return to all comments →
it's IMO to simple if you cheat by taking advantage of bigints - but hey I guess it's the Hacker way
Well, I think it just shows that there didn't go a lot of thought into designing the problem.
I think they should make a version where they prohibit the use of big integers like Integer in Haskell. It is also worth mentioning there is a solution without factorizing integers to prime powers like in the official editorial solution. If you do it this way you really have a great problem + solution. Despite that, a solution in Python or C would be much easier to program.