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

Before contest

Codeforces Round #492 (Div. 1) [Thanks, uDebug!]

02:09:06

Register now »

Codeforces Round #492 (Div. 1) [Thanks, uDebug!]

02:09:06

Register now »

*has extra registration

Before contest

Codeforces Round #492 (Div. 2) [Thanks, uDebug!]

02:09:06

Register now »

Codeforces Round #492 (Div. 2) [Thanks, uDebug!]

02:09:06

Register now »

*has extra registration

# | User | Rating |
---|---|---|

1 | tourist | 3434 |

2 | Petr | 3353 |

3 | OO0OOO00O0OOO0O0…O | 3314 |

4 | fateice | 3306 |

5 | Um_nik | 3286 |

6 | Syloviaely | 3274 |

7 | dotorya | 3145 |

8 | LHiC | 3114 |

9 | Radewoosh | 3098 |

10 | mnbvmar | 3096 |

# | User | Contrib. |
---|---|---|

1 | tourist | 178 |

2 | rng_58 | 165 |

3 | Petr | 155 |

3 | csacademy | 155 |

5 | Swistakk | 149 |

5 | lewin | 149 |

7 | Um_nik | 142 |

8 | Errichto | 140 |

9 | Vovuh | 138 |

9 | matthew99 | 138 |

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

↑

↓

Codeforces (c) Copyright 2010-2018 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jun/24/2018 17:25:55 (d2).

Desktop version, switch to mobile version.

User lists

Name |
---|

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 ^_^