/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 432.0 KiB
#2 Accepted 1ms 324.0 KiB
#3 Accepted 4ms 500.0 KiB
#4 Accepted 24ms 564.0 KiB
#5 Accepted 126ms 2.371 MiB
#6 Accepted 45ms 764.0 KiB
#7 Accepted 52ms 1008.0 KiB
#8 Accepted 187ms 556.0 KiB
#9 Accepted 56ms 936.0 KiB
#10 Accepted 313ms 556.0 KiB
#11 Time Exceeded ≥1089ms ≥484.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-11-11 03:19:39
Judged By
Score
90
Total Time
≥1089ms
Peak Memory
≥2.371 MiB