SHARE
TWEET

troublesome abr

a guest Jan 19th, 2020 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int n=100000;
  4. vector <int> divisor[100005];
  5. void sieve()
  6. {
  7.     int i,j;
  8.     for(i=1;i<=n;i++)
  9.     {
  10.         for(j=i;j<=n;j+=i)
  11.         {
  12.             divisor[j].push_back(i);
  13.         }
  14.     }
  15. }
  16. int main()
  17. {
  18.     ios_base::sync_with_stdio(0);
  19.     cin.tie(0);
  20.     cout.tie(0);
  21.  
  22.  
  23.     sieve();
  24.     int m,t,i,j;
  25.     long long ans;
  26.     int mod=1e9+7;
  27.  
  28.     cin>>t;
  29.     while(t--)
  30.     {
  31.  
  32.         cin>>m;
  33.         ans=1;
  34.         for(i=0;i<divisor[m].size();i++)
  35.         {
  36.           //  cout<<divisor[n][i]<<" ";
  37.             ans=(ans*(divisor[m].at(i)+1))%mod;
  38.         }
  39.         cout<<ans-1<<endl;
  40.  
  41.     }
  42. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top