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:
def main():
    import sys
    sys.setrecursionlimit(10**9)
    input = sys.stdin.readline

    N = int(input())

    if N == 1:
        print(0)
        return

    def get_prime(n):
        import math
        p = []
        if n % 2 == 0:
            p.append(2)

        sq = math.ceil(math.sqrt(n))
        i = 3
        while i <= sq:
            if n % i == 0:
                isPrime = True
                for j in p:
                    if i % j == 0:
                        isPrime = False
                        break
                if isPrime:
                    p.append(i)
            i += 2
        if len(p) == 0:
            p.append(n)
        return p
    
    p = get_prime(N)

    def prime_factorization(n, p):
        from collections import Counter
        d = Counter()
        for i in p:
            while n % i == 0:
                d[i] += 1
                n //= i
        return d

    d = prime_factorization(N, p)

    ans = 0
    his = {}
    for i in d:
        tmp = 1
        for j in range(d[i]):
            tmp *= i
            if N % tmp == 0 and not tmp in his:
                ans += 1
                N //= tmp
                his[tmp] = 1
            else:
                break
            if N == 1:
                break
        if N == 1:
            break

    print(ans)

main()

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
count = 0
def is_prime(p):
    dest = int(np.sqrt(p))
    for i in range(2, dest):
        if np.mod(p, i) == 0:
            return False
    return True

if is_prime(N):
    print(1)
else:
    for p in range(2, int(np.sqrt(N))):
        if np.mod(N, p) != 0:
            continue
        
        if not is_prime(p):
            continue

        e = 1
        while True:
            if p**e > N:
                break
            elif np.mod(N, p**e) == 0:
                N = N / (p**e)
                count += 1
                
            if np.mod(N, p) != 0:
                break

            e += 1
        if p >= int(np.sqrt(N)):
            break
    
    print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
m = n
c = 0
for i in range(2,n+1):
  if m % i == 0:
    m /= i
    c += 1
  elif m < i:
    break
print(c)

Submission status: Wrong Answer

Solution code:
N = int(input())

import heapq 
from collections import defaultdict
import numpy as np
import math

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

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




if is_prime(N):
    ans = 1
elif N == 1:
    ans = 0
else:
    if N > 10**6:
        heap = seachPrimeNum(int(math.sqrt(N))+1)
    else:
        heap = seachPrimeNum(N)
    # else:
        # heap = seachPrimeNum(N)
    # print(heap)
    # print(heap)
    heapq.heapify(heap)
    ans = 0
    dict_prime = defaultdict(int)

    while(1):

        # print(N)
        # cnt += 1
        # if cnt > 10:break
        # print(N)
        if not heap:
            if is_prime(N):
                ans += 1
                break
            break


        sub = heapq.heappop(heap)
        # print(sub)
        # print(cand)
        # print(heap)
        # print(cand)
        # print(heapq)
        if N < sub:
            # print(N,sub)
            # print("a")
            break
        if N % sub == 0:
            N = N // sub
            ans += 1
            if sub not in dict_prime:
                dict_prime[sub] = sub
                dict_prime[sub*sub] = sub
            else:
                dict_prime[sub*dict_prime[sub]] = dict_prime[sub]
                # print("a")
            heapq.heappush(heap, sub*dict_prime[sub])


print(ans)

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():
    NN=N=ii()
    ans = 0
    for i in range(2, int(N**0.525)):
        c = i
        while N%c == 0:
            N //= c
            c *= i
            ans += 1
        while N%i==0:
            N//=i
    if NN==N>1:
        ans += 1
    print(ans)





main()

Submission status: Wrong Answer

Solution code:
n = int(input())

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 is_prime(n):
    print(1)
    exit()

cnt = 0
flag = 1
for z in range(2,10**12):
    if flag == z:
        continue
    if n % z == 0:
        n = n // z
        cnt += 1
    else:
        flag +=1

    if n == 1 or is_prime(n) == True:
        print(cnt)
        exit()

Submission status: Wrong Answer

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())
b = prime_factorize(n)

