Ad
  • Custom User Avatar

    Duplicate

  • Custom User Avatar

    The description should have said that delta > 0 or, to make the problem a little bit harder, there could be cases in which delta <= 0.

  • Default User Avatar

    Is it guaranteed that there won't be any input which results in negative discriminant?

  • Custom User Avatar

    The description should have said x1 < x2 or somewhat. If coders calculated in the reversed sequence, the answer will become x1 > x2, which cannot pass the tests.
    The second option is to check if x1(coder) == x2(answer) and x2(coder) == x1(answer). If they are true, the tests should also be passed.