/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 1ms 532.0 KiB
#3 Accepted 4ms 568.0 KiB
#4 Accepted 24ms 320.0 KiB
#5 Accepted 125ms 2.453 MiB
#6 Accepted 44ms 560.0 KiB
#7 Accepted 51ms 1.02 MiB
#8 Accepted 188ms 560.0 KiB
#9 Accepted 56ms 1.059 MiB
#10 Accepted 315ms 552.0 KiB
#11 Time Exceeded ≥1008ms ≥344.0 KiB

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