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

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

Yesterday I was submitted the problem B in the contest time and it was pretest passed. But after finishing the contest it got the wrong answer on test 15. But its output is correct in my laptop compiler. then same code i submitted again then it got the wrong answer on test 37 though it gave correct output .again i submitted code removing space but it WA on test 2.In my own laptop, it is given correctly for all test. What's the wrong with me ??

My Submission :http://codeforces.net/submissions/Hredoy_Biswas

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

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

There is no problem in java compiler on Codeforces. You used BigInteger.isProbablePrime(int certainty) method with certainty=1 which is not-deterministic and returns whether a prime number is prime with probability p ~= (1-1/2^certainty). So this behaviour is expected that sometimes it may give the non-prime number to be prime and some other times non-prime.