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:
from collections import defaultdict
N = int(input())
d = defaultdict(int)
tmp = N
for i in range(2, int(math.sqrt(N))+1):
    while tmp % i == 0:
        d[i] += 1
        tmp /= i

if tmp > 1:
    d[tmp] += 1
ans = 0
for key, value in d.items():
    i = value
    j = 1
    while value >= j:
       ans += 1
       value -= j
       j += 1
print(ans)

Submission status: Runtime Error

Solution code:
n = int(raw_input())
 
def f(c):

	cumul = 0
	step = 1
	cc = 0
	while(cumul < c):
		cc +=1
		cumul += step
		step += 1
	if cumul > c: count -=1
	return cc
	
d = 2
count = 0

while(n != 1 and d*d <= n):
	if n%d==0:
		c = 0
		while(n%d == 0): 
			c += 1
			n /= d
		count += f(c)
	d+=1
print count

Submission status: Runtime Error

Solution code:
import sympy
from copy import deepcopy

dic = sympy.factorint(int(input()))

ans = 0
prev_ans = 0
ans_dict = {}
while True:
    prev_ans = ans
    next_dic = deepcopy(dic)

    for k, v in dic.items():
        ans_dict[k] = ans_dict.get(k, set())
        for i in range(v):
            if i not in ans_dict[k]:
                ans_dict[k].add(i)
                ans += 1
                next_dic[k] = v - 1
                break

    if prev_ans == ans:
        break

    dic = next_dic

print(ans)

Submission status: Runtime Error

Solution code:

import sympy

