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 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())
ans = 1
for i in factorization(n):
    ans = ans + i[1]
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
count=0
L=[]
for i in range(2,-int(-(n**0.5))):
    if n%i==0:
        n //= i
        L.append(i)
        count += 1
if n not in L:
    count += 1
print(count)

Submission status: Wrong Answer

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

def main():
  n = original_n = int(input().strip())
  max_search = int(math.sqrt(n)) + 1
  result = 0

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

  for i in range(2, max_search):
    if n % i == 0:
      result += 1
      n = n / i

    if n == 1:
      break

  if n == original_n:
    result += 1

  print(result)

main()

Submission status: Wrong Answer

Solution code:
N = int(input())

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

data = factorize(N)

# print(data)
ans = 0
for i in range(len(data)):
    ans += 1+ (data[i][1]-1)//2

print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
ans = 0
for i in range(2, 10**6+1):
    x = i
    while N % x == 0:
        ans += 1
        N //= x
        x += i
        print(N)
if ans == 0 and N != 1:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = []
def divisors(n):
    nums = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            nums.append(i)
            if i != n // i:
                nums.append(n//i)
    return sorted(nums)

while n > 1:
    d = divisors(n)
    for _d in d[1:]:
        if _d not in ans:
            n /= _d
            ans.append(_d)

print(len(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
a=1
b=0
while N > a:
  a += 1
  if N%a==0:
    N = N/a
    b += 1
    
print(b)

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

prime_factor = prime_factorize(n)

num_dict = dict(collections.Counter(prime_factor))

result = 0

for _, count in num_dict.items():
    i = 1
    while count >= i:
        result += 1
        count -= i
        i += 1

Submission status: Wrong Answer

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


def primes(n):
    ps = {}
    for i in range(2, int(n ** 0.5) + 2):
        if n == 1:
            break
        if n % i == 0:
            cnt = 0
            while n % i == 0:
                n = n // i
                cnt += 1

            ps[i] = cnt

    return ps


def main():
    n = int(input())
    if n == 1:
        print(0)
        exit()

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

    ps = primes(n)

    ans = sum([int((-1 + (1 + 8 * v) ** 0.5) / 2) for v in ps.values()])
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(0.5*i*(i+1)) for i in range(10)]
import math
res = 0
top = int(math.sqrt(N))
for i in range(2,top+1):
    count = 0
    while N%i == 0:
        N = N//i
        count += 1
    for j in range(10):
        if count < a[j]:
            res += (j-1)
            break
print(max(1,res))

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:
                p.append(i)
                if i*i != n:
                    p.append(n//i)
            i += 2
        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
    for i in d:
        for j in range(1, d[i]+1):
            d[i] -= j
            if d[i] < 0:
                break
            ans += 1

    print(ans)

main()

Submission status: Wrong Answer

Solution code:
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *					# ll = deepcopy(l)
from heapq import *					# heappush(hp,x)
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from bisect import *				# bisect_left(arr,x,start,end)  => start and end parameters are temporary
from sys import stdin				# bisect_left return leftmost position where x should be inserted to keep sorted
from sys import maxsize				# minn = -maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *				# pre = [0] + list(accumulate(l))
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''
24
'''

def isPrime(x):
	if(x == 1 or x == 4):
		return False
	elif(x in [2,3,5]):
		return True
	for i in range(2,int(sqrt(x))+1):
		if(x%i == 0):
			return False
	return True

def primeFactors(n):
	d = defaultdict(int)
	if(isPrime(n)):
		return {n:1}
	else:
		while(not n%2):
			n //= 2
			d[2] += 1
		for i in range(3,int(sqrt(n))+1,2):
			while(n%i):
				n //= i
				d[i] += 1
		if(n > 2):
			d[n] += 1
	return dict(d)

def solve(l):
	ans = 0
	d = primeFactors(l)
	for i in d:
		l = d[i]
		ans += max(0,int((sqrt(1+8*l)-1)/2))
	return ans

N = int(stdin.readline())
ans = solve(N)
print(ans)

Submission status: Wrong Answer

Solution code:
def prime(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 list(set(a))
x=int(input())
p=prime(x)
s=0

for j in p:
    i=1
    while x%(j**i)==0:
        x=x//(j**i)
        s+=1
        i+=1
print(p)
print(s)

Submission status: Wrong Answer

Solution code:
class Sieve: 
    
    def __init__(self, n=1):
        self.f = [0 for _ in range(n+1)]
        self.f[0] = -1
        self.f[1] = -1
        self.primes = []
        for i in range(2, n+1):
            if self.f[i]:
                continue
            self.primes.append(i)
            self.f[i] = i
            for j in range(i*i, n+1, i):
                if not self.f[j]:
                    self.f[j] = i
    
    def isPrime(self, x):
        return self.f[x] == x
    
    def factorList(self, x):
        res = []
        while x != 1:
            res.append(self.f[x])
            x //= self.f[x]
        return res
    
    def factor(self, x):
        fl = self.factorList(x)
        if not len(fl):
            return []
        res = [[fl[0], 0]]
        for p in fl:
            if res[-1][0] == p:
                res[-1][1] += 1
            else:
                res.append([p, 1])
        return res



n = int(input())

s = Sieve(10**6+10)

prime_list = []
for i in range(2, 10**6+10):
    if s.isPrime(i):
        prime_list.append(i)

pl = [0 for _ in range(len(prime_list))]
pos = 0
ans = 0
while pos < len(pl) and n >= prime_list[pos]:
    p = prime_list[pos]
    if n%(p**(pl[pos]+1)) == 0:
        pl[pos] += 1
        ans += 1
        n //= p**(pl[pos])
    else:
        pos += 1

if ans == 0 and n > 1:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
x = int(n**0.5)
if n == 1:
  print(0)
  exit()

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

def get_prime(n):
  if n<= 1: return []
  prime = [2]
  limit = int(n**0.5)
  data = [i+1 for i in range(2,n,2)]
  while limit >= data[0]:
    prime.append(data[0])
    data = [j for j in data if j%data[0] != 0]
  return prime + data

if is_prime(n):
  print(n)
  exit()

numbers = get_prime(x)
cnt = 0
for a in numbers:
  if n%a != 0: continue
  b = 1
  while n%(a**b)==0:
    cnt += 1
    n //= a**b
    b += 1
  if n == 1:
    print(cnt)
    exit()
print(cnt)

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 = 17049999
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:
n = int(input())
if n>1:
  powers = {n}
else:
  powers = set()
for i in range(2,int(n**0.5)):
  for j in range(1,41):
    if i**j>n**0.5:
      break
    else:
      powers.add(i**j)
power = list(powers)
power.sort()
counter = 0
for s in power:
  if n%s==0:
    n = n/s
    counter += 1
  if n<s:
    break
print(counter)

Submission status: Wrong Answer

Solution code:
import math

N=int(input())

ans=0
arr=[]



for i in range(int(math.sqrt(N))+3):
    if N % (i+2) == 0:
        ans+=1
        N=N/(i+2)

if N > 1 and ans==0:
    ans=1

print(ans)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
X=[0]*(10**6+1)
if n==1:
    ans=0
else:
    p=int(math.sqrt(n))
    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 n>p:
        ans+=1

print(ans)

Submission status: Wrong Answer

Solution code:

N = int(input())

ans = 0
i = 2
while(N > 1):
    if(N%i==0):
        N /= i
        ans += 1
    i += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())  # 10**12
sqrt_N = int(math.sqrt(N))
if N == 1:
    print(0)
    exit()

sosuu = [2]
A = sqrt_N + 2
for i in range(3, A, 2): # 2 以外の素数は奇数なので
    is_prime = True
    sqrt_i = math.sqrt(i) + 2
    for L2 in sosuu:
        if i % L2 == 0:  # すべての既存素数で割り切れなかったら素数
            is_prime = False
            break
        if L2 > sqrt_i:
            break
    if is_prime:
        sosuu.append(i)

# print(sosuu)
ans = 0
for i in sosuu:
    n = 1
    while 1:
        i_n = i ** n
        d,m = divmod(N, i_n)
        # print(d,m)
        if m == 0:
            N = d
            n += 1
            ans += 1
        else:
            break
if ans == 0:
    ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
N_ = N = int(input())
if N == 1:
    print(0)
    exit()
div = {}
for i in range(2, int(math.sqrt(N))+1):
    while N % i == 0:
        N /= i
        if i in div:
            div[i] += 1
        else:
            div[i] = 1
    if N == 1:
        break
if len(div) == 0:
    div[N_] = 1
ans = 0
cnt = []
for v in div.values():
    i = 1
    while v >= i:
        v -= i
        i += 1
        ans += 1
    if v != 0:
        cnt.append(v)
list.sort(cnt, reverse=True)
while len(cnt) >= 2:
    if cnt[0] > cnt[-1]:
        cnt[0] -= cnt[-1]
        ans += cnt[-1]
        cnt = cnt[:-1]
    elif cnt[0] == cnt[-1]:
        ans += cnt[0]
        cnt = cnt[1:-1]
    else:
        cnt[-1] -= cnt[0]
        ans += cnt[0]
        cnt = cnt[1:]
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

sys.setrecursionlimit(10000000)
import os
import math
import bisect
import collections
import itertools
import heapq
import re
import queue
from decimal import Decimal

# import fractions

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()

    if N % 2 != 0 and N % 3 != 0 and N != 1:
        print(1)
        exit()

    a, b, c, d, e, f, g, h = 1, 1, 1, 1, 1, 1, 1, 1
    ret = 0
    while True:
        if N % (2 ** a) == 0:
            N //= 2 ** a
            ret += 1
            a += 1
        elif N % (3 ** b) == 0:
            N //= 3 ** b
            ret += 1
            b += 1
        elif N % (5 ** c) == 0:
            N //= 5 ** c
            ret += 1
            c += 1
        elif N % (7 ** d) == 0:
            N //= 7 ** d
            ret += 1
            d += 1
        # elif N % (11 ** e) == 0:
        #     N //= 11 ** e
        #     ret += 1
        #     e += 1
        # elif N % (13 ** f) == 0:
        #     N //= 11 ** f
        #     ret += 1
        #     f += 1
        else:
            break

    print(ret if N == 0 or N == 1 else ret+1)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())

#xの約数を列挙する
def divisor(x):
    ans=set([])
    i=2
    while(i*i<=x):
        if(x%i==0):
            ans.add(i)
            ans.add(x//i)
        i+=1
    ans=sorted(list(ans))
    return ans

div_n=divisor(n)
#print(div_n)

prime_n=[]
isprime=[True for _ in range(len(div_n))]
for i in range(len(div_n)):
    if(isprime[i]):
        for j in range(i+1,len(div_n)):
            if(div_n[j]%div_n[i]==0):
                isprime[j]=False
        prime_n.append(div_n[i])
    else:
        pass
#print(prime_n)

soinsu={}
for di in prime_n:
    ans_di=0
    ni=n
    while(ni%di==0):
        ni//=di
        ans_di+=1
    soinsu[di]=ans_di
#print(soinsu)

ans=0
for k,v in soinsu.items():
    vi=v
    i=1
    while(vi>=i):
        vi-=i
        i+=1
        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

d = collections.Counter(prime_factorize(n))

r = 0
for v in d.values():
    _v = v
    _v -= 1
    r += 1
    e = 2
    while _v > 0:
        _v -= 2
        if _v >= 0:
            r += 1

print(r)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import sys

# from operator import itemgetter
sysread = sys.stdin.readline
read = sys.stdin.read
#from heapq import heappop, heappush
#from collections import defaultdict

sys.setrecursionlimit(10 ** 7)
# import math
# from itertools import product, accumulate, combinations, product
# import bisect# lower_bound etc
#import numpy as np
# from copy import deepcopy
#from collections import deque
#import numba
import math

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

    primes = []
    p = [0] * 1000000

    for i in range(2, 1000000):
        done = False
        m = int(i ** (1/2))
        for k in primes:
            if k > m:break
            if i % k == 0:
                done = True
                break
        if not done:
            primes.append(i)
            p[i] = 1


    count = 0

    for i in primes:
        if p[2]:
            s = i
            while True:
                if not N % s:

                    N = N // s
                    count += 1
                    s *= i

                else:break

    if count == 0 and N != 1:
        print(1)
    elif N != 1:
        print(count + 1)
    else:
        print(count)



if __name__ == "__main__":
    run()

Submission status: Wrong Answer

Solution code:
from math import floor,sqrt
N=int(input())

p = [1]*floor(sqrt(10**6))
p[0]=p[1]=0
prime=[]
for i in range(2,len(p)):
    if p[i]==0:
        continue
    prime.append(i)
    for j in range(i*2,len(p),i):
        p[j]=0

ans=0
for x in prime:
    cnt=0
    while N%x==0:
        cnt+=1
        N/=x
    ans+=floor((-1+sqrt(1+8*cnt))/2)
print(ans+int(N!=0))

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)) + 2):
        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:
from collections import defaultdict
from math import sqrt
n = int(input())
cnt = defaultdict(int)
ans = 0
flag = True

def judge_prime(i):
    cnt = 0
    for j in range(1, int(sqrt(i)) + 1):
        if i % j == 0:
            cnt += 1
    
    if cnt == 1:
        return True
    else:
        return False
if judge_prime(n):
    print(1)
    exit()
while flag == True:
    flag = False
    for i in range(2, n):
        if judge_prime(i):
            j = 1
            while 1:
                if n % i ** j == 0 and cnt[i ** j] == 0:
                    n //= i ** j
                    ans += 1
                    flag = True
                    cnt[i ** j] += 1
                    break
                elif i ** j > n:
                    break 
                j += 1
        if flag:
            break
print(ans)

Submission status: Wrong Answer

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

C = {}
for i in range(2, max(10, int(N**(0.5))+1)):
    while(N % i == 0):
        N = N//i
        if i not in C:
            C[i] = 1
        else:
            C[i] += 1

if len(C) == 0:
    print(1)
    sys.exit()

ans = 0
for i in C.values():
    s = 1
    while(True):
        i -= s
        if i < 0:
            break
        ans += 1
        s += 1
print(ans)

Submission status: Wrong Answer

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

N= int(input().rstrip('\n'))
M=N
lim = math.floor(math.sqrt(N))+1
res = 0
pri=[2]
for i in range(2,lim):
  if all(i % x != 0 for x in pri) or i==2:
    if N % i ==0:
      pri.append(i)
      add = 1
      pl = 1
      n = N//i
      while n%i==0:
        pl += 1
        n = n//i
        if pl>=((add+1)*(add+2)/2):
          add += 1
      res += add
      N = N//(i**pl)
if M == N:
  res += 1
print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 2
ans = 0
while True:
  if i * i > n:
    break
  if n % i == 0:
    cnt = 0
    while n % i == 0:
      n /= i
      cnt += 1
    k = 1
    while cnt >= k:
      cnt -= k
      k += 1
    ans += k - 1
  i += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
n_copy = n
divs = {}
for i in range(2, int(math.sqrt(n+1)) + 1):
    while n % i == 0:
        try:
            divs[i] += 1
        except KeyError:
            divs[i] = 1
        n //= i
    if i > n:
        break

if divs == {}:
    if n_copy == 1:
        print(0)
    else:
        print(1)
    exit()

divs_list = []
for key, value in divs.items():
    for i in range(1, value+1):
        divs_list.append(key ** i)
divs_list.sort()

ans = 0
for item in divs_list:
    if n_copy % item != 0:
        continue
    n_copy //= item
    ans += 1
print(ans)

Submission status: Wrong Answer

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

    if N == 1:
        print(0)
        return

    count = 0

    for i in range(10**6):
        a = i + 2

        if N % a == 0:
            N = N // a
            count += 1

        if N == 1:
            break
    if count == 0:
        print(1)
    else:
        print(count)


main()

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""

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())
fact = factorization(N)


ans = 0
for p, r in fact:
    index = 0
    cum_sum = 1
    cnt = 1
    while cum_sum <= r:
        index += 1
        cum_sum += cnt + 1
        cnt += 1

    ans += index
print(ans)

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") # 無限

n = int(input())
temp = int(n)
count = 0
for x in range(2,n+1):
    if temp%x == 0:
        count += 1
        temp //= x
    if temp < x:
        break
print(count)

Submission status: Wrong Answer

Solution code:
from functools import reduce
from decimal import *
from operator import mul

def main():
    n = int(input())
    p = prime_factorize(n)
    ans = []
    i = 1
    for v in p:
        i *= v
        if i not in ans:
            ans.append(i)
            i = 1
    print(len(ans))

def input_list():
    return list(map(int, input().split()))

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""

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([i, cnt])

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

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

    return arr
  
list = fac(n)
count = 0
for l in list:
  c = 0
  sum = 0
  while True:
    c += 1
    sum += c
    if l[1]<sum:
      break
    count += 1
    
print(count)

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:
    if(i[1] in [2,1]):
        co+=1
        continue
    a=int((2*i[1])**0.5)

    co+=a

    
print(co)

Submission status: Wrong Answer

Solution code:
N = int(input())

def factorization(n):
    a = []
    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
            a.append([i, cnt])

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

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

    return a

result = factorization(N)

count = 0
for p,i in result:
    if p == 1:
        continue
    s = 0
    for k in range(1, i+1):
        if p ** k > N:
            break
        else:
            if s + k > (i+1):
                break
            N /= p ** k
            count += 1
            s += k
print(count)

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:
        while 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())

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

tmp = n
ans = 0
for i in range(2, int(-(-n**0.5//1)+1)):
    if tmp % i == 0:
        cnt = 0
        while tmp % i == 0:
            cnt += 1
            tmp //= i
        i_cnt = int((cnt*2)**0.5//1)
        if i_cnt * (i_cnt+1) //2 <= cnt and (i_cnt+1) * (i_cnt+1) //2 > cnt:
            ans += i_cnt
        elif (i_cnt-1) * i_cnt //2 <= cnt and i_cnt * (i_cnt+1) //2 > cnt:
            ans += i_cnt - 1


if tmp != 1:
    ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import math


N = int(input())


def isprime(n):
    if n == 1:
        return False
    if n % 2 == 0 and n > 2:
        return False
    for i in range(3, int(math.sqrt(n)) + 1, 2):
        if n % i == 0:
            return False
    return True


z = 2
count = 0

if isprime(N):
    z = N

while True:
    if N % z == 0:
        N /= z
        count += 1
    z += 1
    if N < z:
        break

print(count)

Submission status: Wrong Answer

Solution code:
import math
A= int(input())
resArray = []
tmpA = A
for i in range(2, int(math.sqrt(A))):
    if tmpA == 1:
        break
    tmp = tmpA%i
    resArray.append(0)
    while tmp == 0:
        tmpA = tmpA/i
        resArray[-1] += 1
        tmp = tmpA%i
if tmpA != 1:
    print(1)
    exit()
res = 0
for i in resArray:
    if i != 0:
        for j in range(i + 1):
            if j*(j+1)/2 > i:
                res += j - 1
                break
print(res)

Submission status: Wrong Answer

Solution code:
def fanction(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())
    z_list=[]
    arr = fanction(N)
    k=0
    for i in range(len(arr)):
        #print(1)
        z= arr[i][0]
        z_list.append(z)
        arr[i][1]=arr[i][1]-1
        k+=1
        if arr[i][1]>1:
            for n in range(2,arr[i][1]+1):
                z2 = z**n
                if not(z2 in z_list):
                    #print(2,n)
                    z_list.append(z2)
                    arr[i][1]=arr[i][1]-n
                    k+=1
                if  arr[i][1]<n:
                    break
        else:
            continue
    if N==1:
        k=0
    print(k)
main()

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

factors = []

m2 = 0
while n > 1 and n % 2 == 0:
	m2 += 1
	n //= 2
if m2:
	factors.append((2,m2))

m3 = 0
while n > 1 and n % 3 == 0:
	m3 += 1
	n //= 3
if m3:
	factors.append((3,m3))

i = 5
l = int(math.sqrt(n)) + 1

while n > 1 and i < l:
	if n % i == 0:
		m = 0
		while n > 1 and n%i == 0:
			m += 1
			n //= i
		factors.append((i, m))
	i += 2

if n != 1:
	factors.append((n,1))

ans = 0

for _, m in factors:
	if m > 2:
		count = 0
		s = 0
		while s < m:
			count += 1
			s += count
		ans += count
	else:
		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

yakusu = factorization(n)

ans = 0

for i in range(len(yakusu)):
    l = yakusu[i]
    a,b = l[0],l[1]
    j = 1
    k = 1
    if a != 1:
        while b>j:
            ans += 1
            j += k
            k += 1
if n==1:
    print(0)
else:
    print(max(ans,1))