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:
import math
import collections

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

if n == 1:
    print(0)
else:
    c = collections.Counter(prime_factorize(n))

res = 0
for x, y in c.items():
    num = int( (-1 + (1 +8*y)**(0.5))/2 )
    res += num

print(res)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3

import sympy
# sympy.divisors(10**9)

import sys
n = 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]

def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

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

s = make_divisors(n)
s.remove(1)

ss = [item for item in s if is_prime(item)]

sss = []
for i in ss:
    for p in range(2,100):
        nn = i**p
        if nn > n:
            break
        sss.append(nn)

ssss = sss + ss
ssss = list(dict.fromkeys(ssss))

cnt=0
for i, num in enumerate(ssss):
    if n%num==0:
        n = n//num
        cnt+=1
        if n==1:
            print(cnt)
            sys.exit()

Submission status: Runtime Error

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

n = 0
for i in range(len(arr)):
    a = 0
    b = arr[i]
    while a < b[1]:
        a = a+a+1
        n = n+1
print(n)

Submission status: Runtime Error

Solution code:
import math

N = int(input())
max_n = math.sqrt(N)

if N == 1:
    print(0)
    exit()
count = 0
for i in range(2, int(max_n+1)):
    if N % i == 0:
        count += 1
        N /= i
if N > max_n_t:
    count += 1

print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
count = 0
for z in range(n):

    if n%(z+2) == 0:
        n =n/(z+2)
        count += 1
    elif z >= n/z:
        break
    else:
        continue
print(count)

Submission status: Runtime Error

Solution code:
import sympy
n=int(input())
cnt=0
a=sympy.divisors(n)

for i in range(1,len(a)):
    if n%a[i]==0:
        cnt+=1
        n=n/a[i]
print(cnt)

Submission status: Runtime Error

Solution code:
from sympy import prime, sieve
from collections import Counter

# p = [i for i in sieve.primerange(0,10)]
N = int(input())
cnt = 0
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
li = prime_factorize(N)
li = [str(n) for n in li]
# print(li)
counter = Counter(li)
values, counts = zip(*counter.most_common())
# print(counts)
for i in range(len(counts)):
    if 1 <= counts[i] <= 2:
        cnt += 1
    elif 3 <= counts[i] <= 5:
        cnt += 2
    elif 6 <= counts[i] <= 9:
        cnt +=3
print(cnt)

Submission status: Runtime Error

Solution code:
def soinsu(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=soinsu(n)
c=[]
if n>=2:
    for i in range(max(a)):
        c.append(0)
for i in a:
    c[i-1]+=1
if n>=2:
    f=max(c)
    s=[]
    for i in range(f+1):
        s.append(0)
    for i in c:
        s[i]+=1
z=0
g=[1]
d=1
e=1
while e<=f:
    d+=1
    e=d*(d+1)/2
    g.append(e)
for i in range(len(g)):
    g[i]=int(g[i])
for i in range(1,len(g)):
    z+=i*(sum(s[g[i-1]:g[i]]))


print(z)

Submission status: Runtime Error

Solution code:
n = 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

if n == 1:
    print(0)
    quit()
f = factorization(n)
ans = 0
c = len(f)
for i in range(c):
    s = 0
    g = f[i][1]
    for j in range(g):
        s += j + 1
        f[i][1] -= j+1
        if s > g:
            break
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
import sympy
n=int(input())
cnt=0
a=sympy.divisors(n)


for i in range(1,len(a)):
    if n%a[i]==0:
        cnt+=1
        n=n/a[i]
print(cnt)

Submission status: Runtime Error

Solution code:
import sys     
N = int(input())
if N == 1:
    print(0)
    sys.exit()
# if isPrime(N)==True:
#     print(0)
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:
#!/usr/bin/env python3

import sympy
sympy.divisors(10**9)

import sys
n = 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]

def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

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

s = make_divisors(n)
s.remove(1)

