Блог пользователя BeardAspirant

Автор BeardAspirant, история, 6 лет назад, По-английски

There is a solution I am trying to submit on codeforces and its giving me wrong output. Now, there could be mistake on my end but what I can see is that the test case is the same that gets passed earlier. 34627657. Testcase 9 is equal to test case 2 which gets passed.

EDIT: Explain the downvotes :|

  • Проголосовать: нравится
  • -36
  • Проголосовать: не нравится

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

In test case 2 your output is YES, but in test case 9 it is NO. Look through your code.

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I don't really know how IsProbablePrime(1) works, but docs say that for composite numbers it is correct with probability at least 1/2, but not always. So your code using some randomization and it is normal that it works differently on the same testcase.

And you get my downvote for phrase "Explain the downvotes". We don't have to explain anything to you,

  • »
    »
    6 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится +10 Проголосовать: не нравится

    As I remember, 1 is the number of iterations in the primality test. So nothing strange here.

    People should read docs before using functions.