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:

N = int(input())
fact = factorization(N)
fact_num = []
fact_num2 = []

    
for i in range(len(fact)):
    fact_num.append(fact[i][0])
    fact_num2.append(fact[i][1])

cnt=0

for j in range(1000000):
    for i in range(len(fact)):
        if N%fact_num[i]==0 and N%(fact_num[i]*(j+1))==0:
            N = N/(fact_num[i]*(j+1))
            cnt+=1

print(cnt)

Submission status: Runtime Error

Solution code:
import sympy
sympy.divisors(10**9)

num = 24

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

l = make_divisors(num)
cnt = 0

for z in l[1:]:
    if num == 1:
        break
    elif num % z == 0:
        num /= z
        cnt += 1

print(cnt)

Submission status: Runtime Error

Solution code:
import sympy
n = int(input())
p = 1
e = 1
count = 0
z_a = []
if n == 1:
    print(count)
else:
    while n != 1:
        # 素数約数配列を作る
        divisors = sympy.divisors(int(n))
        p_div = []
        for i in divisors:
            if i == 1:
                pass
            if len(sympy.divisors(int(i))) == 2:
                p_div.append(int(i))

        p = p_div[0]
        z = p ** e
        if int(z) in z_a:
            z = p ** (e + 1)
        z_a.append(int(z))
        if n % z == 0:
            n = int(n / z)
            count += 1
    print(count)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(100000)
def is_prime(x):
    if x < 2: return False
    if x == 2 or x == 3 or x == 5: return True 
    if x % 2 == 0 or x % 3 == 0 or x % 5 == 0: return False

    prime = 7
    step = 4
    while prime <= math.sqrt(x):
        if x % prime == 0: return False

        prime += step
        step = 6 - step

    return True

def prime_factorization(n):
  d = 2
  cnt = 0
  seen = []
  while d*d <= n:
    if n%d == 0:
      t = 1
      while d**t <= n:
        if n % (d**t) == 0:
          seen.append(d**t)
          n //= (d**t)
          cnt += 1
          t += 1
        else:
          break
    d += 1
 
  if n != 1 and is_prime(n):
    cnt += 1
 
  return cnt
 
n = int(input())
print(prime_factorization(n))

Submission status: Runtime Error

Solution code:
import sympy
import numpy as np

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

def is_prime(n):
    for i in range(2, n + 1):
        if i * i > n:
            break
        if n % i == 0:
            return False
    return n != 1

def all_the_same(elements):
    return elements[1:] == elements[:-1]

def main():
    n = int(input())

    ans = 0
    num_list = []

    div_list = sympy.divisors(n)

    while n > 1:
        for d in div_list:
            res = prime_decomposition(d)
            if len(res) > 0:
                res.sort()
                if d not in num_list:
                    if not all_the_same(res):
                        continue
                    num_list.append(d)
                    n = n/d
                    ans += 1
                    if n < 1:
                        break

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
from math import sqrt
n = int(input())
p = [2]
for i in range(2, int(sqrt(n))):
    for j in range(len(p)):
        if i % p[j] == 0:
            break
        else:
            if j == len(p)-1 and n%i == 0:
                p.append(i)
l = []
c = 0
for j in range(1, int(sqrt(n))):
    for i in range(len(p)):
        if n%(p[i]**j) == 0 and p[i]**j not in l:
            n /= p[i]**j
            l.append(p[i]**j)
            c += 1

print(c)

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit(10000)

def dfs(n):
    global ans
    while len(pn)>=sss/3:
        if len(pn)==0:
            l.append(ans)
            break
        elif n%pn[0]==0:
            nn = n/pn[0]
            nn = int(nn)
            pn.remove(pn[0])
            ans+=1
            #print(nn)
            dfs(nn)
        elif n%pn[0]!=0 :
            pn.remove(pn[0])
            continue
        
iii=int(input())        
        

pnn=[2];A=iii
for L in range(3,A):
    chk=True
    for L2 in pnn:
        if L%L2 == 0:chk=False
    if chk==True:pnn.append(L)

pn=pnn
for j in range(5):
        pn.append(pnn[j]**2)
        pn.append(pnn[j]**3)
        
sorted(pn)
sss = len(pn)

#print(pn)
ans = 0
l=[]
aaaaa=True
dfs(iii)
#print(l)
print(max(l))

Submission status: Runtime Error

Solution code:
import math


