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.
Yes you're right. I just get this error when I print the larger int values. I guess the ints get converted to strings first, and there's a limit on string lengths.
"ValueError: Exceeds the limit (4300) for integer string conversion; use sys.set_int_max_str_digits() to increase the limit"
See above, this occurs when you print the integer value.
In particular I don't think you can solve the problem without a call to this:
sys.set_int_max_str_digits()
Did you ban
sys
? It's needed for large ints in Python.Oh sorry man, I got busy with work. Was going to do it today. Thanks for helping me with it - and then doing it.
I updated the Go translation myself.
The author does not have to be active for a translation to get accepted.
See my reply above. Please create a new fork of your translation with all updates. I will check it and approve it.
This comment is hidden because it contains spoiler information about the solution
Thanks! Now i see a huge red message like this: " expected [ ... ] to equal [ ... ] "
I improved my code, but still cant get a right solution. Now it is "STDERR Max Buffer Size Reached (1.5 MiB)".
All test passed except "Big numbers". Sometimes one or two "Big numbers" tests are green too, but others failed.
Ok I've done that.
I ended up just putting in the larger powers of 10 in the format 100_000_000_000_000. I hope that's OK?
I ran it gain, all fine. Then I published again and got an error about failed tests?
b
may be as high as10**18
in Big numbers tests. The reference solution should be updated: replacemath.Pow
with repeated multiplication. You may also increase the number of tests but I don't think it is necessary.I don't think I use numbers larger than 2**53.
The Python tests I copied used 10**14.
But the tests should probably be more numerous and for bigger numbers. I have no idea how to decide how many or how large to make them. Should I do this via trial and error?
I could change everything to int64s or even math/Big I guess, but is this is what's wanted?
This comment is hidden because it contains spoiler information about the solution
Go random tests expect incorrect results for large numbers. Do not use
math.Pow
in the solution (float64
cannot be used for integers larger than$2^{53}$
).An example:
Loading more items...