Ad
  • Default User Avatar

    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"

  • Default User Avatar

    See above, this occurs when you print the integer value.

  • Default User Avatar

    In particular I don't think you can solve the problem without a call to this: sys.set_int_max_str_digits()

  • Default User Avatar

    Did you ban sys? It's needed for large ints in Python.

  • Default User Avatar

    Oh sorry man, I got busy with work. Was going to do it today. Thanks for helping me with it - and then doing it.

  • Custom User Avatar

    I updated the Go translation myself.

  • Custom User Avatar

    The author does not have to be active for a translation to get accepted.

  • Custom User Avatar

    See my reply above. Please create a new fork of your translation with all updates. I will check it and approve it.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Default User Avatar

    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?

  • Custom User Avatar

    b may be as high as 10**18 in Big numbers tests. The reference solution should be updated: replace math.Pow with repeated multiplication. You may also increase the number of tests but I don't think it is necessary.

  • Default User Avatar

    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?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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:

    n = 9010954778750400
    m = 9010954778750410
    Expected
        <[]int | len:1, cap:1>: [9010954778750401]
    to equal
        <[]int | len:1, cap:1>: [9010954778750400]
    
  • Loading more items...