Problem:


Score : 400 points

Problem Statement

Given is a positive integer N. Consider repeatedly applying the operation below on N:

First, choose a positive integer z satisfying all of the conditions below:

z can be represented as z=p^e, where p is a prime number and e is a positive integer;

z divides N;

z is different from all integers chosen in previous operations.

Then, replace N with N/z.

Find the maximum number of times the operation can be applied.

Constraints

All values in input are integers.

1 \leq N \leq 10^{12}

Input

Input is given from Standard Input in the following format:

N

Output

Print the maximum number of times the operation can be applied.

Sample Input 1

24

Sample Output 1

3

We can apply the operation three times by, for example, making the following choices:

Choose z=2 (=2^1). (Now we have N=12.)

Choose z=3 (=3^1). (Now we have N=4.)

Choose z=4 (=2^2). (Now we have N=1.)

Sample Input 2

1

Sample Output 2

0

We cannot apply the operation at all.

Sample Input 3

64

Sample Output 3

3

We can apply the operation three times by, for example, making the following choices:

Choose z=2 (=2^1). (Now we have N=32.)

Choose z=4 (=2^2). (Now we have N=8.)

Choose z=8 (=2^3). (Now we have N=1.)

Sample Input 4

1000000007

Sample Output 4

1

We can apply the operation once by, for example, making the following choice:

z=1000000007 (=1000000007^1). (Now we have N=1.)

Sample Input 5

997764507000

Sample Output 5

7



Sample input:
24


Sample output:
3

Submission status: Runtime Error

Solution code:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

N = int(input())
z_list = factorization(N)
Z = []
for z in z_list:
        for e in range(1, z[1]+1):
            Z.append(z[0]**e)
sorted(Z)
counter = 0 
if N==i:
    print(0)
    quit()
for z in Z:
    if(N%z==0):
        N = N//z
        counter += 1
print(counter)

Submission status: Runtime Error

Solution code:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

N = int(input())
z_list = factorization(N)
Z = []
for z in z_list:
        for e in range(1, z[1]+1):
            Z.append(z[0]**e)
sorted(Z)
counter = 0 
if N==i:
    print(0)
    quit()
for z in Z:
    if(N%z==0):
        N = N//z
        counter += 1
print(counter)

Submission status: Runtime Error

Solution code:
import os
 
N = int(input())
 