ss = [item for item in s if is_prime(item)]

sss = []
for i in ss:
    for p in range(2,100):
        nn = i**p
        if nn > n:
            break
        sss.append(nn)

ssss = sss + ss
ssss = list(dict.fromkeys(ssss))

cnt=0
for i, num in enumerate(ssss):
    if n%num==0:
        n = n//num
        cnt+=1
        if n==1:
            print(cnt)
            sys.exit()

Submission status: Runtime Error

Solution code:
import math
import sympy


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]


def using_sqrt(limit):
    n = []
    for k in range(2, limit + 1):
        factor = 0

        # 2以外の偶数は素数ではないので無視する
        if k % 2 == 0 and k != 2:
            continue

        # 繰り返しの上限を対象の平方根にする
        for divisor in range(2, math.floor(math.sqrt(k)) + 1):
            if k % divisor == 0:
                factor += 1

        if factor == 0:
            n.append(k)

    return n


def isPrime(limit):
    n = []
    for k in range(limit, limit + 1):
        factor = 0

        # 2以外の偶数は素数ではないので無視する
        if k % 2 == 0 and k != 2:
            continue

        # 繰り返しの上限を対象の平方根にする
        for divisor in range(2, math.floor(math.sqrt(k)) + 1):
            if k % divisor == 0:
                factor += 1

        if factor == 0:
            return True
    return False


n = int(input())
prime = using_sqrt(10**5)
prev = []

if n > 1 and isPrime(n):
    print(1)
    exit()


def check(n, prev):
    divs = make_divisors(int(n))
    flag = False
    for i in divs[1:]:
        for p in prime:
            e = math.log(i, p)
            if e.is_integer() and i not in prev:
                prev.append(i)
                flag = True
                check(n/i, prev)
                break
        if flag:
            break


check(n, prev)
print(len(prev))

Submission status: Runtime Error