def func(n, history):
    l = sympy.divisors(n)
    #print(l, n)
    for i in l[1:]:
        if n == i:
            history.append(i)
            return history
        if i in history:
            continue
        history.append(i)
        func(n//i, history)
        break
    return history

N = int(input())
if N == 0:
    print(0)
else:
    h = func(N, [])
    print(len(set(h)))

Submission status: Runtime Error

Solution code:
import sympy
import math
n = int(input())
s = 0
l  = sympy.factorint(n)
l2 = list(dict.values(l))
for i in range(len(l2)):
    s += int((math.sqrt(1 + 9 * l2[i])-1)/2)

print(s)

Submission status: Runtime Error

Solution code:
s = (input())
a,b = s.split(' ')
a = (int)(a)
x,y = b.split('.')
x = (int)(x)
y = (int)(y)
a1 = a*x
a2 = a*y
a2  = (int)(a2/100)
print(str(a1+a2))

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit(10 ** 9)

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

def f(n):
    arr = list()
    temp = n
    for i in range(2, int(-((-1 * (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 len(arr) == 0:
        arr.append([n, 1])

    return arr


tmp = f(N)
res = 0
A = [0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6]
for b, a in tmp:
    res += A[a]
print(int(res))

Submission status: Runtime Error

Solution code:
import sys
import numpy as np


def input():
    return sys.stdin.readline()[:-1]

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 func1(lst, value):
    return [i for i, x in enumerate(lst) if x <= value]


ans_ = np.array(factorization(N))
nums = []
index_list = []

ans = 0
for i in range(1, 100):
	ans += i
	index_list.append(ans)

for a in ans_:
	#nums.append(int(format(a[1], 'b')))
	nums.append(a[1])
	
ans = 0
for i in nums:
	index = func1(index_list, i)
	#print(max(index)+1)
	ans += max(index)+1
	
print(ans)

Submission status: Runtime Error

Solution code:
input_ = input().split()
a = int(input_[0])
b = input_[1].split('.')
b = b[0] + b[1][:2]

print((a * int(b))//100)

Submission status: Runtime Error

Solution code:
N=int(input())
p=[i for i in range(2,N+1)]
count=0
for item in p:
  if N%item==0:
    
  	N=N/item
  	count+=1
  	p.remove(item)
  	if N==1:
    	break
print(count)

Submission status: Runtime Error

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
   
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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
    
a=factorization(n)
le=len(a)
cnt=0
b=0
for i in range(le):
	b=1
	while a[i][1]>=b: 
		a[i][1]-=b
		b+=1
		cnt+=1

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

Submission status: Runtime Error

Solution code:
import math
from collections import defaultdict
N = int(input())
d = defaultdict(int)
def sieve_of_erastosthenes(num):
    input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)]
    input_list[0] = input_list[1] = False
    input_list[2] = input_list[3] = input_list[5] = True
    sqrt = math.sqrt(num)

    for serial in range(3, num, 2):

        if serial >= sqrt:
            return input_list

        for s in range(serial ** 2, num, serial):
            input_list[s] = False
l = sieve_of_erastosthenes(N)
cnt = 0
while N != 1 and cnt<len(l):

    while l[cnt] and N%cnt == 0:
        d[cnt] += 1
        N //=cnt
    cnt += 1
ans = 0
for i in d.values():
    tmp = 1
    while i - tmp >= 0:
        i -= tmp
        tmp += 1
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
N=int(input())
count=0
pn=[2]
for L in range(3,N):
    chk=True
    for L2 in pn:
        if L%L2==0:chk=False
    if chk==True:pn.append(L)
ph=[1]*len(pn)
i=0
while N!=1:
    if N%(pn[i]**ph[i])==0:
        count+=1
        N//=(pn[i]**ph[i])
        ph[i]+=1
    else:i+=1
print(count)

Submission status: Runtime Error

Solution code:
import math
from collections import defaultdict
N = int(input())
d = defaultdict(int)
def sieve_of_erastosthenes(num):
    input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)]
    input_list[0] = input_list[1] = False
    input_list[2] = input_list[3] = input_list[5] = True
    sqrt = math.sqrt(num)

    for serial in range(3, num, 2):

        if serial >= sqrt:
            return input_list

        for s in range(serial ** 2, num, serial):
            input_list[s] = False
l = sieve_of_erastosthenes(int(pow(N,0.5))+2)
cnt = 0
while N != 1 and cnt<len(l):

    while l[cnt] and N%cnt == 0:
        d[cnt] += 1
        N //=cnt
    cnt += 1
ans = 0
for i in d.values():
    tmp = 1
    while i - tmp >= 0:
        i -= tmp
        tmp += 1
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
import sympy

def func(n, history):
    l = sympy.divisors(n)
    for i in l[1:]:
        if n == i:
            history.append(i)
            return history
        if i in history:
            continue
        history.append(i)
        func(n//i, history)
        break
    return history

N = int(input())
print(len(func(N, [])))

Submission status: Runtime Error

Solution code:
from sympy import prime
from sympy import sieve
def main(n):
    p=[i for i in sieve.primerange(2,10**3)]
    p.append(1000000007)
    e=[]
    for i1 in range(1,100):
        e.append(i1)
    k=0
    t=0
    for e1 in e:
        for p1 in p:
            z=p1**e1
            if k != z:
                if n%z == 0:
                    k = z
                    n = n/z
                    t+=1
    return t
n=int(input())
main(n)

Submission status: Runtime Error

Solution code:
import collections
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())
if n == 1:
    print(0)
else:
    ans = 0
    c = factorization(n)
    for arr in c:
        m = arr[1]
        i = 1
        for _ in range(m):
            if i > m:
                break
            ans += 1
            m -= i
            i += 1
print(ans)

Submission status: Runtime Error

Solution code:
import math

is_prime = [True for i in range(10 ** 6 + 1)]
primes = []
def SieveOfEratosthenes(n):
    p = 2
    while (p * p <= n):
        # If prime[p] is not
        # changed, then it is a prime
        if (is_prime[p] == True):
            # Update all multiples of p
            for i in range(p * p, n + 1, p):
                is_prime[i] = False
        p += 1
    for i in range(2, n + 1):
        if is_prime[i]:
            primes.append(i)
def power_of_prime(n):
    for i in primes:
        if n % i == 0:
            c = 0
            while n % i == 0:
                n//= i
                c += 1
            if n == 1:
                return 1
            else:
                return 0


n=int(input())
k=0

SieveOfEratosthenes(int((math.sqrt(n)))+1)

for i in range(2,int(math.sqrt(n))+1):
    if n>1 and n%i==0 and power_of_prime(i)==1:
        k+=1
        n=n//i
print(k)

Submission status: Runtime Error

Solution code:
import sympy
N=int(input())
zlist = sympy.divisors(N)
done=[]
cnt=0
for n in range(len(zlist)):
    if(len(zlist)>1):
        for z in zlist:
            if(z not in done):
                if(N%z==0 and z!=1):
                    print('z:',z)
                    done.append(z)
                    N=int(N/z)
                    zlist = sympy.divisors(N)
                    cnt+=1
                    done.append(z)
                    break
    else:
        break
print(cnt)

Submission status: Runtime Error

Solution code:
import math
A,B = map(float,input().split())
print(math.floor(A*B+0.005))

Submission status: Runtime Error

Solution code:
n= int(input())

import sympy

#primes= list(sympy.primerange(1, 10**6))
primes= [2,3,99983]


prime_factors= {}

while n != 1:
	for p in primes:
		if n%p==0:
			if p in prime_factors:
				prime_factors[p]+=1
			else:
				prime_factors[p]=1
			n/= p
			break
		elif p==999983:
			prime_factors[n]=1
			n=1
			break
tot= 0
for p in prime_factors:
	if prime_factors[p]>=36:
		tot+= 8
	elif prime_factors[p]>=28:
		tot+=7
	elif prime_factors[p]>=21:
		tot+=6
	elif prime_factors[p]>=15:
		tot+=5
	elif prime_factors[p]>=10:
		tot+=4
	elif prime_factors[p]>=6:
		tot+=3
	elif prime_factors[p]>=3:
		tot+=2
	else:
		tot+=1


print(tot)

Submission status: Runtime Error

Solution code:
import math

A = int(input())
B = int(input())
print(math.floor(A * B))

Submission status: Runtime Error

Solution code:
import sympy
n=int(input())
k=sympy.divisors(n)
c=0
for i in range(len(k)):
    if i==0:pass
    else:
        if n%k[i]==0:
            n//=k[i]
            c+=1
print(c)

Submission status: Runtime Error

Solution code:
N = int(input())
if N == 1:
    print(0)
    exit()

def f(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 len(arr) == 0:
        arr.append([n, 1])

    return arr


tmp = f(N)
res = 0
A = [0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5]
for b, a in tmp:
    res += A[a]

print(int(res))

Submission status: Runtime Error

Solution code:
n= int(input())

import sympy

primes= list(sympy.primerange(1, 10**6))



prime_factors= {}

while n != 1:
	for p in primes:
		if n%p==0:
			if p in prime_factors:
				prime_factors[p]+=1
			else:
				prime_factors[p]=1
			n/= p
			break
		elif p==999983:
			prime_factors[n]=1
			n=1
			break
tot= 0
for p in prime_factors:
	if prime_factors[p]>=36:
		tot+= 8
	elif prime_factors[p]>=28:
		tot+=7
	elif prime_factors[p]>=21:
		tot+=6
	elif prime_factors[p]>=15:
		tot+=5
	elif prime_factors[p]>=10:
		tot+=4
	elif prime_factors[p]>=6:
		tot+=3
	elif prime_factors[p]>=3:
		tot+=2
	else:
		tot+=1


print(tot)

Submission status: Runtime Error

Solution code:
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <unordered_map>
#include <vector>


#define INF 4000000000000000000LL
#define MOD 1000000007
#define ALL(x) std::begin(x), std::end(x)


std::map<long long, int> prime_factors(long long n) {
  std::map<long long, int> map;

  for (long long i = 2; i * i <= n; i ++)
    for ( ; n % i == 0; n /= i)
      map[i] ++;

  if (n != 1)
    map[n] = 1;

  return std::move(map);
}


std::map<std::pair<int, int>, int> memo;


int dfs(int i, int j)
{
  if (i == 0)
    return 0;

  std::pair<int, int> key(i, j);

  if (memo.count(key))
    return memo[key];
    
  int xp = -1;
  
  for (int k = j; k <= i; k ++)
    xp = std::max(dfs(i - k, k + 1) + 1, xp);

  return memo[key] = xp;
}


int main(int argc, char** argv)
{
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);

  std::cout << std::fixed << std::setprecision(6);
  std::cerr << std::fixed << std::setprecision(6);

  long long N;

  std::cin >> N;

  auto primes = prime_factors(N);

  int C = 0;

  std::map<int, int> map;

  for (const auto& kv : primes) {
    if (map.count(kv.second) == 0)
      map[kv.second] = dfs(kv.second, 1);

    C += map[kv.second];
  }

  std::cout << C << std::endl;
  
  return 0;
}

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
  

c = collections.Counter(prime_factorize(N))

A = c.keys()
count = c.values()

ans = 0

for i in count:
  k = 0
  for j in range(1,i):
    k += j
    if k <= i:
      ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
if n == 1:
    print(0)
else:
    answer = 0
    for factor in factorization(n):
        x = factor[1]
        kouho = int((2*x)**0.5)-1
        if (kouho)*(kouho+1)/2 <=x and x < (kouho+1)*(kouho+2)/2:
            kaisu = kouho
        else:
            kaisu = kouho+1
        answer += kaisu

    print(answer)

Submission status: Runtime Error

Solution code:
n= int(input())

import sympy

primes= list(sympy.primerange(1, 10**6))



prime_factors= {}

while n != 1:
	for p in primes:
		if n%p==0:
			if p in prime_factors:
				prime_factors[p]+=1
			else:
				prime_factors[p]=1
			n/= p
			break
		elif p==999983:
			prime_factors[n]=1
			n=1
			break
tot= 0
for p in prime_factors:
	if prime_factors[p]>=36:
		tot+= 8
	elif prime_factors[p]>=28:
		tot+=7
	elif prime_factors[p]>=21:
		tot+=6
	elif prime_factors[p]>=15:
		tot+=5
	elif prime_factors[p]>=10:
		tot+=4
	elif prime_factors[p]>=6:
		tot+=3
	elif prime_factors[p]>=3:
		tot+=2
	else:
		tot+=1


print(tot)

Submission status: Runtime Error

Solution code:
def fa(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())
if n==1:
  print(0)
  exit()
A=fa(n)
ans=0
for i in range(len(A)):
  x=int(2*A[i][1]**(0.5))
  if (x-2)*(x-1)<=2*A[i][1]<x*(x-1):
    a=x-2
  if (x-1)*x<=2*A[i][1]<x*(x+1):
    a=x-1
  if (x+1)*x<=2*A[i][1]<(x+2)*(x+1):
    a=x
  if (x+1)*(x+2)<=2*A[i][1]<(x+2)*(x+3):
    a=x+1
  if (x+3)*(x+2)<=2*A[i][1]<(x+4)*(x+3):
    a=x+2
  ans=ans+a
print(a)

Submission status: Runtime Error

Solution code:
import sys
n=int(input())
if n==1:
    print(0)
    sys.exit()
def f(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
tmp=f(n)
ans=0
for i in tmp:
    dd=i[1]
    tt=1
    while dd>0:
        if dd-tt>=0:
            dd-=tt
            tt+=1
            ans+=1
        else:
            break
print(ans)=0:
            dd-=tt
            tt+=1
            ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


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 main():
    N = int(input().strip())
    if N == 1:
        return 0
    factors = factorization(N)
    ans = 0
    for factor in factors:
        counter = 1
        while True:
            if factor[1] >= counter:
                selected.add(factor[0]**counter)
                factor[1] -= counter
                counter += 1
                ans += 1
            else:
                break
    return ans


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

Submission status: Runtime Error

Solution code:
import sympy

primes= list(sympy.primerange(1, 10**6))

n=int(input())

prime_factors= {}

while n != 1:
	for p in primes:
		if n%p==0:
			if p in prime_factors:
				prime_factors[p]+=1
			else:
				prime_factors[p]=1
			n/= p
			break
		elif p==999983:
			prime_factors[n]=1
			n=1
			break
tot= 0
for p in prime_factors:
	if prime_factors[p]>=36:
		tot+= 8
	elif prime_factors[p]>=28:
		tot+=7
	elif prime_factors[p]>=21:
		tot+=6
	elif prime_factors[p]>=15:
		tot+=5
	elif prime_factors[p]>=10:
		tot+=4
	elif prime_factors[p]>=6:
		tot+=3
	elif prime_factors[p]>=3:
		tot+=2
	else:
		tot+=1


print(tot)

Submission status: Runtime Error

Solution code:
n = int(input())
a = []
b = []
if True:
    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)
kosuu = 1
mae = a[0]
for i in range(1,len(a)):
    if mae == a[i]:
        kosuu += 1
    else:
        mae = a[i]
        b.append(kosuu)
        kosuu = 1
b.append(kosuu)
ans = 0
for i in range(len(b)):
    for j in range(2,100):
        if b[i] < j*(j+1)//2:
            ans += j-1
            break
print(ans)

Submission status: Runtime Error

Solution code:
from bisect import bisect_right
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def pf(x):
    ee=[]
    pp=[]
    if x&1==0:
        k=(x&-x).bit_length()-1
        pp.append(2)
        ee.append(k)
        x>>=k
    d=3
    while d**2<=x:
        while x%d==0:
            x//=d
            if pp and pp[-1]==d:ee[-1]+=1
            else:
                pp.append(d)
                ee.append(1)
        d+=2

    if x>1:
        if pp[-1] == x: ee[-1] += 1
        else:ee.append(1)

    return ee

def main():
    n=II()
    ss=[1]
    for a in range(2,45):ss.append(ss[-1]+a)
    #print(ss)
    ee=pf(n)
    #print(ee)
    ans=0
    for e in ee:
        i=bisect_right(ss,e)
        ans+=i
    print(ans)

main()

Submission status: Runtime Error

Solution code:
from sympy import *

primes= list(primerange(1, 10**6))

n=int(input())

prime_factors= {}

while n != 1:
	for p in primes:
		if n%p==0:
			if p in prime_factors:
				prime_factors[p]+=1
			else:
				prime_factors[p]=1
			n/= p
			break
		elif p==999983:
			prime_factors[n]=1
			n=1
			break
tot= 0
for p in prime_factors:
	if prime_factors[p]>=36:
		tot+= 8
	elif prime_factors[p]>=28:
		tot+=7
	elif prime_factors[p]>=21:
		tot+=6
	elif prime_factors[p]>=15:
		tot+=5
	elif prime_factors[p]>=10:
		tot+=4
	elif prime_factors[p]>=6:
		tot+=3
	elif prime_factors[p]>=3:
		tot+=2
	else:
		tot+=1


print(tot)

Submission status: Runtime Error

Solution code:
n = int(input())
m = n
t = 0
while n != 1:
  for i in range(m):
    if n % i == 0:
      n /= i
      t += 1
      
print(t)

Submission status: Runtime Error

Solution code:
n=int(input())

def prime_factorize(n):
    d=defaultdict(int) 
    while n % 2 == 0:
        d[2]+=1
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            d[f]+=1
            n //= f
        else:
            f += 2
    if n != 1:
        d[n]+=1
    return d

u=prime_factorize(n) 
cnt=0
for key,value in u.items():
    r=10**12
    l=0 
    while r-l>1:
        mid=(r+l)//2
        if mid*(mid+1)//2<=value:
            l=mid 
        else:
            r=mid
    cnt+=l
print(cnt)

Submission status: Runtime Error

Solution code:
import sympy

N = sympy.factorint(int(input()))

key = list(N.keys())
val = list(N.values())

sum = 0
for i in range(len(key)):
    count = 1
    length = val[i]
    if (length < 3):
        sum += 1
    else:
        while(length > 0):
            sum += 1
            length -= count
            count += 1

print(sum)

Submission status: Runtime Error

Solution code:
#include<stdio.h>
#include<math.h>
main()
{
    long long a;
    scanf("%lld",&a);
    long long sqrta = ceil(sqrt(a));
    printf("%lld\n",sqrta);
    long long c = 0;
    for(long long i=2;i<=sqrta;i++)
    {
        if(a%i==0)
        {
            a = a/i;
            c++;
            //printf("%lld %lld\n",i,a);
        }
        if(i>=a)
        {
            a = 1;
            break;
        }
    }
    if(a!=1)
    {
        c+=1;
    }
    printf("%lld",c);
}

Submission status: Runtime Error

Solution code:

aaa = [0,1,1,2,2,2,3,3,3,3,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,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())
l = factorization(N) 

ans = 0

for arr in l:
  if arr[0] != 1:
    a = arr[1]
    b = aaa[a]
    ans += b
  
print(ans)

Submission status: Runtime Error

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

prime_factorize(N, a)
ans = 0
if len(a) >= 1:
    before = a[0]
    kosuu = 1
    for i in range(1, len(a)):
        tmp = a[i]
        if tmp == before:
            kosuu += 1
        else:
            ini = 1
            while kosuu - ini >= 0:
                kosuu = kosuu - ini
                ini += 1
                ans += 1
            before = tmp
            kosuu = 1
        ini = 1
    while kosuu - ini >= 0:
        kosuu = kosuu - ini
        ini += 1
        ans += 1


print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

def factorize(x):
    factor = {}
    for num in range(2, int(x**0.5)+1):
        while x % num == 0:
            x = x // num
            try:
                factor[num] += 1
            except:
                factor[num] = 1
        if x != 1:
            factor[x] = 1
        return factor

prime_factor_list = factorize(N)
# print(prime_factor_list)
ans = 0

for key in prime_factor_list.keys():
    key_num = prime_factor_list[key] #{2:6}なら6
    nokori = key_num
    for i in range(1, key_num+1): #1~6まで
        if nokori < i:
            break#次の素数へ
        nokori -= i
        if N % key**i == 0:
            N //= key**i
            ans += 1
        else:
            break
print(ans)

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


tmp = factorization(N)
if tmp == [[1, 1]]:
    print(0)
    exit()
res = 0
A = [0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5]
for _, a in tmp:
    res += A[a]

print(res)

Submission status: Runtime Error

Solution code:
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:
    ans = 0
    c = collections.Counter(prime_factorize(n))
    for v in c.values():
        m = v
        i = 1
        for _ in range(1, m+1):
            if i > m:
                break
            ans += 1
            m -= i
            i += 1
print(ans)

Submission status: Runtime Error

Solution code:
def resolve():
    li = input().split()
    A = int(li[0])
    B = int(li[1].replace('.',''))
    ans = int(A*B/100)
    print(ans)
resolve()

Submission status: Runtime Error

Solution code:
def main():
    temp = [True] * (10 ** 12)
    temp[0] = False
    temp[1] = False
    for i in range(2, 10 ** 12):
        if temp[i]:
            cnt = 2 * i
            while cnt < 10 ** 12:
                temp[cnt] = False
                cnt += i
    prime = []
    for i in range(10 ** 12):
        if temp[i]:
            prime.append(i)

    n = int(input())
    ans = 0
    for i in prime:
        if i > n ** 0.5 + 1:
            break
        if n % i:
            continue
        div = 0
        tempN = n
        while True:
            cnt = 1
            while tempN % (i ** (2 * cnt)) == 0:
                cnt += 1
            if tempN % (i ** cnt):
                break
            div += cnt
            tempN = tempN // (i ** cnt)
        #print(div)
        if div > 2:
            div = int((div * 2) ** 0.5)
        else:
            div = 1
        #print(i, div, tempN)
        ans += div

    print(ans)
    return

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
from sys import stdin
from math import sqrt
input = stdin.readline

N = int(input())

ans = 0

seen = [0] * 10 ** 7

for i in range(2, int(sqrt(N)) + 1):
    tmp = i

    while N % tmp == 0:

        if seen[tmp] == 1:
            tmp *= i
            continue
        else:
            N //= tmp
            seen[tmp] = 1
            ans += 1
            tmp *= i

if N != 1 and (ans == 0 or seen[N] == 0):
    ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define INF (1LL<<50)
#define MOD 1000000007

std::vector<ll> Eratosthenes(ll N )
{
    std::vector<bool> is_prime( N + 1 );
    for( int i = 0; i <= N; i++ )
    {
        is_prime[ i ] = true;
    }
    std::vector<ll> P;
    for( int i = 2; i <= N; i++ )
    {
        if( is_prime[ i ] )
        {
            for( int j = 2 * i; j <= N; j += i )
            {
                is_prime[ j ] = false;
            }
            P.emplace_back( i );
        }
    }
    return P;
}

int main(){
    ll N;
    cin >> N;
    ll NN = 1000000;
    vector<ll> Pr = Eratosthenes(NN);
    ll ans=0;
    for(int i=0;i<Pr.size();i++){
        ll num=1;
        while(1){
            ll div = pow(Pr[i],num);
            if(N%div==0){
                N/=div;
                ans++;
            }else{
                while(N%Pr[i]==0){
                    N/=Pr[i];
                }
                break;
            }
            num++;
        }
    }
    if(N>1){
        ans++;
    }
    cout << ans << endl;
    return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from bisect import bisect_right
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def pf(x):
    ee=[]
    pp=[]
    if x&1==0:
        k=(x&-x).bit_length()-1
        pp.append(2)
        ee.append(k)
        x>>=k
    d=3
    while d**2<=x:
        while x%d==0:
            x//=d
            if pp[-1]==d:ee[-1]+=1
            else:
                pp.append(d)
                ee.append(1)
        d+=2

    if x>1:
        ee.append(1)
    return ee

def main():
    n=II()
    ss=[1]
    for a in range(2,45):ss.append(ss[-1]+a)
    #print(ss)
    ee=pf(n)
    #print(ee)
    ans=0
    for e in ee:
        i=bisect_right(ss,e)
        ans+=i
    print(ans)

main()

Submission status: Runtime Error

Solution code:
a,b=map(float,input().split())
ans=a*b
print(int(ans))