/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 536.0 KiB
#2 Accepted 1ms 380.0 KiB
#3 Accepted 4ms 532.0 KiB
#4 Accepted 49ms 532.0 KiB
#5 Accepted 131ms 2.316 MiB
#6 Accepted 42ms 532.0 KiB
#7 Accepted 45ms 984.0 KiB
#8 Accepted 167ms 556.0 KiB
#9 Accepted 47ms 1.02 MiB
#10 Accepted 305ms 564.0 KiB
#11 Time Exceeded ≥1098ms ≥532.0 KiB

Code

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

void solve() {
    int n;
    cin >> n;
    map<ll,ll> cnt;
    for(int i = 0; i < n; i++) {
        int x;
        cin >> x;
        for(int j = 2; j * j <= x; j++) {
            if(x % j == 0) {
                while(x % j == 0) x /= j, cnt[j]++;
            }
        }
        if(x > 1) cnt[x]++;
    }
    ll ans = 1;
    for(auto &[x,y]: cnt) {
        ans *= 1ll * (y+1);
        ans %= mod;
    }
    cout << ans << '\n';
    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:27:25
Judged At
2024-08-16 12:27:25
Judged By
Score
90
Total Time
≥1098ms
Peak Memory
≥2.316 MiB