Hello everybody! Got next problem: for every 1 <= N <= 1 000 000 we need to found all prime divisors of N. Moreover, we aren't required to know their powers — only primes themselves. I guess we can use Eratostenes algorithm, but I can't finish my solution. Who can help?
UPD. Solutions like trivial O(sqrt(N)) and similar, as well as doing Eratostenes and then, for example, got an array prime[] with primes, iterating that array and checking them are too slow. We need something faster