def main(n, var):
    mylist = []
    dupliN = n
    for i in range(2, int(-(-n**0.5//var))+var):
        if dupliN%i==0:
            cnt=0
            while dupliN%i==0:
                cnt+=var
                dupliN //= i
            mylist.append([i, cnt])
 
    if dupliN!=1:
        mylist.append([dupliN, 1])
    if mylist==[]:
        mylist.append([n, 1])
    return mylist
if N == 1:
    print(0)
    os._exit()
f = main(N, 1)
ansval = 0
for extra, value in f:
    num = 1
    while True:
        value -= num
        if value < 0:
            break
        ansval += 1
        num += 1 
print(ansval)

Submission status: Runtime Error

Solution code:
n = int(input())
b = 0
for a in range(2,int((n **(1/2)))+2):
    if n % a == 0:
        b = b+1
        n = n/a
if　ｂ　＝＝　０：
　　ｂ　＝１
print(b)

Submission status: Runtime Error

Solution code:
n = int(input())
b = 0
for a in range(int(n)):
    if n % a ==0:
        b = b+1
        n = n/a
print(b)

Submission status: Runtime Error

Solution code:
import math
 
N = int(input())
num_list = [0] + [0] * int(math.sqrt(N))  # 0~N
pn_list = []
for i in range(2, int(math.sqrt(N))+2):
    if num_list[i] == 0:
        pn_list.append(i)
        num_list[i::i] = [1] * len(num_list[i::i])
        
count = 0
for pn in pn_list:
    e = 1
    while N%(pn**e)==0 and N//(pn**e)>=1:
        N //= (pn**e)
        e += 1
        count += 1
if count == 0 and N>1:
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
import math

N = int(input())
num_list = [0] + [0] * math.sqrt(N)  # 0~sqrt(N)
pn_list = []
for i in range(2, int(math.sqrt(N))+2):
    if num_list[i] == 0:
        pn_list.append(i)
        num_list[i::i] = [1] * len(num_list[i::i])

count = 0
for pn in pn_list:
    e = 1
    while N%(pn**e)==0 and N>=(pn**e):
        N //= (pn**e)
        e += 1
        count += 1
if count==0 and N>1:  # count==0のとき，Nは素数のため
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
import math

N = int(input())
num_list = [0] + [0] * N  # 0~N
pn_list = []
for i in range(2, int(math.sqrt(N))+1):
    if num_list[i] == 0:
        pn_list.append(i)
        num_list[i::i] = [1] * len(num_list[i::i])

count = 0
for pn in pn_list:
    e = 1
    while N%(pn**e)==0 and N//(pn**e)>=1:
        N //= (pn**e)
        e += 1
        count += 1
print(count)

Submission status: Runtime Error

Solution code:
import math

N = int(input())
num_list = [0] + [0] * N  # 0~N
pn_list = []
for i in range(2, N+1):
    if num_list[i] == 0:
        pn_list.append(i)
        num_list[i::i] = [1] * len(num_list[i::i])

count = 0
for pn in pn_list:
    e = 1
    while N%(pn**e)==0 and N//(pn**e)>=1:
        N //= (pn**e)
        e += 1
        count += 1
print(count)

Submission status: Runtime Error

Solution code:

def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table

from itertools import groupby
N = int(input())
P = prime_decomposition(N)
ans = 0
for k, g in groupby(P):
    n = len(g)
    for i in range(1, 10000000):
        n -= i
        if n >=0:
            ans += 1
        else:
            break
print(ans)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  ll N;
  cin >> N;
  ll ans = 0;
  for(ll i = 2; i * i <= N; i++){
    if(N % i != 0) continue;
    ll num = 0;
    while(N % i == 0){
      N /= i;
      num++;
    }

    for(ll j = 1; ; j++) {
      if(num >= j) {
        num -= j;
        ans++;
      }else break;
    }
  }
  if(N != 1) ans++;
  cout << ans << endl;
  return 0;
}

Submission status: Runtime Error

Solution code:
import collections
def factorization(n):
    if n<2:
        return []
    
    prime_factor=[]
    
    for i in range(2,int(n**0.5)+1):
        while n%i==0:
            prime_factor.append(i)
            n//=i
            
    if n>1:
        prime_factor.append(n)

        
    return prime_factor

n=int(input())

c=collections.Counter(factorization(n))
d=list(c.values())

for v in c.values():
    for i in range(1,n):
        v-=i
        if v>=0:
            count+=1
        else:
            break
print(count)

Submission status: Runtime Error

Solution code:
from collections import deque
n = int(input())
i = 2
a = []
x = n
while(i * i <= n):
    if (n % i == 0):
        a.append(i)
        n //= i
        while(n % i == 0):
            n //= i
            a.append(a[-1] * i)
    i += 1
if (n != 1):
    a.append(n)
a.sort(reverse = True)
ans = 0
while(x != 1 and len(a)):
    while(x % a[-1]):
        a.pop()
    x //= a[-1]
    a.pop()
    ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
from collections import deque
n = int(input())
i = 2
a = []
x = n
while(i * i <= n):
    if (n % i == 0):
        a.append(i)
        n //= i
        while(n % i == 0):
            n //= i
            a.append(a[-1] * i)
    i += 1
if (n != 1):
    a.append(n)
a.sort(reverse = True)
ans = 0
while(x != 1):
    while(x % a[-1]):
        a.pop()
    x /= a[-1]
    a.pop()
    ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
from collections import deque
n = int(input())
i = 2
a = []
x = n
while(i * i <= n):
    if (n % i == 0):
        a.append(i)
        n //= i
        while(n % i == 0):
            n //= i
            a.append(a[-1] * i)
    i += 1
if (n != 1):
    a.append(i)
a.sort(reverse = True)
ans = 0
while(x != 1):
    while(x % a[-1]):
        a.pop()
    x /= a[-1]
    a.pop()
    ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
import math


# 素数の判定
def is_prime(n):
    if n == 1:
        return 0

    for k in range(2, int(math.sqrt(n)) + 1):
        chk = False
        while (n % k == 0):
            chk = True
            n /= k
            if k not in check:
                check[k] = 1
            else:
                check[k] += 1
        if chk:
            return n
    if n in check:
        return 0
    else:
        check[n] = 1
        return 1


check = {}
n = int(input())
if n == 1:
    print(0)
else:
    while (1):
        n = is_prime(n)
        if n == 0:
            break
    ans = 0
    for k, v in check.items():
        for i in range(1, 50):
            v -= i
            if v < 0:
                break
            else:
                ans += 1
# print(check)
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
k=n
c=0
def a():
  while n!=1:
    while n%k!=0:
      k-0=1
    n=n/k
    c+=1
print(c-1)

Submission status: Runtime Error

Solution code:
N=int(input())

import sympy
ans=sympy.divisors(N)

count=0
K=1
if len(ans)==1:
    print(0)
elif len(ans)==2:
    print(1)
else:
    for i in range(1,len(ans)):
        K*=ans[i]
        count+=1
        if K>=N:
            break
        print(count)

Submission status: Runtime Error

Solution code:
N=int(input())

import sympy
ans=sympy.divisors(N)

count=0
K=1
for i in range(1,len(ans)):
    K*=ans[i]
    count+=1
    if K>=N:
        break

print(count)

Submission status: Runtime Error

Solution code:
N=int(input())
K=[]
for F in range(2,N):
    while F<N:
      if N%F=0:
        K.append(F)
      F=F*F
print(len(K))

Submission status: Runtime Error

Solution code:
from math import sqrt
n = int(input())
cnt = 0
for i in range(2, int(sqrt(n))):
    if n % i == 0:
        div = i
        while n % div == 0:
            n /= div
            div *= i
            cnt += 1
        while n % i == 0:
            n /= i
if cnt == 0 and i > 1:
    cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
from sympy import sieve
n = int(input())

p = []
for i in range(2,n+1):
    p.append(i)

for i in p:
    for j in p:
        if j % i == 0 and j / i != 1:
            p.remove(j)

e = [i for i in range(1,10)]
pe = []

for i in p:
  for j in e:
    if not (i**j) in pe:
      pe.append(i**j)
count = 0
used = []
while n > 1:
  for i in pe:
    if n % i == 0:
      n = n / i
      count += 1
      pe.remove(i)
      break

print(count)

Submission status: Runtime Error

Solution code:
import math
def prime_factorize(n):
    num_list = []
    m = n
    c = 0
    for i in range(2,int(math.sqrt(n)) + 1):
        print(i)
        c += 1
        if m % i == 0 and i not in num_list:
            num_list.append(i)
            m //= i
            if m == 1:break                
    return (num_list)

N = int(input())
print(len(l))

Submission status: Runtime Error

Solution code:
from sys import stdin
from math import sqrt


def is_prime(q, primes):
    if len(primes) == 0:
        return True
    for prime in primes:
        if q % prime == 0:
            return False
    return True

def get_primes(n):
    # special case
    if n < 2:
        return []

    max = int(sqrt(n))
    primes = []
    for q in range(2, max+1):
        if is_prime(q, primes):
            primes.append(q)

    return primes

def breakdown_to_primes_as_dic(n, primes):
    prime_dic = {}
    for prime in primes:
        if n % prime != 0:
            continue
        prime_dic[prime] = 0
        while n % prime == 0:
            prime_dic[prime] += 1
            n = n // prime
    if n != 1:
        prime_dic[n] = 1
    return prime_dic

def get_int_sums(n):
    int_sums = [0]
    for i in range(1, n+1):
        int_sums.append(int_sums[i-1] + i)
    int_sums.pop(0)
    return int_sums


def main():
    for line in stdin:
        n = int(line)
        break

    primes = get_primes(n)
    prime_dic = breakdown_to_primes_as_dic(n, primes)

    max_prime_occurance = max(prime_dic.values())
    int_sums = get_int_sums(max_prime_occurance + 1)

    answer = 0
    for prime in prime_dic.keys():
        occr = prime_dic[prime]
        for i in range(1, len(int_sums)):
            if occr >= int_sums[i-1] and occr < int_sums[i]:
                answer += i
                break

    print(answer)

main()

Submission status: Runtime Error

Solution code:
from sys import stdin
from math import sqrt


def is_prime(q, primes):
    if len(primes) == 0:
        return True
    for prime in primes:
        if q % prime == 0:
            return False
    return True

def get_primes(n):
    # special case
    if n < 2:
        return []

    max = int(sqrt(n))
    primes = []
    for q in range(2, max+1):
        if is_prime(q, primes):
            primes.append(q)

    return primes

def breakdown_to_primes_as_dic(n, primes):
    prime_dic = {}
    for prime in primes:
        if n % prime != 0:
            continue
        prime_dic[prime] = 0
        while n % prime == 0:
            prime_dic[prime] += 1
            n = n // prime
    if n != 1:
        prime_dic[n] = 1
    return prime_dic

def get_int_sums(n):
    int_sums = [0]
    for i in range(1, n+1):
        int_sums.append(int_sums[i-1] + i)
    int_sums.pop(0)
    return int_sums


def main():
    for line in stdin:
        n = int(line)
        break

    primes = get_primes(n)
    prime_dic = breakdown_to_primes_as_dic(n, primes)

    max_prime_occurance = max(prime_dic.values())
    int_sums = get_int_sums(max_prime_occurance)

    answer = 0
    for prime in prime_dic.keys():
        occr = prime_dic[prime]
        for i in range(1, len(int_sums)):
            if occr >= int_sums[i-1] and occr < int_sums[i]:
                answer += i
                break

    print(answer)

main()

Submission status: Runtime Error

Solution code:
import numpy as np
n = int(input())
z_list = np.arange(1,n+1)[::-1]
ans = 0
while z_list:
  if n % z_list[-1] == 0:
    n = n / z_list[-1]
    z_list = np.delete(z_list,-1)
    ans += 1
  else:
	z_list = z_list[z_list % z_list[-1] == 0]
print(ans)

Submission status: Runtime Error

Solution code:
import math

# 素数リスト生成　eratosthenes
def makePrime(m):
    p = [i for i in range(m + 1)]
    for i in p[3:]:
        if p[i] % 2 == 0: p[i] = 0

    root_m = m ** 0.5
    for i in range(3,m):
        if i > root_m: break
        if p[i] != 0:
            for j in range(i, m + 1, 2):
                if i * j >= m + 1: break
                p[i * j] = 0
    #return p
    return sorted(list(set(p)))[2:]


# 素数かどうか判定
def isPrime(x):
    if x <= 1:
        return False
    
    for i in range(2,math.floor(math.sqrt(x))+1):
        if (x % i) == 0:
            return False
    return True

# zの値を作成
def z_make(n,p):
    for prime in p:
        for i in range(1,100000000000):
            z = prime ** i
            
            if z >= n:
                break
            
            if not z in memo:
                memo.append(z)

def divGame2(n):
    for z in memo:
        global ans
        if n % z == 0:
            rem = n / z
            memo.remove(z)
            ans += 1
            #print("n=",n," z=",z,"rem=",rem," ans=",ans)
            return divGame2(rem)
        if n < z:
            break

memo = []  # memory
ans = 0    # answer
p = []     # Prime

n = int(input())

if isPrime(n): # 素数だったら１が答え
    print(1)
else:
  　p = makePrime(64000) #32000 87000でも、1898 msとぎりぎりのためこのコードはダメっぽい
    z_make(n,p)  # zの値を生成。memoができる
    memo.sort()  # 念のため並び替え

    divGame2(n)  # メイン実行
    print(ans)   # 答えの出力

Submission status: Runtime Error

Solution code:
#import <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    ll n,ans=0;
    cin>>n; if(n==1)cout<<"0\n",exit(0);
    map<ll,ll> fac;

    for(ll i=2; n>1 && i*i<=n ;++i)if(n%i==0) fac[i]++,n/=i,i--;
    fac[n]++;

    for(auto x:fac){
        ll i;
        for(i=1;(i+1)*i/2 <= x.second;i++);
        ans+=i-1;
    }
    cout<<ans<<endl;
}

Submission status: Runtime Error

Solution code:
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0:
        cnt+=1
        temp //= i
      arr.append(cnt)
  if temp!=1:
    arr.append(1)
  if n==1:
    arr.append(0)
  return arr
def kak(n):
  return ((1+8*n)**(1/2)-1)//2
  
A=dactorization(int(input()))
print(sum([kak(i) for i in A]))

Submission status: Runtime Error

Solution code:
def main(n):

    prime = []
    if n < 2:
        return 1
    for p in range(2,int(n**0.5)):
        cnt = 0
        if p*p > n:
            break
        while n%p == 0:
            n //= p
            cnt += 1
        prime.append((p,cnt))
    if n > 1:
        prime.append((n,1))
    return prime
                    
n = int(input())    
pf = main(n)

ans = 0
for p, f in pf:
    cnt = 1
    while f >= cnt:
        f -= cnt
        ans += 1
        cnt += 1

print(ans)

Submission status: Runtime Error

Solution code:
import math
import sympy as sy
n = int(input())
a = sy.factorint(n)
p_list=[]
for i in a:
    p_list.append(i)

p_list.append(n)

N=n
cnt=0
while N!=1:
    for p in p_list:
        for e in range(1,int(math.log2(n))+1):
            z=p**e
            if z > N:
                break
            else:
                if N%z==0:
                    N=N//z
                    cnt+=1
    N=1    
print(cnt)

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef long long ll;
typedef long double lld;
typedef long long int lli;
using namespace std;
const int N = 1000001;
const int MOD = 1e9+7;
const bool DEBUG = 1;
#define sd(x) scanf("%d ", &x)
#define sd2(x, y) scanf("%d%d", &x, &y)
#define sd3(x, y, z) scanf("%d%d%d", &x, &y, &z)
#define endl "\n"
#define fi first
#define se second
#define eb emplace_back
#define fbo find_by_order
#define ook order_of_key
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)
#define LET(x, a) __typeof(a) x(a)
#define foreach(it, v) for (LET(it, v.begin()); it != v.end(); it++)
#define MEMS(a, b) memset(a, b, sizeof(a))
#define _			\
    ios_base::sync_with_stdio(false);			\
    cin.tie(NULL);			\
    cout.tie(NULL);