Solution code:
from collections import defaultdict
from collections import deque
from itertools import accumulate
import math
def main():
    a,b=map(float, input().split())
    print(int((a*(b*100))//100))


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N = int(input())
M=N
ans=0
U=1

for i in range(2,150):
    e=1
    while N%(i**e)==0:
        N=N//(i**e)
        ans+=1
        e+=1
    if N<i:
        break
for i in range(151,int(M**(1/4))+1):
    e=1
    while N%(i**e)==0:
        N=N//(i**e)
        ans+=1
        e+=1
        U=0
    if N<i:
        break
if M==1:
    ans=0
elif ans==0 and U=1:
    x = int(N**(1/5))
    y = int(N**(1/4))
    z = int(N**(1/3))
    a = int(N**(1/2))
    if x**5==N:
        ans = 2
    elif y**4==N:
        ans = 2
    elif z**3==N:
        ans = 2
    elif a**2==N:
        ans = 1
    else:
        ans=1
print(ans)

Submission status: Runtime Error

Solution code:
import math

n = int(input())
pls = []

for i in range(2, math.floor(math.sqrt(n)) + 1):
    m = 0
    if len(pls) == 0:
        pls.append(i)
    else:
        r = math.sqrt(i) // 1
        k = 0
        while pls[k] <= r:
            if i % pls[k] == 0:
                m = 1
                break
            k += 1
        if m == 0:
            pls.append(i)

if len(pls) == 0:
    print(0)
else:
    fact = []
    for i in range(len(pls)):
        m = n
        k = 0
        if m % pls[i] == 0:
            while m % pls[i] == 0:
                k += 1
                m = m  // pls[i]
            fact.append([pls[i],k])
        else:
            fact.append([pls[i],0])
    ans = 0
    for j in range(len(fact)):
        t = math.fllor(((math.sqrt((8 * ls[i][1]) + 1) - 1) / 2))
        ans += t
    print(ans)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
using lpair = std::pair<long, long>;
bool operator>(const lpair a, const lpair b) { return a.first > b.first; }; //演算子オーバーロード
int main(int argc, char const *argv[])
{

    long n;
    cin >> n;
    vector<long> vec(n + 1, 0);
    std::priority_queue<lpair, std::vector<lpair>, std::greater<lpair>> pq;
    // vector<long> prime;

    int b = (int)sqrt((double)(n + 1)) + 1;
    int a = n + 1;
    for (int i = 2; i < a; i++)
    {
        if (vec.at(i) == 0)
        {
            if (n % i == 0)
            {
                pq.push(make_pair(i, i));
            }

            int j = i;
            while (j < b)
            {
                vec.at(j) = 1;
                j += i;
            }

            // long t = i;
            // while (t < n + 1)
            // {
            //     prime.push_back(t);
            //     t *= i;
            // }
        }
    }
    // sort(prime.begin(), prime.end());

    long counter = 0;
    while (!pq.empty())
    {
        pair<long, long> now = pq.top();
        pq.pop();
        // cout << now.first << endl;
        if (n < now.first)
        {
            break;
        }
        if (n % now.first == 0)
        {
            n /= now.first;
            counter++;
            long tt = now.first * now.second;
            if (n >= tt)
            {
                pq.push(make_pair(tt, now.second));
            }
        }
    }
    cout << counter << endl;
    return 0;
}

Submission status: Runtime Error

Solution code:
n = int(input())
ans = 0
def judge_prime(i):
    cnt = 0
    for j in range(1, int(sqrt(i)) + 1):
        if i % j == 0:
            cnt += 1
    
    if cnt == 1 and i != 1:
        return True
    else:
        return False

def calc_ans(cnt):
    ans = 0
    for v in cnt.values():
        i = 1
        cnt = 0
        while cnt + i <= v:
            cnt += i
            i += 1
        ans += i - 1
    return ans
if judge_prime(n):
    print(ans + 1)
    exit()
for i in range(2, n):
    if i > n:
        break
    if judge_prime(i):
        j = 1
        while n % (i ** j) == 0:
            n //= (i ** j)
            j += 1
            ans += 1
            if i ** j > n:
                break
print(ans)

Submission status: Runtime Error

Solution code:
import math
import sympy


def using_sqrt(limit):
    n = []
    for k in range(2, limit + 1):
        factor = 0

        # 2以外の偶数は素数ではないので無視する
        if k % 2 == 0 and k != 2:
            continue

        # 繰り返しの上限を対象の平方根にする
        for divisor in range(2, math.floor(math.sqrt(k)) + 1):
            if k % divisor == 0:
                factor += 1

        if factor == 0:
            n.append(k)

    return n


def isPrime(limit):
    n = []
    for k in range(limit, limit + 1):
        factor = 0

        # 2以外の偶数は素数ではないので無視する
        if k % 2 == 0 and k != 2:
            continue

        # 繰り返しの上限を対象の平方根にする
        for divisor in range(2, math.floor(math.sqrt(k)) + 1):
            if k % divisor == 0:
                factor += 1

        if factor == 0:
            return True
    return False


n = int(input())
prime = using_sqrt(10**5)
prev = []

if isPrime(n):
    print(1)
    exit()


def check(n, prev):
    divs = sympy.divisors(int(n))
    flag = False
    for i in divs[1:]:
        for p in prime:
            e = math.log(i, p)
            if e.is_integer() and i not in prev:
                prev.append(i)
                flag = True
                check(n/i, prev)
                break
        if flag:
            break


check(n, prev)
print(len(prev))

Submission status: Runtime Error

Solution code:
N = int(input())

ans = 0
for i in range(2, int(N**0.5)+1):
    cnt = 0
    while N%i == 0:
        N /= i
        cnt += 1
 
    a = 0
    b = 0
    for j in range(1, cnt+1):
        a += j
        if a > cnt:
            break
        b += 1
        
    ans += b

print(0  N == 1 else 1 if ans==0 else ans)

Submission status: Runtime Error

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

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

    for p in sympy.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:
N = 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

def ikutu(n):
    k = 0
    count = 0
    for i in range(1,n):
        k += i
        if k > n:
            return count
        else:
            count += 1
            
L = 0
for i in range(len(factorization(N))):
    L += ikutu(factorization(N)[i][1])
    
print(L)

Submission status: Runtime Error

Solution code:
n = int(input())
if n==1:
  print(0)
else:
    cnt = 0
  flg = 0
  for i in range(1000000):
    if n<i:
      break
    if i==0 or i==1 or n%i!=0:
      continue
    j = i
    while(n%j==0):
      if flg==0:
        flg = 1
      n /= j
      j *= i
      cnt += 1


  if flg==0:
    print(1)
  else:
    print(cnt)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
count = 0
li = [0 for i in range(int(math.sqrt(N))+1)]
for i in range(2, int(math.sqrt(N))+1):
    #print(li)
    if i > N:
        break
    if li[i] !=-1:

        if N % i == 0:
            count += 1
            num =i
            N = N // i
            while(1):
                li[num] = 1
                num *= i
                if num > len(li):
                    break
        num = i
        while(1):
            #print(num)
            if li[num] == 0:
                li[num] = -1
            num += num
            if num > len(li):
                break
#print(N)
if N != 1 and count == 0:
    flag = 1
    for i in range(2, int(math.sqrt(N)+1)):
        if N % i == 0:
            flag = 0
            break
    if flag == 1:
        count += 1
print(count)

Submission status: Runtime Error

Solution code:
import math
#試し割法
def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割っていく
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            if num not in factor:
                factor.append(num)
    #リストが空ならそれは素数
    if not factor:
        return 'prime number'
    else:
        factor.append(n)
        return factor
    
n=int(input())
if n==1:
  ans=0
elif trial_division(n)== 'prime number':
    ans=1
else
    z=2
    ans=0
    while z <= n:
        if trial_division(z)== 'prime number' and n%z ==0:
            n = n/z
            z += 1
            ans += 1
        elif len(trial_division(z))==2 and n%z ==0:
            n = n/z
            z += 1
            ans += 1
        
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())

repeat = [1]*9
for i in range(1,10):
    repeat[i-1] = i*(i+1)//2

d = 1
ans = 0
judge = False
while n != 1:
    if d > 10**6 +1 and ans = 0:
        ans = 1
        break
    d += 1
    count = 0
    if n%d == 0:
        judge = True
        j = -1
    while n%d == 0:
        n = n//d
        count += 1
    while judge:
        j += 1
        if count < repeat[j]:
            ans += j
            judge = False

print(ans)

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
dum = prime_factorize(int(input()))
print(dum)
print(len(dum))
dum1 = 0
ans = 0
for i in range(len(dum)):
    if dum[i] == dum[i+1]:
        cnt += 1
    else:
        dum1 = 0
        cnt = 0
    if cnt > dum1:
        ans += 1
        cnt = 0
        dum1 += 1
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
count = 0
for i in range(N, 2, -1):
    print(i)
    if N % i == 0:
        N = N // i
        count += 1
        if N == 0:
            print(count)
            exit()

Submission status: Runtime Error

Solution code:
N = int(input())
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])
n = 0
for i in range(len(arr)):
    a = 0
    b = arr[i-1]
    while a <= b[1]:
        a = a+a+1
        n = n+1
