Mistrator / contestlib

A team reference document for programming competitions.
0 stars 0 forks source link

Implementation of Pollard-Rho is incorrect #1

Closed Mistrator closed 6 years ago

Mistrator commented 6 years ago

The factor produced by the algorithm isn't always prime.

Mistrator commented 6 years ago

The factor isn't always prime by the algorithm's definition, so there's no bug.

Mistrator commented 6 years ago

The algorithm might get stuck in an infinite loop if n is a perfect square.