def isPrime(n):
    if n == 2:
        return True
    if n % 2 == 0:
        return False

        # nの平方根まで計算する
    m = math.floor(math.sqrt(n)) + 1
    for p in range(3, m, 2):
        if n % p == 0:
            return False
    return True


N = int(input())
if N == 1:
    print(0)
elif isPrime(N):
    print(1)
else:
    count = 0
    for i in range(2, N//2):
        if not isPrime(i):
            continue
        if isPrime(N) and i > N:
            break
        for j in range(1, 10):
            if N % i**j == 0:
                N = N / i**j
                count += 1
                if N == 1 or N % i != 0:
                    break
print(count)

Submission status: Runtime Error

Solution code:
import itertools
N=int(input())
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
x=prime_factorize(N)
l=list(set(prime_factorize(N)))
s=[]
for i in range(len(l)):
    s.append([])
for i in l:
    a=l.index(i)
    b=i
    for j in range(x.count(i)):
        s[a].append(i)
        i*=b
t=list(itertools.chain.from_iterable(s))
ans=0
while len(t)>0:
    p=t.pop(t.index(min(t)))
    sp=s[l.index(p)]
    ssp=sp[len(sp)-1]
    sp.pop(sp.index(ssp))
    t.pop(t.index(ssp))
    ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
def is_prime(x):
    if x < 2: return False
    if x == 2 or x == 3 or x == 5: return True 
    if x % 2 == 0 or x % 3 == 0 or x % 5 == 0: return False

    prime = 7
    step = 4
    while prime <= math.sqrt(x):
        if x % prime == 0: return False

        prime += step
        step = 6 - step

    return True

def prime_factorization(n):
  d = 2
  cnt = 0
  seen = []
  while d*d <= n:
    if n%d == 0:
      t = 1
      while d**t <= n:
        if n % (d**t) == 0:
          seen.append(d**t)
          n //= (d**t)
          cnt += 1
          t += 1
        else:
          break
    d += 1
 
  if n != 1 and is_prime(n):
    cnt += 1
 
  return cnt
 
n = int(input())
print(prime_factorization(n))

Submission status: Runtime Error

Solution code:
N = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i: #平方数重複カウント対策
                divisors.append(n//i)
    divisors.sort()
    return divisors

A=make_divisors(N)
A=A.pop(0)
print(A)

c=0
for i in range(len(A)):
    if N%A[i]==0:
        N = N//A[i]
        c+=1
print(c)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define repin(a, n)  \
	vector<ll> a(n); \
	rep(i, n) { cin >> a[i]; }
#define repins(a, n)     \
	vector<string> a(n); \
	rep(i, n) { cin >> a[i]; }
#define repind(a, n)     \
	vector<double> a(n); \
	rep(i, n) { cin >> a[i]; }
#define in(a) \
	ll a;     \
	cin >> a;
#define ins(a) \
	string a;  \
	cin >> a;
#define ind(a) \
	double a;  \
	cin >> a;
template <class T>
inline void out(T a)
{
	cout << a << endl;
}
inline void out(double a) { printf("%.10f\n", a); }
#define all(x) (x).begin(), (x).end()
#define rep2(i, a, b) for (ll i = (a); i < (b); ++i)
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
#define yes out("Yes")
#define no out("No")
#define degtorad(deg) (deg * M_PI / 180.0)
#define radtodeg(rad) (rad * 180.0 / PI)

vector<pair<long long, long long> > prime_factorize(long long N) {
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0; // 指数

        // 割れる限り割り続ける
        while (N % a == 0) {
            ++ex;
            N /= a;
        }

        // その結果を push
        res.push_back({a, ex});
    }

    // 最後に残った数について
    if (N != 1) res.push_back({N, 1});
    return res;
}

int main() {
    in(n);
	if(n==1){
		out(0);
		return 0;		
	}
    const auto &res = prime_factorize(n);
	ll c = 0;
    for (auto p : res) {
		ll a = p.second;
        for(ll i = 1;i<numeric_limits<ll>::max();i++){
			a -= i;
			if(a < 0){
				break;
			}
			c += 1;
		}
    }
	out(c);
}

Submission status: Runtime Error

Solution code:
m=int(input())
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

l=factorization(m)
ans=0
for i in range(len(l)):
    a=1
    while(l[i][1]>=a):
        ans+=1
        l[i][1]-=a
        a+=1
if m=1:
    print("0")
else:
    print(ans)

Submission status: Runtime Error

Solution code:
from sympy import sieve, primerange, isprime
def main():
    N = int(input())
    n = N
    count = 0

    if isprime(N):
        print(1)
        exit(0)

    for p in sieve:
        if p > n:
            break
        for e in range(1,N):
            z = p**e
            if z>n:
                break
            if n%z == 0:
                count+=1
                n /= z
    print(count)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline

"""
z = p^e where p is a prime number and e = positive int
z divides N
"""

def get_primes(up_to=1000):
    primes = []

    A = [True] * (up_to + 2)

    for i in range(2, int(up_to**0.5)+1):
        if A[i]:
            j = i*2
            while j < up_to:
                A[j] = False
                j += i
    
    i = 2

    while i < up_to:
        if A[i]:
            primes.append(i)
        i += 1

    return primes

from math import sqrt

n = int(input())
used = set()
primes = get_primes(int(sqrt(n))+2)
ze = []
for z in primes:
    i = 1
    zval = z**i
    while zval <= n:
        if not(zval in used):
            ze.append(zval)
            used.add(zval)
        i += 1
        zval = z**i

ze.sort()

count = 0

for z in ze:
    if z > n:
        break

    if n % z == 0:
        count += 1
        n //= z

def is_prime(n):
    if n < 2:
        return False
    elif n == 2 or  n == 3:
        return True

    for i in range(2, int(sqrt(n))+2):
        if n % i == 0:
            return False
    return True

#print(primes)
if not ze:
    print(0)
if n > ze[-1] and is_prime(n):
    print(count +1)
else:
    print(count)

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <string>
#include <math.h>
#include <iomanip>
#include <stdio.h>
#include <algorithm>
#include <ctime>
#include <vector>
#include <set>
#include <queue>
using namespace std;

#define PI 3.14159265358979323846264338327950L

long long int res;

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

    long long int N;
    cin >> N;
    long long int number = 2;
    int cnt = 0;
    while (N > 1)
    {
        if(N%number==0){
            N /= number;
            cnt++;
        }
        number++;
    }
    cout << cnt << endl;
    return 0;
}