print(n)

Submission status: Runtime Error

Solution code:
import sys
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

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

def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

def main():
    n = int(stdin.readline().rstrip())
    l = factorization(n)
    z = []
    for i in range(len(l)):
        #[i][0]がpの候補
        if is_prime(l[i][0]):
            for j in range(l[i][1]):
                z.append(l[i][0] ** (j+1))
    z = list(set(z))
    z.sort()
    ans = 0
    for i in range(len(z)):
        if n % z[i] == 0:
            n = n / z[i]
            ans += 1
        if n < z[i+1]:
            print(ans)
            exit()
    print(ans)

main()

Submission status: Runtime Error

Solution code:
import sys
from collections import deque
import collections

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

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 = I()
result = prime_factorize(N)
c = collections.Counter(result)
for i,q in c.items():
    ans = i
print(ans)

Submission status: Runtime Error

Solution code:
import math
a, b = map(str, input().split())
a = int(a)
b = float(b)

b = int(b * 100)
ans = a * b // 100

ans = int(math.floor(ans))
print(ans)

Submission status: Runtime Error

Solution code:
import math
import sys

def primes(x):
    if x < 2: return []

    primes = [i for i in range(x)]
    primes[1] = 0 # 1は素数ではない

    # エラトステネスのふるい
    for prime in primes:
        if prime > math.sqrt(x): break
        if prime == 0: continue
        for non_prime in range(2 * prime, x, prime): primes[non_prime] = 0

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

