Untitled

mail@pastecode.io avatar
unknown
plain_text
16 days ago
1.7 kB
1
Indexable
Never
/*
#pragma GCC optimize("02")
#pragma GCC target("avx,avx2,fma")
*/

#include <ctime>
#include <iostream>

#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#include <cstring>
#include <string>
#include <climits>

#define fou(i, a, b) for(int i = (a); i <= (b); i++) // for up
#define fod(i, a, b) for(int i = (a); i >= (b); i--) // for down
#define foa(i, n) for(int i = 0; i < (n); i++) // for array

#define ii pair<int,int>
#define mpr make_pair
#define se second
#define fi first

#define vi  vector<int>
#define vii vector< pii >
#define pb push_back
#define pf push_front
#define ms(a, b) memset(a, b, sizeof(a))

#define TIME (1.0 * clock() / CLOCKS_PER_SEC)
using namespace std;
typedef long long ll;

const ll MOD = 1000000007; // 10^9 + 7
const int INF = INT_MAX;

bool p[1000001];
void sieve(){
    p[0]=p[1]=false;
    fou(i,2,1000000) p[i]=true;

    fou(i,2,1000){
        if(p[i]){
            for(int j = i*i; j <= 1000000; j+=i)
                p[j]=false;
        }
    }
}



void sol(ll n){
    sieve();
    ll c = 0, l = 0;

    ll can = sqrt(n);
    for(int i = 2; i <= can; i++){
        if(p[i]){
            ll bac = 0;

            while(n%i==0){
                ++bac;
                n/=i;
            }

            if(bac%2) l+=bac;
            else c+=bac;
        }
    }
    if(n > 1) ++l;

    cout << c << endl << l;
}

int main(){ 
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    freopen("SumExpo.Inp","r",stdin);
    freopen("SumExpo.Out","w",stdout);

    
    ll n; cin >> n;
    sol(n);
    

    return 0;
}









Leave a Comment