#define __			\
    freopen("input.txt", "r", stdin);			\
    freopen("output.txt", "w", stdout);
#define all(c) c.begin(), c.end()
#define inf 1000000000000000001
#define epsilon 1e-6
#define int ll
#define RUN_T			\
    int _t;			\
    cin >> _t;			\
    while (_t--)
#define tr(...)			\
if (DEBUG) {			\
    cout << __FUNCTION__ << ' ' << __LINE__ << " = ";			\
    trace(#__VA_ARGS__, __VA_ARGS__);			\
}
template <typename S, typename T>
ostream &operator<<(ostream &out, pair<S, T> const &p) {
    out << '(' << p.fi << ", " << p.se << ')';
    return out;
}
template <typename T>
ostream &operator<<(ostream &out, set<T> const &v) {
    for (auto i = v.begin(); i != v.end(); i++)
        out << (*i) << ' ';
    return out;
}
template <typename T, typename V>
ostream &operator<<(ostream &out, map<T, V> const &v) {
    for (auto i = v.begin(); i != v.end(); i++)
        out << "\n" << (i->first) <<  ":"  << (i->second);
    return out;
}
template <typename T, typename V>
ostream &operator<<(ostream &out, unordered_map<T, V> const &v) {
    for (auto i = v.begin(); i != v.end(); i++)
        out << "\n" << (i->first) <<  ":"  << (i->second);
    return out;
}
template <typename T>
ostream &operator<<(ostream &out, multiset<T> const &v) {
    for (auto i = v.begin(); i != v.end(); i++)
        out << (*i) << ' ';
    return out;
}
template <typename T>
ostream &operator<<(ostream &out, unordered_set<T> const &v) {
    for (auto i = v.begin(); i != v.end(); i++)
        out << (*i) << ' ';
    return out;
}
template <typename T>
ostream &operator<<(ostream &out, unordered_multiset<T> const &v) {
    for (auto i = v.begin(); i != v.end(); i++)
        out << (*i) << ' ';
    return out;
}
template <typename T> ostream &operator<<(ostream &out, vector<T> const &v) {
    ll l = v.size();
    for (ll i = 0; i < l - 1; i++)
        out << v[i] << ' ';
    if (l > 0)
        out << v[l - 1];
    return out;
}
template <typename T> void trace(const char *name, T &&arg1) {
    cout << name <<  ":"  << arg1 << endl;
}
template <typename T, typename... Args>
void trace(const char *names, T &&arg1, Args &&... args) {
    const char *comma = strchr(names + 1, ',');
    cout.write(names, comma - names) <<  ":"  << arg1 <<  "|" ;
    trace(comma + 1, args...);
}
template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
int gcd(int a, int b) {
     if (b == 0)
           return a;
     return gcd(b, a % b);
}
int prime[N];
int vis[N];
vector<int>prim;
void sieve(){
    for(int i = 2 ; i <= N; i++){
        if(vis[i] != 1){
            prim.pb(i);
            for(int j = i ; j <= N; j+=i){
                prime[j] = 1;
                vis[j] = 1;
            }
        }
    }
}
int32_t main(){
    _
    sieve();
    int n;
    cin >> n;
    int ans = 0;
    vector<int>v;
    for(int i =  0 ;i < prim.size(); i++){
        if( n % prim[i] == 0){
            v.pb(prim[i]);
        }
    }
    if(v.size() == 0){
        cout << 1 << endl;
        return 0;
    }
    for(int p: v){
        int cnt = 0;
        int prev = 0;
        while(n % p == 0){
            n = n / p;
            cnt++;
            if(cnt > prev){
                ans++;
                prev = cnt;
                cnt = 0;
            }
        } 
    }
    cout << ans << endl;
}

Submission status: Runtime Error

Solution code:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


N = int(input())
A = prime_factorize(N)

cnt = 0

for p, e in A:
    if p == 1:
        cnt = 0
        break
    for i in range(1, 10**12):
        e -= i
        if e < 0:
            break
        else:
            cnt += 1

print(cnt)

Submission status: Runtime Error

Solution code:
import math as m
 
def Div():
    N = int(input())
    c = 0
    k = N//2 + 1
    for i in range(2,k):
        if(prime(i)):
            for j in range(1,int(m.sqrt(N))+1):
                p = i ** j
                if(p>N):
                    break
                if(N%p==0):
                    N = N //p
                    c = c + 1
    
    return c

if __name__ == "__main__":
print(Div())

Submission status: Runtime Error

Solution code:
import sys
import math


def is_prime(N):
    if N == 1:
        return False
    i = 2
    while i * i <= N:
        if N % i == 0:
            return False
        i += 1
    return True

def prime(N):
    prime = []
    is_prime = []  # 全て素数であると初期化
    for i in range(N):
        if i * i > N:
            break
        is_prime.append(True)
    is_prime[0] = is_prime[1] = False # 0,1は素数ではない
    n = len(is_prime)
    for i in range(2, n):
        if is_prime[i]:
            # iは素数である
            prime.append(i)
            for j in range(2 * i, n, i):
                # iの倍数は素数でない
                is_prime[j] = False
    # N以下の素数を表示
    return prime, n

def main():
    N = int(input())
    if N == 1:
        print(0)
    else:
        if is_prime(N):
            print(1)
        else:
            prime_list, n = prime(N)
            used = []
            prime_exponentiation = []
            count = 0
            for i in range(len(prime_list)):
                now = prime_list[i]
                j = 1
                while now ** j <= N:
                    prime_exponentiation.append(now ** j)
                    j += 1
            prime_exponentiation.sort()
            for i in range(len(prime_exponentiation)):
                now = prime_exponentiation[i]
                if N < now:
                    j = 0
                    while not is_prime(N):
                        if N == 1:
                            break
                        if N % prime_list[j] == 0:
                            N //= prime_list[j]
                        j += 1 
                    break
                if N % now == 0:
                    count += 1
                    used.append(now)
                    N //= now
            if N not in used and N != 1:
                count += 1
            print(count)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
num  = int(input())
#prime number counter
ans = 0
prime_check = [1]*1000100
count = 2
while num>1:
    if prime_check[count]==1: #countが素数だった場合
        tmp = 0
        while num % count == 0: #numの因数にcountが何個含まれているか
            num/= count
            tmp += 1
        tmp2 =1
        while tmp>=tmp2: #ansに加える
            ans += 1
            tmp -= tmp2
            tmp2 += 1
        tmp = count
        while tmp*count<=1e6:
            prime_check[tmp*count] = 0
            tmp += 1
    count += 1

print(ans)

Submission status: Runtime Error

Solution code:
def Div():
    N = int(input())
    c = 0
    k = N//2 + 1
    for i in range(2,k):
        if(prime(i)):
            for j in range(1,int(m.sqrt(N))+1):
                i = i ** j
                if(i>N):
                    break
                if(N%i==0):
                    N = N //i
                    c = c + 1
    
    return c
        

if __name__ == "__main__":
    print(Div())

Submission status: Runtime Error

Solution code:
N = int(input())
s = 0
while N !=1:
  for i in range(N):
    if N%i ==0:
      s += 1
      N = int(N/i)
      break
print(s)

Submission status: Runtime Error

Solution code:
import sympy
n = int(input())
c = 0
for i, j in sympy.factorint(n).items():
    for k in range(j):
        if n % i ** (k + 1) == 0:
            n = n / i ** (k + 1)
            c = c + 1
        else:
            break
print(c)

Submission status: Runtime Error

Solution code:
import numpy as np
def p_num_edit(n):
    tmp = n
    ans = []
    for i in range(2, int(np.sqrt(n)) + 1):
        cnt = 0
        while tmp % i == 0:
            cnt += 1
            tmp = int(tmp / i)
        if cnt > 0:
            ans.append([i, cnt])
    if tmp != 1:
        ans.append([tmp, 1])
    if ans == []:
        ans.append([n, 1])
    return ans


n = xnxn()

if n == 1:
    print(0)
    sys.exit()
else:
    a = p_num_edit(n)
    c = 0
    for num in a:
        i = 1
        while num[1] - i > -1:
            num[1] -= i
            i += 1
            c += 1
    print(c)

Submission status: Runtime Error

Solution code:
N = int(input())
n, p, score = N, 2, 0
while p ** 2 <= N:
  e = 1
  print(n, p, e)
  while n >= (p ** e) 
and n % (p ** e) == 0:
    n = n // (p ** e)
    score += 1
    e += 1
  else:
    p = p + 1 if p == 2 else p + 2
else:
  if n != 1:
    score += 1
print(score)

Submission status: Runtime Error

Solution code:
def solve(n):
    for i in range(n+1):
        if (i+1)*i//2 > n:
            return i-1

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr



N = int(input())
li = factorization(N)
ans = 0
for [a,b] in li:
    ans += solve(b)
print(ans)

Submission status: Runtime Error

Solution code:
def solve(n):
    for i in range(n+1):
        if (i+1)*i//2 > n:
            return i-1

from math import sqrt

N = int(input())
P = []
li = []
num = int(sqrt(N))+1
for i in range(2, num):
    if N%i == 0:
        P.append(i)
        P.append(N//i)

for p in P:
    e = 0
    while N%(p**(e+1)) == 0:
        e += 1
    if e > 0:
        li.append((p, e))
    N //= p ** e

ans = 0     
for (a,b) in li:
    ans += solve(b)
    
if ans == 0:
    if N != 1:
        ans += 1
        


print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
def prime_dict(n):
    a = {}
    if n%2 == 0:
        a[2] = 1
        n//=2
        exp2 = 2
    while n%(2**exp2) == 0 and (n >= 2**exp2):
        a[2] += 1
        n //= 2**exp2
        exp2 += 1
    while n%2 == 0:
        n //= 2
    f = 3
    expn = 1
    while f**expn <= n:
        while f**expn <= n:
            if n%(f**expn) == 0:
                if f not in a:
                    a[f] = 1
                else:
                    a[f] += 1
                n //= f**expn
            expn += 1
        while n%f == 0 and n >= f:
            n //= f
        f += 2
        expn = 1
    if n!= 1:
        a[n] = 1
    return a

primes = prime_dict(N)
ans = sum(primes.values())
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
def prime_dict(n):
    a = {}
    if n%2 == 0:
        a[2] = 1
        n//=2
        exp2 = 2
    while n%(2**exp2) == 0 and (n >= 2**exp2):
        a[2] += 1
        n //= 2**exp2
        exp2 += 1
    while n%2 == 0:
        n //= 2
    f = 3
    expn = 1
    while f**expn <= n:
        while f**expn <= n:
            if n%(f**expn) == 0:
                if f not in a:
                    a[f] = 1
                else:
                    a[f] += 1
                n //= f**expn
            expn += 1
        while n%f == 0:
            n //= f
        f += 2
        expn = 1
    if n!= 1:
        a[n] = 1
    return a

primes = prime_dict(N)
ans = sum(primes.values())
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
def prime_dict(n):
    a = {}
    if n%2 == 0:
        a[2] = 1
        n//=2
        exp2 = 2
    while n%(2**exp2) == 0 and (n > 2**exp2):
        a[2] += 1
        n //= 2**exp2
        exp2 += 1
    while n%2 == 0:
        n //= 2
    f = 3
    expn = 1
    while f**expn <= n:
        while f**expn <= n:
            if n%(f**expn) == 0:
                if f not in a:
                    a[f] = 1
                else:
                    a[f] += 1
                n //= f**expn
            expn += 1
        while n%f == 0:
            n //= f
        f += 2
        expn = 1
    if n!= 1:
        a[n] = 1
    return a

primes = prime_dict(N)
ans = sum(primes.values())
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
def prime_dict(n):
    a = {}
    if n%2 == 0:
        a[2] = 1
        n//=2
        exp2 = 2
    while n%(2**exp2) == 0:
        a[2] += 1
        n //= 2**exp2
        exp2 += 1
    while n%2 == 0:
        n //= 2
    f = 3
    expn = 1
    while f**expn <= n:
        while f**expn <= n:
            if n%(f**expn) == 0:
                if f not in a:
                    a[f] = 1
                else:
                    a[f] += 1
                n //= f**expn
            expn += 1
        while n%f == 0:
            n //= f
        f += 2
        expn = 1
    if n!= 1:
        a[n] = 1
    return a

primes = prime_dict(N)
ans = sum(primes.values())
print(ans)