Submission status: Runtime Error

Solution code:
n=int(input())
s=list(range(2,n+1))
count=0

for i in s:
    if n%i==0:
        n/=i
        count+=1
    else:
        n=n

print(count)

Submission status: Runtime Error

Solution code:
def main():
    n = int(input())
    on = n
    def is_prime(n):
        for i in range(2, n + 1):
            if i * i > n:
                break
            if n % i == 0:
                return False
        return n != 1
    if is_prime(n):
        print(1)
        sys.exit()

    nn = ceil(n**0.5)
    nn = max(6, nn)
    p = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(nn + 1)]
    p[0] = p[1] = False
    p[2] = p[3] = p[5] = True
    for i1 in range(3, floor(nn ** 0.5) + 1, 2):
        if p[i1]:
            for i2 in range(i1 ** 2, nn + 1, i1):
                p[i2] = False
        else:
            continue
    pl = [i for i, b in enumerate(p) if b == True]

    nums = deepcopy(pl)
    for pe in pl:
        cnt = 2
        while True:
            tnum = pow(pe, cnt)
            if tnum > n:
                break
            elif tnum != 0:
                if n % tnum == 0:
                    nums.append(tnum)
            cnt += 1

    nums.sort()
    numsd = deque(nums)
    ok = set()
    r = 0
    while True:
        if not numsd:
            break
        if n == 1:
            break
        nextn = numsd.popleft()
        if nextn > on or nextn > n:
            break
        elif n % nextn == 0:
            if nextn in ok:
                continue
            else:
                n = int(n // nextn)
                ok.add(nextn)
                r += 1
        if n == 1:
            break


    print(r)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n = int(input())
#print(n)

import math

def make_prime_list_2(num):
    if num < 2:
        return []

    # 0のものは素数じゃないとする
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 # 1は素数ではない
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]

import collections
from collections import defaultdict

def prime_factorization_1(num):
    if num <= 1:
        return False
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        dict_counter = defaultdict(int)
        for prime in prime_list:
            while num % prime == 0:
                dict_counter[prime] += 1
                num //= prime
        if num != 1:
            dict_counter[num] += 1

        dict_counter = dict(dict_counter)

        return dict_counter

x = prime_factorization_1(n)
#print(x)
y = list(x.keys())
z = list(x.values())
#print(y)
#print(z)

l = []
for i in range(len(y)):
    l += [y[i]]*z[i]
#print(l)

