ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 2102. Michael and Cryptography

AC with Pollard's rho algorithm
Posted by Keworker `~ 14 Jul 2024 11:11
I pass this problem with Sieve of Eratosthenes, but i think solution with Pollard's rho algorithm is funnier, and wrote it too.

If you cant pass it with this algo just use all prime modules from 1'000'000'007 to 1'000'001'393.
Re: AC with Pollard's rho algorithm
Posted by 👑TIMOFEY👑`~ 15 Jul 2024 08:30
Did you check small dividers? ro pollard works very poorly with them
Re: AC with Pollard's rho algorithm
Posted by Keworker `~ 18 Jul 2024 16:32
If TL let me check all with O(sqrt(n)), I do it. I invoke rho pollard only if can not pass test with O(sqrt(n))