SUM OF DIVISOR

 avatar
unknown
c_cpp
2 years ago
564 B
7
Indexable
void seive()
{
   ll t;
   cin >> t;
   map<ll,ll>p;
   for(ll i=2; i<=t; i++)
   {
      if(t%i==0)
      {
         p[i]++;
         t = t/i;
         while(t%i==0)
         {
            p[i]++;
            t = t/i;
         }
      }
   }
   for(auto it : p)
   {
      cout << it.f << " " << it.s << endl;
   }
   vector<ll>v;
   ll ans = 1;
   for(auto it : p)
   {
      ll sum = 0;
      for(ll i=1; i<=it.s; i++)
      {
         sum += pow(it.f,i);
      }
      sum+=1;
      ans *= sum;
   }
   cout << ans << endl;
}
Editor is loading...