/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 306ms 38.773 MiB
#2 Wrong Answer 305ms 38.773 MiB
#3 Wrong Answer 307ms 38.816 MiB
#4 Wrong Answer 337ms 38.77 MiB
#5 Wrong Answer 322ms 40.27 MiB
#6 Wrong Answer 307ms 38.773 MiB
#7 Wrong Answer 322ms 39.066 MiB
#8 Wrong Answer 324ms 38.773 MiB
#9 Wrong Answer 317ms 39.082 MiB
#10 Wrong Answer 315ms 38.77 MiB
#11 Wrong Answer 344ms 38.797 MiB

Code

#define _GLIBCXX_FILESYSTEM
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 1e7+2,mod = 1e9+7;

int spf[N],cnt[N];
void solve() {
    for(int i = 2; i < N; i++)
        spf[i] = i;
    for(int i = 2; i < N; i++) {
        if(spf[i] == i) {
            for(int j = 2*i; j < N; j += i) {
                if(spf[j] == j) spf[j] = i;
            }
        }
    }
    int n;
    cin >> n;
    for(int i = 0; i < n; i++) {
        int x;
        cin >> x;
        while(x > 1) {
            cnt[spf[x]]++;
            x /= spf[x];
        }
    }
    ll ans = 1;
    for(int i = 2; i < N; i++) {
        ans *= 1ll * (cnt[i]+1);
        ans %= mod;
    }
    cout << ans;
    return;
}

int32_t main() {
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int tc = 1;
    // cin >> tc;
    for(int kase = 1; kase <= tc; kase++) {
        //cout << "Case " << kase << ": ";
        solve();
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1060 Divisor
Language
C++20 (G++ 13.2.0)
Submit At
2024-08-16 12:14:58
Judged At
2024-08-16 12:14:58
Judged By
Score
0
Total Time
344ms
Peak Memory
40.27 MiB