res = 0
i = 0
pre = 0
while i < len(b): 
    if pre != b[i]:
        count = 0
        maxcount = 2
        res += 1
    else:
        count +=1
        if count >= maxcount:
            maxcount += 1
            count = 0
            res += 1
        else:
            count += 1
    pre = b[i]
    i += 1
print(res)

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

ans = 0
flg=True
reg = factorization(N)
for b, a in reg:
    if a==b==1:
        print(0)
        flg=False
        break
    elif a<3:
        ans+=1
    elif a<6:
        ans+=2
    elif a<10:
        ans+=3
    elif a<15:
        ans+=4
if flg:
    print(ans)
        

# print(reg)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = {}
max_count = 0
while n % 2 == 0:
    if 2 in a:
        a[2] += 1
    else:
        a[2] = 1
#    a.append(2)
    n //= 2
    max_count += 1

f = 3
while f * f <= n:
    if n % f == 0:
        if f in a:
            a[f] += 1
        else:
            a[f] = 1
        n //= f
    else:
        f += 2

if f > 1:
    if f in a:
        a[f] += 1
    else:
        a[n] = 1

cnt = 0
for k, v in a.items():
    d = 1
    while (v - d >= 0):
        v = v - d
        d +=1
        cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
import math
import collections
def trial_division_sqrt(n):
    prime_count = collections.Counter()
    
    for i in range(2, int(math.sqrt(n)) + 2):
        while n % i == 0:
            n /= i
            prime_count[i] += 1
    if n > 1:
        prime_count[n] += 1
    
    return prime_count

def times(prime_count , n):
    if(prime_count[n] == 0):
        return(0)

    tmp = 1
    while(tmp*(tmp+1)/2 < prime_count[n]):
        tmp = tmp + 1
        if(tmp*(tmp+1)/2 > prime_count[n]):
            return(tmp-1)

    return tmp

def operate_times(N, prime_count):
    sum = 0
    for i in range(int(math.sqrt(N)+0.5)+1):
        sum += times(prime_count, i)
        #print(times(prime_count, i))
        #print(prime_count[i])

    return sum


def eratosthenes_sieve(n):
    table = [0] * (n + 1)
    prime_list = []
    
    for i in range(2, n + 1):
        if table[i] == 0:
            prime_list.append(i)
            for j in range(i + i, n + 1, i):
                table[j] = 1
    
    return prime_list

if __name__ == '__main__':
    N = int(input())
    prime_count = trial_division_sqrt(N)
    res = operate_times(N, prime_count)
    if(res == 0 and prime_count[N] == 1):
        print(1)
    else:
        print(res)

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)
B=len(A)
k=0

for i in range(B):
    a=1
    while A[i][1]>=a*(a+1)/2:
        a+=1
    k=k+a-1
print(k)

Submission status: Wrong Answer

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)+2):
    if N % i == 0:
        count += 1
        N /= i
if N != 1:
  count += 1
print(1 if count == 0 else 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 pop(stack):
	return stack[0],stack[1:]

def push(stack,x):
	stack.append(x)
	s = set(stack)
	p = list(s)
	p.sort()
	return p

n = int(input())
#a = sympy.factorint(n)
a = factorization(n)
stack = []
temp = []
for i in a:
	stack.append(i[0])
	temp.append(i[0])

ans = 0
while 1 < n:
	v, stack = pop(stack)
	if n%v == 0:
		ans += 1
		n = n//v
		if n <= v: break
		for i in temp:
			#print(i*v)
			stack = push(stack,i*v)
	else:
		continue
print(ans)

Submission status: Wrong Answer

Solution code:

N = int(input())

def furui(n):
    if n < 2:
        return []
    plist = [1 for i in range(n)]
    plist[0] = plist[1] = 0
    for i in range(2, n):
        if plist[i]:
            for j in range(i*2, n, i):
                plist[j] = 0
    ret = []
    for i in range(n):
        if plist[i] != 0:
            ret.append(i)
    return ret


primes = furui(1000000)
count = 0

if N == 1:
    print(0)
else:
    for p in primes:
        e = 1
        z = p ** e
        while N >= z:
            if N % z == 0:
                N //= z
                count += 1
                # print(z, N)
            e += 1
            z = p ** e
    if count:
        print(count)
    else:
        print(1)  # prime

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
prime = []
insu = {}
max_itr = math.ceil(math.sqrt(n))+1
try_range = [2] + list(range(3, max_itr, 2))
for i in try_range:
    if i > max_itr:
        break
    if n%i == 0:
        flag = 0
        for p in prime:
            if i%p == 0:
                flag = 1
                break
        if flag == 0:
            prime.append(i)
            while n%i == 0:
                if i in insu:
                    insu[i] += 1
                else:
                    insu[i] = 1
                n //= i
            max_itr = math.ceil(math.sqrt(n))+1

if n != 1 and len(insu)==0:
    insu[n] = 1
# print(insu)

count = 0
for v in insu.values():
    i = 1
    while v >= i:
        v -= i
        i += 1
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
S=lambda:input()
I=lambda:int(input())
L=lambda:list(map(int,input().split()))
LS=lambda:list(map(str,input().split()))
 
def main():
    n=I()
    dic={}
    import math
    for i in range(2,int(math.sqrt(n))+10):
        if n%i==0:
            while(n%i==0):
                if i in dic:
                    dic[i]+=1
                else:
                    dic[i]=1
                n//=i
        if n==1:
            break
    if not dic:
        if n!=1:
            dic[n]=1
    ans=0
    for k,v in list(dic.items()):
        tmp=v
        sub=1
        tmp-=sub
        if tmp==0:
            ans+=1
        while tmp>0:
            ans+=1
            tmp-=sub
            sub+=1
        if tmp<0:
            dic[k]=tmp+sub
        else:
            dic.pop(k)
    print(ans)
        

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
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]
  
divs = make_divisors(n)
#print(divs)

sNR = [2,3,4,5,7,8,9,11,16,25,27,32,49]

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

count=0
for div in divs:
  if div in sNR or is_prime(div):
    if n == 1:
      break
    n /= div
    count+=1

print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())


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


prime_numbers = primes(1000000)

dividers = []

N_MAX = 10 ** 12

for p in prime_numbers:
    for m in range(1, 40):
        if p ** m <= N_MAX:
            dividers.append(p ** m)
        else:
            break

dividers = sorted(dividers)


def isprime(n):
    '''check if integer n is a prime'''

    # make sure n is a positive integer
    n = abs(int(n))

    # 0 and 1 are not primes
    if n < 2:
        return False

    # 2 is the only even prime number
    if n == 2:
        return True

    # all other even numbers are not primes
    if not n & 1:
        return False

    # range starts with 3 and only needs to go up
    # the square root of n for all odd numbers
    for x in range(3, int(n ** 0.5) + 1, 2):
        if n % x == 0:
            return False

    return True


used_numbers = []

if N == 1:
    used_numbers = []
elif isprime(N):
    used_numbers.append(N)
else:
    idx = 0
    while idx < len(dividers):
        z = dividers[idx]

        if z > N:
            break

        if N % z == 0 and z not in used_numbers:
            N = int(N / z)
            used_numbers.append(z)

            # print('div success:' + str(z))
            # print(N)

            if N == 1:
                break
        else:
            pass
            # print('div failed:' + str(z))

        idx += 1

# print(used_numbers)
print(len(used_numbers))

Submission status: Wrong Answer

Solution code:
def prime_list(lst, limit):
    for num in range(3, limit, 2):
        if num ** 2 > limit:
            break
        flag = True
        for p_num in lst:
            if (p_num * p_num > num):
                break
            else:
                if (num % p_num == 0):
                    flag = False
                    break
        if flag:
            lst.append(num)


def main():
    n = int(input())
    lst = [2]
    prime_list(lst, n)
    lst.append(n)

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

    cnt = 0
    for i in lst:
        tmp = 1
        while tmp < n:
            tmp *= i
            n, m = divmod(n, tmp)

            if m == 0:
                cnt += 1
            else:
                n = n * tmp + m
                break
        if n == 0:
            break

    print(cnt)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
dim = 7
prime = [1]*(10**dim+1)
from collections import Counter
p = Counter()
p_set = []
for i in range(2,10**dim+1):
    j = i
    if prime[i] != 0:
        p[i] += 1
        p_set.append(i)
        while(j <= 10**dim):
            prime[j] = 0
            j += i

N = int(input())
cnt = 0
for n in p_set:
    if n > N:
        break
    while(1):
        if N%(n**p[n])==0:
            N //= n**p[n]
            cnt += 1
            p[n] += 1
        else:
            break
if N > 1:
    cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
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
 
def gen_list_n_removed(l, n):
    return [i for i in l if i != n]

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]]
 
 
N = int(input())
 
num_list = set()
 
hoge = primes(20000000)
 
for i in range(1, 30):
    for j in hoge:
        res = j ** i
        if res > 10 ** 12:
            break
        num_list.add(j ** i)
 
num_list = sorted(num_list)
 
if is_prime(N):
    print(1)
    exit(0)
 
count = 0
while True:
    for i in num_list:
        if N % i == 0:
            N = N / i
            count += 1
            num_list = gen_list_n_removed(num_list, i)
            break
        if i == num_list[-1]:
            print(count)
            exit(0)

Submission status: Wrong Answer

Solution code:
"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()
inf = float("inf") # 無限
# 参考URL
# https://qiita.com/LorseKudos/items/9eb560494862c8b4eb56
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n = int(input())

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

count = 0

# print(divisor_list)
if 0<len(divisor_list):
    for divisor in divisor_list[:]:
        # print("n:{} div:{}".format(n,divisor))
        if n%divisor==0:
            count += 1
            n = round(n/divisor)
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())
if N == 1:
    print(0)
else:
    result = 0
    for i in range(len(factorization(N))):
        tempnumber = factorization(N)[i][1]
        plusnumber = 1
        while tempnumber > 0:
            tempnumber -= plusnumber
            result += 1
            plusnumber += 1
    print(result)

Submission status: 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 get_z(factor):
    for f_list in factor:
        for i in range(f_list[1]):
            z = f_list[0] ** (i + 1)
            if z not in choice_list:
                choice_list.append(z)
                return z

n = int(input())
factor = factorization(n)

choice_list = []

while n > 1:
    z = get_z(factor)
    if z is None:
        break
#     print(z)
#     print(choice_list)
    n //= z
    factor = factorization(n)
#     print(z)

Submission status: Wrong Answer

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

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

    cnt = 0
    jge = 0

    for i in range(0, len(z)):
        if jge == z[i]:
            jge += z[i]
            n = n / z[i]
        else:
            jge = z[i]
            n = n / z[i]
            cnt += 1

    if len(z) == 0:
        print(0)
        return

    print(cnt)
    return
main()

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
N = int(input())
n = (Decimal(N)**Decimal(1/2))//1
i = 2
c = 0
T=[]
while i <= n and N !=1:
  if N%i ==0:
    T.append(i)
    N = int(N/i)
  i += 1
if N in T :
  print(len(T))
elif N != 1:
  print(len(T)+1)
else:
  print(len(T))

Submission status: Wrong Answer

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

W =[]
L = list(make_divisors(N))

while len(L)>1:
    for i in L[1:]:
        if i in W :
            continue
        else:
            N=int(N/i)
            W.append(i)
            L = list(make_divisors(N))
            break
        break
    else:
        break

print(len(W))

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)

    if temp!=1:
        arr.append(temp)

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

    return arr

def main():
    n = int(input())
    from collections import deque
    q = deque(factorization(n))
    buf = set()
    cnt = 0
    p = 1
    while q:
        p *= q.popleft()
        if p not in buf:
            cnt += 1
            buf.add(p)
            p = 1

    print(cnt)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

N = int(input().strip())
#-----
cnt = 0

for i in range(2, int(N**(1/2)) + 1):
    if N % i == 0:
        cnt += 1

if (cnt == 0) and (N != 1):
    print(1)
else:
    print(cnt)

Submission status: Wrong Answer

Solution code:

N = int(input())

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

import math
n = math.floor(math.sqrt(N)) + 1

cm = []
for i in range(2, n+1):
    if (N % i != 0):
        continue
    
    ex = 0
    while (N % i == 0):
        ex += 1
        N //= i
        
    cm.append([i, ex])
    
if len(cm) == 0:
    print(1)
    exit()
        
#print(cm)

