Time Exceeded
Code
/*
BISMILLAHIR RAHMANIR RAHIM
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
ll mod=1e9+7;
void solve()
{
ll n;cin>>n;
map<ll,ll> mp;
for(int i=0;i<n;i++)
{
int x;cin>>x;
for(int i=2;i*i<=x;i++)
{
if(x%i==0)
{
while(x%i==0)
{
mp[i]++;x/=i;
}
}
}
if(x!=1)mp[x]++;
}
ll ans=1;
for(auto it:mp)
{
ans*=(it.second+1);ans%=mod;
}
cout<<ans<<endl;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t=1;
//cin>>t;
while(t--)
{
solve();
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1060 Divisor
- Language
- C++20 (G++ 13.2.0)
- Submit At
- 2024-08-15 19:03:52
- Judged At
- 2024-10-03 13:32:05
- Judged By
- Score
- 90
- Total Time
- ≥1008ms
- Peak Memory
- ≥2.453 MiB