"""
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
"""

def isPrime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

N = int(input())

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

PL = primes(1000000)
#print(PL)

i = 0
cnt = 0

while(not isPrime(N)):
    flg = 0
    while(1):
        if i >= 1000000:
            print(cnt)
            sys.exit(0)
        pl = PL[i]
        c = 1
        while(N % (pl**c) == 0):
            N = N // (pl**c)
            cnt += 1
            c += 1
            flg = 1
        i += 1
        if N == 1:
            print(cnt)
            sys.exit(0)
        if flg == 1:
            break

print(cnt+1)
#print(isPrime(1))
"""
if N == 1:
    print(cnt)
else:
    print(cnt + 1)
"""

Submission status: Runtime Error

Solution code:
import math
N = int(input())
# A, B = [i for i in input().split()]
def is_prime(n):
    if n == 1:
        return False
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
cands = []
for i in range(2, int(math.sqrt(N))+1):
    if N % i == 0:
        cands.append(i)
        cands.append(N%i)

if is_prime(N):
    print(1)
else:
    count = 0
    n = N
    for c in cands:
        if c > n:
            break
        if n % c == 0:
            n //= c
            count += 1
    print(count)

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
def count_1(Y, a):
  x2 = len([i for i, x in enumerate(Y) if x == a])
  i = 0
  count = 0
  while True:
    i += 1
    if x2 - i > 0:
      x2 = x2 - i
      count += 1
    else:
      break
  return count

X = int(input())
Y = prime_factorize(X)
c = collections.Counter(Y)
count = 0
for i in range(0, len(c.keys())):
  count += count_1(Y, c.keys[i])

print(count)

Submission status: Runtime Error

Solution code:
from sympy import divisors, factorint
n = int(input())
yakus = divisors(n)
ns = set()
zs = set()
ns.add(n)
for z in yakus:
    d = factorint(z)
    if len(d) == 1 and n%z == 0 and not int(n/z) in ns and int(n/z) != 1 and int(n/z) != 0 and not z in zs:
        zs.add(z)
        n = int(n/z)
        ns.add(n)
if 1 in ns:
    ns.remove(1)
if 0 in ns:
    ns.remove(0)
ns = [n for n in ns if not n in zs]
print(len(ns))

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))
    if len(sp)>1:
        t.pop(t.index(ssp))
    ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
x = int(input())
import math
from collections import defaultdict
res = 0
value = defaultdict(int)
def isprime(n):
if n <= 1:
return 0
m = int(math.sqrt(n)) + 1
for i in range(2, m):
if n % i == 0:
return 0
return 1
if isprime(x):
print(1)
else:
def bprime(n):
cnt = 2
m = int(math.sqrt(n)) + 1
while n != 1 and cnt < m:
while n % cnt == 0:
n //= cnt
value[cnt] += 1
cnt += 1
if cnt == m and n != 1:
value[n] += 1
def cal(n):
if n <= 2:
return 1
j = 1
cnt = 0
while n >= j:
n -= j
j += 1
cnt += 1
return cnt
bprime(x)
for key in value.keys():
res += cal(value[key])
print(res)

