Advertisement
Morass

Divisors

Sep 11th, 2017
1,351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. typedef vector<ll> vi;
  2. void rec(ll*f,ll*c,int p,int L,vi&o,ll S){
  3.     if(p==L)o.PB(S);
  4.     else got(int i=0;i<c[p]+1;++i)rec(f,c,p+1,L,o,S),S*=f[p];
  5. }
  6. void dsr(int N,vi&o){
  7.     o.clear();
  8.     static ll f[64],c[64];
  9.     int L=fc(N,f,c); //L factors will be in "f" (count == "c") - after pollard-rho
  10.     rec(f,c,0,L,o,1);
  11. //    sort(o.begin(),o.end());
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement