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: Wrong Answer

Solution code:
import math
n=int(input())
num=2
count=0
num2=int(math.sqrt(n))+1
while n!=1:
    if n%num==0:
        count+=1
        n=n//num
        num+=1
    else:
        num+=1
    if num2<num:
        if count==0:
            count=1
            break
        num2=int(math.sqrt(n))+1
        if num2<num and n>num:
            count+=1
            break
        else:
            break
print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
orgn=n
counter=0
for i in range(2,int(n**0.5)):
    if n % i == 0:
        counter += 1
        n //= i
        wari=i**2
        while n % wari == 0:
            counter +=1
            n //= wari
            wari *= i

if n == orgn:
    if n == 1:
        print(0)
    else:
        print(1)
else:
    print(counter)

Submission status: Wrong Answer

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


def main():
    n_ans = [0]*41
    n = int(input())
    facs = factorization(n)

    curr_n = 1
    for i in range(41):
        curr_sum = (curr_n+1)*(curr_n+2)//2
        if i < curr_sum:
            n_ans[i] = curr_n
        else:
            curr_n+=1
            n_ans[i] = curr_n
    # print(n_ans)
            
    ans = 0
    for fac in facs:
        cnt = fac[1]
        ans += n_ans[cnt]
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:

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

n = int(input())
divisors = make_divisors(n)
count = 0

for divisor in divisors:
    if divisor == 1:
        continue
    if n % divisor == 0:
        n = n / divisor
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
def eratosthenes(N):
    # 素数判定
    flag = True
    for i in range(2, int(N**0.5) + 1):
        if N % i == 0:
            flag = False
            break
    return flag

def make_prime_nums(N):
    # Nまでの素数のリストを作成
    prime_tf = [True for _ in range(N+1)]
    prime_tf[0] = False
    prime_tf[1] = False
    for i in range(2, N+1):
        if prime_tf[i]:
            if eratosthenes(i):
                for j in range(i*2, N+1, i):
                    prime_tf[j] = False
    primes = [i for i in range(N+1) if prime_tf[i]]
    return primes
N = int(input())
# N = 10**12
divs = make_prime_nums(10**5)
for i in range(len(divs)):
    v = divs[i]
    while N > v:
        v *= divs[i]
        divs.append(v)
divs.sort()
ans = 0
for i in range(len(divs)):
    if N == 1:
        break
    v = divs[i]
    if eratosthenes(N) and N > v:
        ans += 1
        N = 1
        break
    if N % v == 0:
        # print(N, v)
        N //= v
        ans += 1
print(ans)

Submission status: Wrong Answer

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
c =  collections.Counter(prime_factorize(n))
a = c.values()
# print(a)
count =0
for i in a:
    k=1
    for j in range(int(n/2)):
        i-=k
        k +=j+1
        # print(i,j)
        count +=1
        if (i<=j+1):
            break
    
print(count)

Submission status: Wrong Answer

Solution code:
from math import sqrt
def factorint(n):
    d = {}
    for i in range(2, int(sqrt(n))+1):
        c = 0
        q, r = divmod(n, i)
        while not r:
            c += 1
            n = q
            q, r = divmod(n, i)
        if c:
            d[i] = c
    if n != 1:
        d[n] = 1
    return d

n = int(input())
if n == 1:
    print(0)
else:
    d = factorint(n)
    s = 0
    for v in d.values():
        s += int(sqrt(8*v-1)/2)
    print(s)

Submission status: Wrong Answer

Solution code:
N=int(input())
import math
#import sympy
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
# 素数判定関数
def isPrime(num):
    # 2未満の数字は素数ではない
    if num < 2: return False
    # 2は素数
    elif num == 2: return True
    # 偶数は素数ではない
    elif num % 2 == 0: return False

    # 3 ~ numまでループし、途中で割り切れる数があるか検索
    # 途中で割り切れる場合は素数ではない
    for i in range(3, math.floor(math.sqrt(num))+1, 2):
        if num % i == 0:
            return False

    # 素数
    return True

# 素数判定
def callIsPrime(input_num=1000):
    numbers = []
    # ループしながら素数を検索する
    for i in range(1, input_num):
        if isPrime(i):
            numbers.append(i)

    # 素数配列を返す
    return numbers

# 関数の呼び出し
P=callIsPrime(int(math.sqrt(N)))
ans=0
for i in P:
  count=1
  while(N%i**count==0):
    ans+=1
    N=N//(i**count)
    #print(i**count)
    count+=1
ans+=isPrime(N)
#print(make_divisors(N))
#print(N)
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=chk=0
for i in range(2,10**12+1):
    if n%i==0 and n//i!=0:
        ans+=1
        n//=i
    if n<i:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
#n = 2*10**8
n = 17001002
prime = [] # i番目の素数
is_prime = [True] * (n+1)
p = 0 # 何番目か　0-indexed
is_prime[0] = False
is_prime[1] = False
ll = 0
#print('a')
for i in range(2,n+1):
    #ll += 1
    #print(i)
    if is_prime[i] == True:
        prime.append(i) # p番目の素数はiとなる
        p += 1
        # print(ll)
        # if p == 1000*ll:
        #     print(p)
        for j in range(2*i, n+1,i):
            is_prime[j] = False # その素数の倍数のやつ

#print(sieve(n,11000000))
#print(prime)
import math
def is_prime(n):
    for i in range(2,int(math.sqrt(n)+1)):
        if n % i == 0:
            return False
    return n != 1 # 1の場合は除外

n = int(input())
if is_prime(n):
    print(1)
    exit()
cnt = 0
for v in prime:
    nya = v
    while n % v == 0:
        cnt += 1
        n //= v
        v *= nya
print(cnt)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
org_n = n

array = [True] * (math.ceil(math.sqrt(n))+10)
                  
for i in range(2,len(array)):
  if not array[i]:
    continue
    
  for j in range(i*2,len(array), i):
    array[j] = False
    
sosu = []

for i in range(2,len(array)):
  if array[i]:
    sosu.append(i)
    
count = 0
for i in range(len(sosu)):
  j = 1
  while (n % (sosu[i]**j) == 0):
    n //= (sosu[i]**j)
    count += 1
    j += 1

if org_n == 1:
  count = 0
elif org_n == n:
  count += 1

    
print(count)

Submission status: Wrong Answer

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


def solve(N):
    fact = factorization(N)
    ans = 0

    if N == 1:
        print(-1)
        return

    for f in fact:
        s, c = f
        i = 1
        while True:
            if c >= i:
                c -= i
                ans += 1
            else:
                break
            i += 1
    print(ans)


if __name__ == '__main__':
    N = int(input())
    solve(N)

Submission status: Wrong Answer

Solution code:
import sys
import math
def input(): return sys.stdin.readline().rstrip()

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

    ans = 0
    MAX_N = math.ceil(math.sqrt(N)) + 1

    div = []
    for i in range(2, MAX_N):
        if N % i == 0:
            ans += 1
            N //= i
            div.append(i)
            if N == 1:
                break
    for i in div:
        if N % i == 0:
            N //= i
    if N > 1:
        ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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()
    del divisors[0]
    number=N
    answer=0
    for a in divisors:
        if number % a==0:
            number/=a
            answer+=1
    return answer
print(make_divisors(N))

Submission status: Wrong Answer

Solution code:
from collections import Counter
from math import sqrt

n = 2 ** 6 * 3 ** 5 * 5 ** 3 * 7 * 2

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

count = 0
for i in Counter(prime_factorize(n)).values():
    sub_count = int(sqrt(i)) + 1
    while sub_count * (sub_count + 1) > 2 * i:
        sub_count -= 1
    count += sub_count
print(count)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
divs = []
for i in range(1, int(math.sqrt(n)) + 1):
    if n % i == 0:
        j = n // i
        if i != j:
            divs.append(j)
        divs.append(i)
divs.sort()

ans = 0
for item in divs[1:]:
    if n % item != 0:
        continue
    n //= item
    ans += 1
print(ans)

Submission status: Wrong Answer

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


num=factorization(n)
if(n==1):
    print(0)
    exit()
#print(num)

co=0
for i in num:
    a=(2*i[1])**0.5
    if(a==2):
        a=1
    else:
        a=int(a)
    co+=a

    
print(co)

Submission status: Wrong Answer

Solution code:
n = int(input())
num = int(n ** 0.5 // 1)
check = []
for i in range(2, num + 1):
    if n % i == 0:
        cnt = 0
        while True:
            if n % i != 0:break
            n = n // i
            cnt += 1
        check.append([i, cnt])
ans = 0

for num, cnt in check:

    temp = 1
    while True:
        #print(ans, temp, cnt)
        if cnt >= temp:
            ans += 1
            cnt -= temp
            temp += 1
        else:break
print(ans if len(check) != 0 else 1)

Submission status: Wrong Answer

Solution code:
ans = 0
N = int(input())
L = [0] * 10**6
ans = 0
for i in range(2,10**6):
    while N%i == 0:
        N = N//i
        L[i] += 1
for i in range (10**6):
    k = 1
    while L[i] > 0:
        L[i] -= k
        if L[i] >= 0:
            k += 1
            ans += 1
print(ans)

Submission status: Wrong Answer

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


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


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


def main():
    N = readint()
    if N == 1:
        print(0)
        exit()
    p = make_divisors(N)
    ans = 0
    for z in p:
        if z == 1:
            continue
        if not N % z:
            N //= z
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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
c =  collections.Counter(prime_factorize(n))
a = c.values()
# print(a)
count =0
for i in a:
    k=1
    for j in range(int(n/2)):
        i-=k
        k +=j+1
        # print(i,j)
        count +=1
        if (i<=1):
            break
    
print(count)

Submission status: Wrong Answer

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

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

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

    return arr

n = int(input())

a = factorization(n)
#print(a)

ans = 0
for i in range(len(a)):
    check = 1
    while a[i][1] >= check:
        a[i][1] = a[i][1] - check
        ans = ans + 1
        check = check + 1

print(ans)

Submission status: Wrong Answer

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

a = collections.Counter(prime_factorize(n))

res = 0

for i in a.items():
    if i[1] > 3:
        res += int(i[1]/2)
    elif i[1] == 3:
        res += 2
    else:
        res += 1

print(res)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import math
from collections import defaultdict


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

    divs = get_divs(n)
    ans = 0
    for p in divs:
        ans += s_to_n(divs[p])
    print(ans)


def get_divs(n: int) -> dict:
    divs = defaultdict(int)
    for i in range(2, int(math.sqrt(n)) + 1):
        while n % i == 0:
            divs[i] += 1
            n /= i
    if len(divs) == 0 and n > 1:  # 素数だったら、自身のみを足す
        divs[n] = 1
    return divs


def s_to_n(s: int):
    ss = 0
    n = 1
    while ss < s:
        n += 1
        ss += n
    return n - 1


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

def is_prime(x):
    if x == 2: return True
    if x == 1 or not x % 2: return False
    for i in range(3, int(x**0.5)+1, 2):
        if not x % i: return False
    else: return True
if is_prime(n): print(1); exit()

x = n
ans = 0
for i in range(2, 10**6*2):
    if x % i == 0:
        x //= i
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
X=[0]*(10**6+1)
for i in range(2,int(math.sqrt(n)+1)):
    cnt=0
    while n%i==0:
        n//=i
        cnt+=1
    X[i]=cnt
ans=0
for x in X:
    if x>=21:
        ans+=6
    elif x>=15:
        ans+=5
    elif x>=10:
        ans+=4
    elif x>=6:
        ans+=3
    elif x>=3:
        ans+=2
    elif x>=1:
        ans+=1

if all([x==0 for x in X]):
    ans=1

print(ans)

Submission status: Wrong Answer

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

l = prime_factorize(n)

import collections
count = collections.Counter(l)

total = 0
for dup in count.items():
    total += 1
    appear = dup[1]
    if appear > 1:
        ite = 1
        while ite < appear:
            ite = ite + ite + 1
            if ite > appear:
                continue
            total += 1

print(total)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
from math import sqrt


def solve(*args: str) -> str:
    n = int(args[0])

    ret = 0
    i = 2
    while i <= sqrt(n):
        if n % i == 0:
            n = n//i
            ret += 1
        i += 1
    if i <= n:
        ret += 1

    return str(ret)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
c = 0
Y = int(math.sqrt(X))

for n in range(1, Y):
	if X % (n+1) == 0:
		c += 1
		X /= (n+1)
		
print(c)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000000)
import math
from math import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations, chain
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    # 10**6
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     # 10**6
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp

#

class UnionFindEx:
    def __init__(self, size):
        #正なら根の番号、負ならグループサイズ
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   #負なら根
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    #サイズ更新
        self.roots[r2] = r1
        return True

Yes = 'Yes'
No = 'No'


