/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 21ms 4.379 MiB
#2 Accepted 19ms 4.371 MiB
#3 Accepted 22ms 4.375 MiB
#4 Accepted 42ms 4.383 MiB
#5 Accepted 37ms 7.309 MiB
#6 Accepted 28ms 4.316 MiB
#7 Accepted 33ms 5.148 MiB
#8 Accepted 29ms 4.391 MiB
#9 Accepted 35ms 5.008 MiB
#10 Accepted 29ms 4.379 MiB
#11 Accepted 62ms 4.375 MiB

Code

#include<bits/stdc++.h>
using namespace std;
const long long M=1e6+10,MOD=1e9+7;
typedef long long ll;
int prime[M];
ll prime_divisor[M];
void calculate_prime_factor()
{
    for(int i=2;i<M;i++)prime[i]=i;
    for(int i=2;i<M;i+=2)prime[i]=2;
    for(int i=3;i*i<M;i+=2)
    {
        if(prime[i]==i)
        {
            for(int j=i*i;j<M;j+=i)if(prime[j]==j)prime[j]=i;
        }
    }
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    calculate_prime_factor();
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
       int a;
       cin>>a;
       while(a>1)
       {
             prime_divisor[prime[a]]++;
             a/=prime[a];
       }
    }
    ll ans=1;
    for(int i=2;i<M;i++)
    {
         ans=(ans*(prime_divisor[i]+1))%MOD;
         ans%=MOD;
    }
    cout<<ans<<'\n';
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1060 Divisor
Language
C++20 (G++ 13.2.0)
Submit At
2024-05-19 10:35:46
Judged At
2024-11-11 03:30:03
Judged By
Score
100
Total Time
62ms
Peak Memory
7.309 MiB