Submission status: Runtime Error

Solution code:
import sympy
n = int(input())
B = [1,2,6,10,15,21,28,36,45,55]
ans = 0
import math
def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

if is_prime(n) == True:
  print(ans)
  exit()


A = sympy.factorint(n)
for v in A.values():
  for i in range(len(B)):
    if v <= B[i]:
      cnt = 1
    else:
      cnt = 0
    if cnt == 0:
      ans += i+1
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
cnt = 0

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
from collections import Counter

arr = prime_factorize(N)
c = Counter(arr)
cnt += len(c)
c = c.most_common()
for i in range(len(c)):
    cnt +=  c[i][1]-1//2

print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
from collections import Counter
#a,b = map(int,input().split())
#L = list(map(int,input().split()))
def pr(n):
    L = []
    for i in range(2,int(n**0.5)+1):
        while n % i==0:
            L.append(i)
            n = n//i
    if n != 1:
        L.append(n)
    return L
dic = {1:1,2:1,3:2,4:2,5:2,6:3,7:3,8:3,9:3,10:4,11:4,12:4,13:4,14:4,15:5,16:5,17:5,18:5,19:5,20:5}
L = pr(n)
#print(L)
L = Counter(L)
num = 0
for k,v in L.items():
    num +=dic[v]
print(num)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
count = 0
li = [0 for i in range(int(math.sqrt(N))+1)]
for i in range(2, int(math.sqrt(N))+1):
    #print(li)
    if i > N:
        break
    if li[i] !=-1:

        if N % i == 0:
            count += 1
            num =i
            N = N // i
            while(1):
                li[num] = 1
                num *= i
                if num > len(li):
                    break
        num = i
        while(1):
            #print(num)
            if li[num] == 0:
                li[num] = -1
            num += num
            if num > len(li):
                break
#print(N)
if N != 1 and count == 0:
    flag = 1
    for i in range(2, int(math.sqrt(N)+1)):
        if N % i == 0:
            flag = 0
            break
    if flag == 1:
        count += 1
print(count)

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())
l = prime_factorize(N)
m = set(l)
l2 = list(m)
ans = 0
for i in range(len(l2)):
    x = l.count(l2[i]))
    while x >= 2:
        x  = x/2
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
import itertools
import copy
n=int(input())
c=0
A=[]
for i in range(2,int(n**0.5+1)):
  if n%i==0:
    a=0
    while(n%i==0):
      n//=i
      a+=1
    A.append(a)
l=len(A)
i=1
while(sum(A)>=l and l>0):
  for j in itertools.combinations_with_replacement(range(l), i):
    for k in j:
      C=deepcopy(A)
      if A[k]==0:
        A[k]=C[k]
        break
      else:
        A[k]-=1
    else:
      c+=1
  B=[]
  for a in A:
    if a!=0:
      B.append(a)
  A=B
  l=len(A)
  i+=1
print(1 if c!=1 and c==0 else c)

Submission status: Runtime Error

Solution code:
from sympy import sieve, divisors

def getPrimary(n):
    res=[]
    my_append = res.append
    A=divisors(n)
    for a in A:
        if not(a in sieve):
            continue
        w=1
        while True:
            if n%(a**w)==0:
                my_append(a**w)
            else:
                break
            w+=1
    return res

def main():
    N=int(input())
    A=getPrimary(N)
    A.sort()
    cnt=0
    for z in A:
        if N%z==0:
            cnt+=1
            N/=z
    print(cnt)

if __name__=='__main__':
    main()

Submission status: Runtime Error

Solution code:
a,b=list(map(float,input().split()))
c=a*(b*100)
d=int(c//100)
print(d)