def main():
    N=ii()
    ans = 0
    for i in range(2, int(N**0.5)+3):
        c = i
        while N%c == 0:
            N //= c
            c *= i
            ans += 1
    print(ans)









main()

Submission status: Wrong Answer

Solution code:
n=int(input())
_n=n
if n==1:
    print(0)
    exit()
ans=0
for i in range(2,10**6+9):
    c=i
    while(n%c==0):
        n//=c
        ans+=1
        c*=i
if n==_n:
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
m = n

exp = []
div = []
for i in range(2, int(n**(1/2))+2):
    cnt = 0
    while n%i == 0:
        cnt += 1
        n //= i
    if cnt >= 1:
        exp.append(cnt)
        div.append(i)

for i in div:
    cnt = 0
    while n%i == 0:
        cnt += 1
        n //= i
    if cnt >= 1:
        exp.append(cnt)

if n == m:
    exp.append(1)

opr = 0
for x in exp:
    for i in range(x+1):
        if i*(i+1)//2 <= x < (i+1)*(i+2)//2:
            opr += i
            break

print(opr)

Submission status: Wrong Answer

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
#n = 2*10**8
n = 15001002
prime = [] # i番目の素数
is_prime = [True] * (n+1)
p = 0 # 何番目か　0-indexed
is_prime[0] = False
is_prime[1] = False
ll = 0
#print('a')
for i in range(2,n+1):
    #ll += 1
    #print(i)
    if is_prime[i] == True:
        prime.append(i) # p番目の素数はiとなる
        p += 1
        # print(ll)
        # if p == 1000*ll:
        #     print(p)
        for j in range(2*i, n+1,i):
            is_prime[j] = False # その素数の倍数のやつ

#print(sieve(n,11000000))
#print(prime)
import math
def is_prime(n):
    for i in range(2,int(math.sqrt(n)+1)):
        if n % i == 0:
            return False
    return n != 1 # 1の場合は除外

n = int(input())
if is_prime(n):
    print(1)
    exit()
cnt = 0
for v in prime:
    nya = v
    while n % v == 0:
        cnt += 1
        n //= v
        v *= nya
print(cnt)

Submission status: Wrong Answer

Solution code:
def get_primes_til(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n ** .5) + 1):
        if is_prime[i]:
            for j in range(2 * i, n + 1, i):
                is_prime[j] = False
    return {i for i in range(2, n + 1) if is_prime[i]}


def factor(n):
    res = []
    for i in range(2, int(n ** .5) + 1):
        while n % i == 0:
            res.append(i)
            n //= i
    if n > 1:
        return res + [n]
    else:
        return res


primes = get_primes_til(10 ** 6)
z_candids = []
for p in primes:
    z = p
    z_candids.append(z)
    while z <= 10 ** 6:
        z *= p
        z_candids.append(z)
z_candids.sort()

N = int(input())
if len(factor(N)) == 1:
    print(1)
    exit()
cnt = 0
for z_candid in z_candids:
    if N % z_candid:
        continue
    N //= z_candid
    cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
top = int(math.sqrt(n))+1
count = 0

for i in range(2,top+1):
  if n%i ==0:
    n = n//i
    count += 1
  if n < i:
    break
    
if n > top:
  count += 1

print(count)

Submission status: Wrong Answer

Solution code:
from scipy.special import comb
def prime_factorize_dict(n):
    d = dict()
    while not n & 1:
        d[2] = d.get(2, 0) + 1
        n >>= 1
    f = 3
    while f * f <= n:
        if not n % f:
            d[f] = d.get(f, 0) + 1
            n //= f
        else:
            f += 2
    if n != 1:
        d[n] = d.get(n, 0) + 1
    return d

