6 kyu

Compact polynomial

37 of 67Glushatov
Description
Loading description...
Fundamentals
Puzzles
Mathematics
  • Please sign in or sign up to leave a comment.
  • vpopolitov Avatar

    It was a wonderful math puzzle. Thank you

  • Madjosz Avatar

    Description was not clear for me. I would suggest to change it to

    Let's call this polynomial compact if it has only integer roots which are non-repeating and non-zero and ...

    Currently it sounds like real and complex roots are ok.

  • Olegeant Avatar

    Guys, I thought I understood the problem well and found the proper solution to it. (JS) At that, while my solution always passes complete set of "small" random tests, it fails the 1st "big" test. Can there be something wrong with JS "big" tests or I am really so stupid on Friday morning :) ...

  • Yushi.py Avatar

    I made a fork for the Python test cases.

    • Added more fixed tests, with hardcoded solutions
    • Separated the tests into Small, Medium and Big for both fixed and random tests.
    • Reduced the amount of random tests from 1000 to 150, 1000 felt like it was too much.
    • Provided the input upon failing a test.
    • Removed the test indexation, for example, failed on test 324. I didn't see a good reason for it, especially with fewer tests.

    Any of these changes can be reverted, so be sure to let me know if you disagree with any of them.

  • monadius Avatar

    JavaScript: either BigInt should be used or the input upper bound should be lowered in random tests.

  • dfhwze Avatar

    In C++, proper utilities from <random> should be used to generate large random numbers.

  • dfhwze Avatar

    What is a pairwise distinct integer non-zero root?

  • Yushi.py Avatar

    Hey, I have very mixed feelings about his one, but I do ultimately like it. It does give you a nice feeling when you complete it.

    There are a few minor spelling mistakes in the description, such as have instead of has and maxinal instead of maximal. I'm more than willing to fix them myself; I believe I can edit it directly while it's in beta, but I'm not sure if a fork would be better.

    I'd be glad if the creator or moderator contacted me so we could proceed.

    Hopefully I don't sound too pedantic. I know it's not a big deal, but I think it's nice to fix it.

  • hobovsky Avatar

    C++ translation has severe code style issues and could use serious overhaul:

    • Assert::That(a == b, Equals(true)) could be just Assert::That(a, Equals(b))
    • Assertions should use ExtraMessage to present inputs,
    • Proper utilities from <random> should be used to generate large random numbers.
    • Tests use the two_oldest_ages_test placeholder name.

    Additionally in C, the failure message should be something better than just an "incorrect answer" (duh!).

  • geoffp Avatar

    This comment has been hidden.

  • Unnamed Avatar

    long long is used in C++, but the description says unsigned long long.

  • monadius Avatar

    This comment has been hidden.

  • FArekkusu Avatar

    Preloaded should not be used for include and using directives.

  • FArekkusu Avatar

    The output type should be a tuple.