su = [0] * 2000
s = 0
for i in range(1, 50+1):
    s += i
    su[s] = i
    
print(su)

f = 0
for i in range(2000):
    if su[i] == 0:
        su[i] = f
    else:
        f = su[i]
        
print(su)

count = 0
for i in cm:
    #print(i)
    #print(i[1])
    count += su[i[1]]

print(count)

Submission status: Wrong Answer

Solution code:
def make_div_list(num):
    div_list=[]
    for i in range(1, int(num**0.5)+1):
        if num%i==0:
            div_list.append(i)
            if i!=num//i:
                div_list.append(num//i)
    
    div_list.sort()
    return div_list

n=int(input())
t=make_div_list(n)

ans=0

for num in t:
    if n%num==0:
        n/=num
        ans+=1
    
    if n<num:
        print(ans)
        exit()

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


x = prime_factorize(N)
res = 0
transSet = set(x)

for val in transSet:
    q, mod = divmod(x.count(val), 2)
    res += q + mod

print(res)

Submission status: Wrong Answer

Solution code:
import collections
N=int(input())
ans=0
def prime_factorize(n):
    a = []
    count=0
    while n % 2 == 0:
        count+=1
        n //= 2
    a.append(count)
    f = 3
    count=0
    while f * f <= n:
        if n % f == 0:
            count+=1
            n //= f
        else:
            f += 2
            a.append(count)
            count=0
    if n != 1:
        a.append(1)
    return a
c = prime_factorize(N)
for i in range(len(c)):
    a=c[i]
    for j in range(1,c[i]+1):
        if a>=j:
            ans+=1
            a-=j
        else:
            break
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
def sample_code():
    n = N
    
    #print('# 素因数')
    fct = factorize(n)
    #print(fct)
    count=0
    for i in range(len(fct)):
        if fct[i]== 1:
            count+=0
        else:
            count+=fct[i][1]//2-1    
    if N==1:
        print("0")
    elif len(fct)+count==0:
        print("1")
    else:
        print(len(fct)+count)
    #print('# 約数')
    #for div in divisorize(fct):
        #print(div, num(div))


def divisorize(fct):
    b, e = fct.pop()  # base, exponent
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]


def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a
if __name__ == '__main__':
    sample_code()

Submission status: Wrong Answer

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

n=int(input())
li=fac(n)

ans=0
y=0
for x in range(1,10):
    y=y+x
    ans=ans+len([i for i in li if i >= y])
print(ans)

Submission status: Wrong Answer

Solution code:
from math import sqrt

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

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

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

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

    return arr

base=int(input())
tmp=base
num=[]
if is_prime(base):
  num.append(base)
else:
  for i in range(2, int(sqrt(base))+1):
    if is_prime(tmp):
      num.append(i)
      break
    if i > tmp:
      break
    if tmp % i == 0 and len(factorization(i)) == 1:
      num.append(i)
      tmp/=i
print(len(num))

Submission status: Wrong Answer

Solution code:
pn=[2];A=10000
for L in range(3,A):
    chk=True
    for L2 in pn:
        if L%L2 == 0:chk=False
    if chk==True:pn.append(L)
      
ln=[]
for i in range(len(pn)):
  for j in range(8):
    ln.append(pn[i]**j)
mn=sorted(list(set(ln)))

n=int(input())

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

count=0
for k in range(1,len(mn)):
  if n%mn[k]==0:
    n=n//mn[k]
    count+=1
    if n==1:
      break
if count==0:
  print(1)
  exit()
print(count)

Submission status: Wrong Answer

Solution code:
N=int(input())
# a=int(input())
#A,B=map(str,input().split(" "))
#A=int(A)
#B=int(float(B)*100)

a=[]
for number1 in range(2,5500):
    count=0
    for number2 in range(1,number1):
            number=number1%number2
            if number==0:
                count+=1
    if count==1:
        a.append(number1)
b=a

for i in a:
  tmp = i
  while i < 10000000000000:
    i *= tmp
    b.append(i)

#print(b)
        

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

count=0
for i in b:
  if N <= 1:
    break
  if N % i == 0:
    N /= i
    count += 1
  #print(i,N, count)

if N == 1:
  print(count)
else:
  print(count+1)