N = int(input())
l = list(prime_factorize_dict(N).values())
n = len(l)
total = sum(l)
ans = 0
i = 1
while True:
    m = min(total // i, comb(n + i - 1, i, exact=True))
    ans += m
    total -= m * i
    if not m:
        break
    i += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math




def solve(n):
    ans = 0
    for i in range(2, int(math.sqrt(n) + 2)):
        if n % i == 0:
            times = 0
            needed = 1
            while n % i ==0:
                times += 1
                if times>= needed:
                    times = 0
                    needed += 1
                    ans += 1
                n //= i
    if not ans==0:
        print(ans)
    else:
        print(1)
    return



n = int(input())
solve(n)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# map(int, input().split())
import math

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


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

factors = factorization(N)
print(factors)

result = 0
for fact in factors:
    result += int((-1+math.sqrt(8*fact[1]+1))/2)

print(result)

Submission status: Wrong Answer

Solution code:
n=int(input())

from math import sqrt

div = int(sqrt(n))
ans=0
for i in range(2,div+1):
    if n%i==0:
        ans+=1
        n=int(n//i)

if ans==0:ans=1

if n==1:ans=0
print(ans)

Submission status: Wrong Answer

Solution code:
pri = []
def SieveOfEratosthenes(n):
    prime = [True for i in range(n + 1)]
    p = 2
    while (p * p <= n):
        if (prime[p] == True):
            for i in range(p * p, n + 1, p):
                prime[i] = False
        p += 1
    for p in range(2, n + 1):
        if prime[p]:
            pri.append(p)
n = int(input())
perm = n
SieveOfEratosthenes(int(n**0.5)+1)
per = []
for i in pri:
    tmp = i
    while tmp<=int(perm**0.5):
        if n%tmp==0:
            per.append(tmp)
            n//=tmp
        tmp *= i
print(len(per))

Submission status: Wrong Answer

Solution code:
# import sys
# readline = sys.stdin.readline
# generator = (readline().strip() for _ in range(N))

# N, M = map(int, input().split())
# As = list(map(int, input().split()))
# queries = (input() for _ in range(N))

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 solve():
    N = int(input())
    factors = factorization(N)

    total = 0
    for factor in factors:
        f, z = factor

        t = 0
        for i in range(0, 1000):
            m = i * (i+1) / 2
            if m > z:
                t = i - 1
                break

        total += t

    return total


def main():
    print(solve())


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
def fac(n):
    arr=[]
    temp=n
    for i in range(2,int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp//=i
            arr.append(cnt)
    if temp!=1:
        arr.append(1)
    if arr==[]:
        arr.append(1)
    return arr
anss=fac(n)
dic={}
ans=0
for i in anss:
    if i in dic:
        ans+=dic[i]
    elif i==1:
        dic[i]=1
        ans+=1
    else:
        j=i
        ansss=0
        cou=1
        while j>=cou:
            ansss+=1
            j-=cou
            cou+=1
        ans+=ansss
        dic[i]=ansss
print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
n = N
ans = 0


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


if is_prime(N):
    ans += 1


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


d = set()

for x in primes(int(n**0.5)+1):
    tmp = x
    while(tmp <= N):
        d.add(tmp)
        tmp *= x

d = list(d)
d.sort()
for i in d:
    if N % i == 0:
        N = N // i
        ans += 1


print(ans)

Submission status: Wrong Answer

Solution code:
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
a = prime_factorize(n)
from collections import Counter
c = Counter(a)
ans = 0
for i in c:
    ans += -(-c[i]//2)

print(ans)

Submission status: Wrong Answer

Solution code:
import math


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    N = read_int()
    if N == 1:
        return 0
    max_divisor = math.sqrt(N)
    divisor = 2
    counter = 0
    while divisor <= max_divisor:
        temp_divisor = divisor
        while N%temp_divisor == 0:
            N //= temp_divisor
            temp_divisor *= divisor
            counter += 1
        while N%divisor == 0:
            N //= divisor
        divisor += 1
    if counter == 0:
        return 1
    return counter


if __name__ == '__main__':
    print(solve())

Submission status: Wrong Answer

Solution code:
N = int(input())

p = [0]*10**6
for i in range(2, 10**6):
    if p[i] == 0:
        p[i] = 1
        j = 2
        while i*j < 10**6:
            p[i*j] = -1
            j += 1

L = []
for i in range(10**6):
    if p[i] < 1:
        continue
    j = 1
    while pow(i, j) <= N:
        L.append(pow(i, j))
        j += 1

L.sort()
ans = 0
temp = []
for i in L:
    if N%i == 0:
        N //= i
        ans += 1
        temp.append(i)

i = 2
f = True
while i <= N**0.5:
    if N%i == 0:
        f = False
        break
    i += 1
if N in temp or N == 1:
    f = False
if f:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
_n=n
if n==1:
    print(0)
    exit()
ans=0
for i in range(2,10**6):
    c=i
    while(n%c==0):
        n//=c
        ans+=1
        c*=i
if n==_n:
    ans+=1
print(ans)