ans = []
tmp = 1
for j in l:
    if j not in ans:
        ans.append(j)
    else:
        r = tmp * j
        if r != tmp:
            if r not in ans:
                ans.append(r)
                tmp = 1
            else:
                tmp = r
#print(ans)
print(len(ans))

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

a = int(input())
b = factorization(a)
countation = 0
for i in range(len(b)):
    t = b[i][1]
    k = 1
    n = 1
    while t >= n:
        countation += 1
        k = k + 1
        n = k*(k+1)/2
if a != 1
    print(countation)
else:
    print(0)

Submission status: Runtime Error

Solution code:
import math
def total(n):
    return int((-1 + math.sqrt(1 + 8 * n)) / 2); 
def isPrime(n) : 
  
    # Corner cases 
    if (n <= 1) : 
        return False
    if (n <= 3) : 
        return True
  
    # This is checked so that we can skip  
    # middle five numbers in below loop 
    if (n % 2 == 0 or n % 3 == 0) : 
        return False
  
    i = 5
    while(i * i <= n) : 
        if (n % i == 0 or n % (i + 2) == 0) : 
            return False
        i = i + 6
  
    return True
  
def sieveOfEratosthenes(N, s): 
    prime = [False] * (N+1) 
    for i in range(2, N+1, 2):  
        s[i] = 2
    for i in range(3, N+1, 2): 
        if (prime[i] == False): 
              
            s[i] = i 
            for j in range(i, int(N / i) + 1, 2): 
                if (prime[i*j] == False): 
                    prime[i*j] = True 
                    s[i * j] = i 
  
def generatePrimeFactors(N): 

    s = [0] * (N+1) 
    sieveOfEratosthenes(N, s) 
    curr = s[N] 
    cnt = 1 
    tot = 0
    while (N > 1): 
        N //= s[N]
        if (curr == s[N]): 
            cnt += 1
            continue
        tot+=total(cnt)
        curr = s[N] 
        cnt = 1
    return tot
def sol():
    n = int(input())
    if n == 1:
        print(0)
        return
    if isPrime(n):
        print(1)
        return

    print(generatePrimeFactors(n))
    
sol()

Submission status: Runtime Error

Solution code:
import collections
N = int(input())

c = collections.Counter(prime_factorize(N))

ans = 0
for j in c:
    for i in range(1,c[j]+1):
        if c[j] == 1:
            ans += 1
        elif i*(i+1)<= 2*c[j] < (i+1)*(i+2):
            ans += i

print(ans)

Submission status: Runtime Error

Solution code:
def conv_v(x):
  if x <= 2 : return 1
  if x <= 5 : return 2
  if x <= 9 : return 3
  if x <= 14 : return 4
  if x <= 20 : return 5
  if x <= 27 : return 6
  if x <= 35 : return 7
 
 
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.trim())
li = factorization(N)
answer = 0
for i in range(len(li)):
  answer += conv_v(li[i][1])

print(int(answer))

Submission status: Runtime Error

Solution code:
from decimal import *
import math
A,B = input().split()
A = Decimal(float(A))
B = Decimal(float(B))
print(math.floor(A*B))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun May 31 17:33:13 2020

