Submission #13800977


Source Code Expand

Copy
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("Yes");}else{puts("No");}
#define MAX_N 200005

vector<pair<ll, int>> fac;
void PrimeFactorInit(ll x){
    if(x >= 2){
        for(ll ii = 2; ii <= x; ii++){
            ll i = ii;
            if(i * i > x)break;
            if(x % i == 0){
                int cnt = 0;
                while(x % i == 0){
                    cnt++;
                    x /= i;
                }
                pair<ll, int> p;
                p.first = i;
                p.second = cnt;
                fac.push_back(p);
            }
        }
        if(x > 1){
            pair<ll, int> p;
            p.first = x;
            p.second = 1;
            fac.push_back(p);
        }
    }
}

int main() {
    ll n;
    cin >> n;

    if(n == 1){
        cout << 0 << endl;
        return 0;
    }

    PrimeFactorInit(n);

    int ans = 0;

    int m = fac.size();
    rep(i,m){
        int x = fac[i].second;
        srep(j,1,20){
            if(x < j)break;
            x -= j;
            ans++;
        }
    }

    cout << ans << endl;
    return 0;
}


Submission Info

Submission Time
Task D - Div Game
User Shibuyap
Language C++ (GCC 9.2.1)
Score 400
Code Size 1368 Byte
Status AC
Exec Time 17 ms
Memory 3624 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 5
AC × 32
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, sample_05.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, hand_12.txt, hand_13.txt, hand_14.txt, hand_15.txt, hand_16.txt, hand_17.txt, hand_18.txt, hand_19.txt, hand_20.txt, hand_21.txt, hand_22.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, sample_05.txt
Case Name Status Exec Time Memory
hand_01.txt AC 2 ms 3624 KB
hand_02.txt AC 2 ms 3572 KB
hand_03.txt AC 3 ms 3568 KB
hand_04.txt AC 2 ms 3572 KB
hand_05.txt AC 2 ms 3392 KB
hand_06.txt AC 2 ms 3528 KB
hand_07.txt AC 2 ms 3456 KB
hand_08.txt AC 2 ms 3524 KB
hand_09.txt AC 14 ms 3528 KB
hand_10.txt AC 16 ms 3528 KB
hand_11.txt AC 15 ms 3452 KB
hand_12.txt AC 13 ms 3528 KB
hand_13.txt AC 14 ms 3452 KB
hand_14.txt AC 14 ms 3412 KB
hand_15.txt AC 2 ms 3560 KB
hand_16.txt AC 2 ms 3412 KB
hand_17.txt AC 2 ms 3528 KB
hand_18.txt AC 2 ms 3528 KB
hand_19.txt AC 2 ms 3412 KB
hand_20.txt AC 2 ms 3408 KB
hand_21.txt AC 17 ms 3624 KB
hand_22.txt AC 11 ms 3412 KB
random_01.txt AC 2 ms 3408 KB
random_02.txt AC 3 ms 3524 KB
random_03.txt AC 3 ms 3572 KB
random_04.txt AC 4 ms 3528 KB
random_05.txt AC 2 ms 3592 KB
sample_01.txt AC 2 ms 3396 KB
sample_02.txt AC 2 ms 3448 KB
sample_03.txt AC 2 ms 3408 KB
sample_04.txt AC 2 ms 3528 KB
sample_05.txt AC 2 ms 3528 KB