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 :|
In test case 2 your output is
YES
, but in test case 9 it isNO
. Look through your code.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,
As I remember, 1 is the number of iterations in the primality test. So nothing strange here.
People should read docs before using functions.