Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
129 characters
159 characters
Also limit on number range can be useful
Then might be good to specify character upper bound in description
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
What are the differences with part 1?
They should be mentioned in description, otherwise this kata is simply a duplicate.
Also performance tag can be added to suggest an optimized solution is required
Fighting for 0.2ms is micro-optimization
This comment is hidden because it contains spoiler information about the solution
Finally implemented an optimization here.
Can be used to run tests up to 10^18 without timing out.
Thanks!
The idea I use behind my solution is quite the same behind yours.
The difference behind them is that mine uses a tool designed to solve repetitive calculations and yours uses a clever optimization.
I don't think that you should ban this library, otherwise only the logic behind your solution can pass the kata and that is fairly less interesting in my opinion.
On the fact to make tests harder, I have tried to go to 10^13 upper bound and it seems to be quite hard even for current optimized solutions.
This comment is hidden because it contains spoiler information about the solution
Why not keeping some look-up tables on referee side to compute intermediate results faster?
It can give more time to players or it can be used to raise the upper bound.
No need to add
n
when calculating distances as it is always equal to 0 [mod n]Loading more items...