@author: Areeb
"""

import numpy as np
# Python3 program to print prime 
# factors and their powers 
# using Sieve Of Eratosthenes 

# Using SieveOfEratosthenes to 
# find smallest prime factor 
# of all the numbers. 

# For example, if N is 10, 
# s[2] = s[4] = s[6] = s[10] = 2 
# s[3] = s[9] = 3 
# s[5] = 5 
# s[7] = 7 
def sieveOfEratosthenes(N, s): 
	
	# Create a boolean array 
	# "prime[0..n]" and initialize 
	# all entries in it as false. 
	prime = [False] * (N+1) 

	# Initializing smallest factor 
	# equal to 2 for all the even 
	# numbers 
	for i in range(2, N+1, 2): 
		s[i] = 2

	# For odd numbers less then 
	# equal to n 
	for i in range(3, N+1, 2): 
		if (prime[i] == False): 
			
			# s(i) for a prime is 
			# the number itself 
			s[i] = i 

			# For all multiples of 
			# current prime number 
			for j in range(i, int(N / i) + 1, 2): 
				if (prime[i*j] == False): 
					prime[i*j] = True

					# i is the smallest 
					# prime factor for 
					# number "i*j". 
					s[i * j] = i 

def quad(n):
	return int((np.sqrt(8*n+1)-1)/2)

# Function to generate prime 
# factors and its power 
def generatePrimeFactors(N): 
	ans=0
	# s[i] is going to store 
	# smallest prime factor 
	# of i. 
	s = [0] * (N+1) 

	# Filling values in s[] 
	# using sieve 
	sieveOfEratosthenes(N, s) 

	#print("Factor Power") 

	# Current prime factor of N 
	curr = s[N] 
	
	# Power of current prime factor 
	cnt = 1

	# Printing prime factors and 
	#their powers 
	while (N > 1): 
		N //= s[N] 

		# N is now N/s[N]. If new N 
		# als has smallest prime 
		# factor as curr, increment 
		# power 
		if (curr == s[N]): 
			cnt += 1
			continue

		#print(str(curr) + "\t" + str(cnt)) 
		ans+=quad(cnt)

		# Update current prime factor 
		# as s[N] and initializing 
		# count as 1. 
		curr = s[N] 
		cnt = 1
	return ans

#Driver Program 
N=int(input())
ans=generatePrimeFactors(N) 
print(ans)

# This code is contributed by Ansu Kumari

Submission status: Runtime Error

Solution code:
N = int(input())

import math

def sieve_of_eratosthenes(n):
    candidate = [i for i in range(2, n+1)]
    prime = []
    limit = math.sqrt(n) + 1

    while True:
        p = min(candidate)
        if limit <= p:
            prime.extend(candidate)
            break
        prime.append(p)

        candidate = [i for i in candidate if i % p != 0]

    return prime


if N == 1:
    print(0)
    exit()

rn = math.ceil(math.sqrt(N))
L = sieve_of_eratosthenes(rn)

n = N
c = 0
used = []

for l in L:
    if n % l == 0:
        i = 1
        l2 = l
        while n % l2 == 0:
            c += 1
            i += 1
            used.append(l2)
            n = n // l2
            l2 = l ** i

if c == 0:
    print(1)
else:
    if n != 1:
        x = sieve_of_eratosthenes(n)
        if n == x[-1] and n not in used:
            c += 1
    print(c)

Submission status: Runtime Error

Solution code:
x = int(input())
count = 0
def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]
sosu = primes(x)
for m in range(len(sosu)):
    ima = sosu[m]
    for mm in range(1,10**11):
        if x % (ima**mm)==0:
            x /= ima
            count +=1
        else:
            break
print(count)

Submission status: Runtime Error

Solution code:
import sympy
sympy.divisors(10**9)

num = int(input())

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

l = make_divisors(n)
cnt = 0

for z in l[2:]:
    if num == 1:
        print(cnt)
    elif num % z == 0:
        num /= z
        cnt += 1

Submission status: Runtime Error

Solution code:
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

N = int(input())
list = make_divisors(N)
j=0
cnt=0
while(1):
  N = N / list[j]
  if N==1:
    break
  cnt=cnt+1
  j=j+1
print(cnt)

Submission status: Runtime Error

Solution code:
N = int(input())
def ret(x,y,i):
    if x==1 or i>x:
        return print(y)
    else:
        if x%i==0:
            return ret(x/i,y+1,i+1)
        else:
            return ret(x,y,i+1)
ret(N,0,2)

Submission status: Runtime Error

Solution code:
from sympy import divisors
input_line1 = input()
N = int(input_line1)
count = 0
D = len(divisors(N))

if D == 2:
    count = 1
else:
    for i in range (2,N):
        if N % i == 0:
            count += 1
            N = int(N / i)
            D = len(divisors(N))
            if D == 2:
                count += 1
                if N <= i:
                    count -= 1
                break
 
print(count)

Submission status: Runtime Error

Solution code:
from collections import Counter
import math

def div(n):
    if n == 1:
        return []
    prime = []
    tmp = int(math.sqrt(n)) + 1
    
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            prime.append(num)
    
    if len(prime) == 0:
        return [1]
    else:
        return prime

n = int(input())
prime_div = dict(Counter(div(n)))
ans = 0
divs = list(prime_div.values())

for i in range(len(divs)):
    k = 0
    for j in range(1, 10):
        k += j
        if k > divs[i]:
            tmp = divs[i] - k + j
            break
        ans += 1

theta = 0
for i in range(1, 10):
    theta += i 
    if theta >= tmp:
        break
    ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
if N == 1:
    print(0)
else:
    result = 0
    for i in range(len(factorization(N))):
        tempnumber = factorization(N)[i][1]
        plusnumber = 1
        while tempnumber > 0:
            tempnumber -= plusnumber
            result += 1
            plusnumber += 1
    print(result)

Submission status: Runtime Error

Solution code:
import sympy
import math
#A,B=list(map(float,input().split(' ')))
N=int(input())
P=list(sympy.primerange(1,math.sqrt(N)+1))
l=[]
for p in P:
    if N%p==0:
        l.append(0)
        while N%p==0:
            N=N/p
            l[-1]=l[-1]+1
    if N==1:
        break
if l==[]:
    print(1)
k=0
for i in l:
    n=1
    d=0
    while i//((n+1)*(n)/2)>0:
        n=n+1
        d=d+1
    if d>0:
        k=k+n-1
    d=0
if k!=0:
    print(k)

Submission status: Runtime Error

Solution code:
N = int(input())

import math

def sieve_of_eratosthenes(n):
    candidate = [i for i in range(2, n+1)]
    prime = []
    limit = math.sqrt(n) + 1

    while True:
        p = min(candidate)
        if limit <= p:
            prime.extend(candidate)
            break
        prime.append(p)

        candidate = [i for i in candidate if i % p != 0]

    return prime


if N == 1:
    print(0)
    exit()

rn = math.ceil(math.sqrt(N))
L = sieve_of_eratosthenes(rn)

n = N
c = 0
used = []

for l in L:
    if n % l == 0:
        i = 1
        l2 = l
        while n % l2 == 0:
            c += 1
            i += 1
            used.append(l2)
            n = n // l2
            l2 = l ** i

if c == 0:
    print(1)
else:
    if n != 1:
        x = sieve_of_eratosthenes(n)
        if n in x and not n in used:
            c += 1
    print(c)

Submission status: Runtime Error

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

count = 0

if n != 0:
    divisor_lst = sympy.divisors(n)
    del divisor_lst[0]

    # print(divisor_lst)

    
    for i in range(len(divisor_lst)):
        if n % divisor_lst[i] == 0:
            # print("a")
            n /= divisor_lst[i]
            count += 1
        else:
            break

print(count)

Submission status: Runtime Error

Solution code:
import math
import sympy
import sys

n = int(input())

if n <= 1:
    print(0)
    sys.exit()

yakusu = set(sympy.divisors(n))
yakusu.discard(1)

sosu = set([min(yakusu)])
tansaku = set(yakusu)
kari = set(tansaku)



while 1:
    for var in tansaku:
        if var % max(sosu) == 0:
            kari.discard(var)
    tansaku = set(kari)
    if len(tansaku) == 0:
        break
    sosu.add(min(tansaku))
sosu = sosu | tansaku

i = 1
j = 0
kari = set(sosu)

while n != 1:
    for var in sosu:
        if n % (var ** i) == 0:
            n = n / (var ** i)
            j += 1
        else:
            kari.discard(var)
    sosu = set(kari)

    i += 1
    if i > 1000:
        break

print(j)

Submission status: Runtime Error

Solution code:
import collections

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


if __name__=="__main__":
    N = int(input())
    count = 0
    counter = collections.Counter(prime_factorize(N))
    output = 0
    for prime in counter:
        num_prime = 1
        count = 1
        while True:
            if counter[prime] >= wa:
                output += 1
                count += 1
                num_prime += count
            else:
                break
    print(output)

Submission status: Runtime Error

Solution code:
import numpy as np

def seachPrimeNum(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum

n=seachPrimeNum(100)
sosu=int(input())
i=0
count=0
p=0
memo=[]
while pow(sosu[p],i) <= n/2:
  while pow(sosu[p],i)<= n/2:
    z=pow(sosu[p],i)
    if n%z==0:
      if not z in memo:
        memo.append(z)
        count+=1
    i+=1
  p+=1

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007

int main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
	std::ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	long long n;
	cin >> n; 

	int q = sqrt(n);

	bool prime[q+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=q; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (int i=p*p; i<=q; i += p) 
                prime[i] = false; 
        } 
    } 
  
  	int sieve[q + 1];
    // Print all prime numbers 
    for (int p=2; p<=q; p++) 
       	if (prime[p]) {
       		sieve[p] = 1;
       		for(int i = p * p; i <= q; i *= p){
       			sieve[i] = 1;
       		}
       	}
       	int count = 0;
    for(int i = 2; i <= q; ++i){
    	if(sieve[i]){
    		if(n%i == 0){
    			n/=i;
    			count++;
    		}
    	}
    }


    cout << count;



	return 0;
}