hi, i think all of divisors of n(1 to 10^18) with in 9 sec is quit immpossible. if any idea or solution.please share it :) thank you
№ | Пользователь | Рейтинг |
---|---|---|
1 | jiangly | 3898 |
2 | tourist | 3840 |
3 | orzdevinwang | 3706 |
4 | ksun48 | 3691 |
5 | jqdai0815 | 3682 |
6 | ecnerwala | 3525 |
7 | gamegame | 3477 |
8 | Benq | 3468 |
9 | Ormlis | 3381 |
10 | maroonrk | 3379 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 168 |
2 | -is-this-fft- | 165 |
3 | Dominater069 | 161 |
4 | Um_nik | 159 |
4 | atcoder_official | 159 |
6 | djm03178 | 157 |
7 | adamant | 153 |
8 | luogu_official | 150 |
9 | awoo | 149 |
10 | TheScrasse | 146 |
hi, i think all of divisors of n(1 to 10^18) with in 9 sec is quit immpossible. if any idea or solution.please share it :) thank you
Название |
---|
Iterating from 1 to sqrt(n) and using divisor pairs will give you the answer. In 9 secs, I think you can do 10^9 operations, even with the constant of the modulo operation.
Good day to you,
well firstly you can start with "Pollard Rho" (you will also need something like miller-rabin), which could factorize the number in O(N^(1/4)) [it is somehow long coding with many possible mistakes, but the core is not that bad].
As you have it, you can generate all divisors by "simple recursion" in O(#NUMBER_OF_DIVISORS)
Hope I guessed rightly what you asked for ^_^
Good Luck & Have nice day!!
thanks i got it...yeah there have some mistake.. for large number it's quite impossible there is no exact solution for this ques with 9 sec :) thank you :)
Well imho there is something more exact, but this is a lesser pain ^_^
Also the probability is "soo big" you can treat is as exact :)
Have nice day ^_^