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:
from collections import defaultdict

D = defaultdict(int)
N = int(input())

a = 2
while a * a <= N:
    if N % a:
        a += 1
    else:
        N //= a
        D[a] += 1

D[N] += 1

ans = 0
for k,v in D.items():
    i = 0
    while i*(i+1) <= v * 2:
        i += 1
    ans += i-1

print(ans)

Submission status: Wrong Answer

Solution code:
a=int(input())
import math
def div(N):
   ans=0
   for i in range(2,int(N**0.5)+1):
      B=0
      if N%i==0:
         while N%i==0:
            N//=i
            B+=1
         for j in range(1,10000):
            B-=j
            if B >= 0:
               ans+=1
            else:
               break
   return ans
ans=div(a)
if a != 1 and ans == 0:
   print(1)
else:
   print(ans)

Submission status: Wrong Answer

Solution code:
a = int(input())
count = 0
used = []
for i in range(2,a):
  if a%i ==0:
    used.append(i)
    a /= 2
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
lis = []
for i in range(2,math.ceil(math.sqrt(n))+1):
    cnt = 0
    while n % i == 0:
        n //= i
        cnt += 1
    if cnt:lis.append(cnt)
ans = 0
for num in lis:
    go = 1
    while num >= go:
        ans += 1
        num -= go
        go += 1
print(ans)

Submission status: Wrong Answer

Solution code:

import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)
input = sys.stdin.readline


import numpy as np

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

    
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



s=factorize(int(input()))

res=0

for ss,n in s:
    tmp=(np.sqrt(8*n+1)-1)/2
    #print(tmp)
    res+=tmp

print(int(np.floor(res)))

#print(s)

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
for i in L:
    if N%i == 0:
        N //= i
        ans += 1
if N > 1 and ans == 0:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
dic={}
import math
for i in range(2,math.floor(math.sqrt(n))):
  for j in range(10**10):
    if n%i==0:
      if i in dic:
        dic[i]+=1
      else:
        dic[i]=1
      n=n//i
    else:
      break

if n!=1:
  if not dic:
    dic[n]=1


count=0
while dic:
  keep=1
  x=dic.popitem()
  num=x[1]
  for i in range(10**10):
    if num>=keep:
      num-=keep
      count+=1
      keep+=1
    else:
      break
print(count)

Submission status: Wrong Answer

Solution code:
# n = int(input())
n = 16
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

x = factorization(n)
ans = 0

for i, j in x:
    cnt = 1
    while j >= 1:
        if j == 1:
            ans += 1
            j -= 1
        elif j > 1:
            ans += 1
            j -= cnt
        cnt += 1
        if cnt > j:
            break

print(ans)

Submission status: Wrong Answer

Solution code:
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, n)
    ans += m
    total -= m * i
    if not m:
        break
    i += 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

fact = factorization(N)
s = 0
for p, e in fact:
    s += int(pow(e * 2 + 0.25, 0.5) - 0.5)
print(s)

Submission status: Wrong Answer

Solution code:
"""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())
A = factorization(N)
ans = 0
for p,n in A:
    for k in range(1,100):
        if n >= k:
            ans += 1
            n -= k
        else:break

print(ans)

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())
l = prime_factorize(n)
listlen = len(l)
counter = 0
onajicount = 0
neededcount = 1
before = None
kasiuu = 0
while counter <=listlen -1:
    if before == None:
        kasiuu += 1
        before = l[0]
    else:
        if l[counter] == before:
            onajicount += 1
            if onajicount == neededcount:
                neededcount += 1
                kasiuu += 1
                onajicount = 0
        else:
            neededcount = 2
            onajicount = 0
            kasiuu += 1
    before = l[counter]
    counter += 1
print(kasiuu)

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
count = 0
lists = factorization(n)
flag = True
i=0
while flag:
    i=i+1
    flag = False
    for pair in lists:
        if pair[1] >= i:
            pair[1] -= i
            count +=1
            flag=True
        else:
            continue

print(count)

Submission status: Wrong Answer

Solution code:
def primeFactorize(n):
    fac = []
    if n < 2: return fac
    while n%2 == 0:
        n //= 2
        fac.append(2)
    for i in range(3,int(n**0.5)+1,2):
        while n%i == 0:
            n //= i
            fac.append(i)
    if n != 1: fac.append(n)
    return fac

n = int(input())
s = set()
ans = 0
x = 1
for f in primeFactorize(n):
    x *= f
    if x not in s:
        ans += 1
        s.add(x)
        x = 1
print(ans)
# print(primeFactorize(n))

Submission status: Wrong Answer

Solution code:
from heapq import *
import sys

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

class Sieve:
    def __init__(self, n):
        self.plist = [2]  # n以下の素数のリスト
        min_prime_factor = [2, 0] * (n // 2 + 5)
        for x in range(3, n + 1, 2):
            if min_prime_factor[x] == 0:
                min_prime_factor[x] = x
                self.plist.append(x)
                if x ** 2 > n: continue
                for y in range(x ** 2, n + 5, 2 * x):
                    if min_prime_factor[y] == 0:
                        min_prime_factor[y] = x
        self.min_prime_factor = min_prime_factor

    def isprime(self, x):
        return self.min_prime_factor[x] == x

    # これが素因数分解(prime factorization)
    def pfct(self, x):
        pp, ee = [], []
        while x > 1:
            mpf = self.min_prime_factor[x]
            if pp and mpf == pp[-1]:
                ee[-1] += 1
            else:
                pp.append(mpf)
                ee.append(1)
            x //= mpf
        return [(p, e) for p, e in zip(pp, ee)]

def main():
    sv=Sieve(10**6)
    hp=[]
    for p in sv.plist:
        heappush(hp,(p,p))
    n=II()
    ans=0
    use=set()
    while hp:
        d,p=heappop(hp)
        if d>n:break
        if n%d==0:
            n//=d
            ans+=1
            use.add(d)
            heappush(hp,(d*p,p))
            #print(n)
    if n>1 and n not in use:
        for p in sv.plist:
            if n%p==0:
                break
        else:
            ans+=1

    print(ans)

main()

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:
        if N%divisor == 0:
            N //= divisor
            counter += 1
        divisor += 1
    if counter == 0:
        return 1
    return counter


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

Submission status: Wrong Answer

Solution code:
from sys import stdin
import math
def I(): return int(stdin.readline().rstrip())

n = I()

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

if ans == 0 and 2<=n:
    ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
a = int(input())
sqrta = int(math.sqrt(a))
cnt =0
for i in range(2,sqrta+1):
    if(a%i==0):
        a = a/i
        cnt+=1
        if(a<=i):
            a=1
if(a!=1):
    print(1)
else:
    print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())

LIM = int(N ** .5) + 10
P = [True] * LIM
P[0] = P[1] = False
for i in range(4, LIM, 2): P[i] = False
i = 3
while i * i < LIM:
	if P[i]:
		j = i * i
		while j < LIM:
			P[j] = False
			j += 2 * i
	i += 2

pr = []
for i in range(2, LIM):
	if P[i]:
		pr.append(i)

poss = []
for p in pr:
	poss.append(p)
	x = p
	while x * p < LIM:
		x *= p
		poss.append(x)

poss.sort()

# check if N is a prime
def isprime(x):
	for p in pr:
		if p >= x: return True
		elif x % p == 0: return False
	return True

if N == 1:
	print(0)
elif isprime(N):
	print(1)
else:
	r = 0
	for p in poss:
		if N % p == 0:
			N //= p
			r += 1
			if N == 1: break
	print(r)

Submission status: Wrong Answer

Solution code:
import sys
import math
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def make_grid(h, w, num): return [[int(num)] * w for _ in range(h)]


#隣接リスト 1-order
def make_adjlist_d(n, edges):
    res = [[] for _ in range(n + 1)]
    for edge in edges:
        res[edge[0]].append(edge[1])
        res[edge[1]].append(edge[0])
    return res


def make_adjlist_nond(n, edges):
    res = [[] for _ in range(n + 1)]
    for edge in edges:
        res[edge[0]].append(edge[1])
    return res


#nCr
def cmb(n, r):
    return math.factorial(n) // math.factorial(r) // math.factorial(n - r)


def prime_fact(n):
    root = int(math.sqrt(n))
    prime_dict = {}
    for i in range(2, root+1):
        cnt = 0
        while n % i == 0:
            cnt += 1
            n = n // i
        if cnt:
            prime_dict[i] = cnt
    if n != 1:
        prime_dict[n] = 1
    return prime_dict


def main():
    N = NI()
    L = list(prime_fact(N).values())
    ans = 0
    for l in L:
        if 1 <= l < 3:
            ans += 1
        elif 3 <= l < 6:
            ans += 2
        elif 6 <= l < 10:
            ans += 3
        elif 10 <= l < 15:
            ans += 4
        elif 15 <= l < 21:
            ans += 5
        elif 21 <= l < 28:
            ans += 6
        elif 28 <= l < 35:
            ans += 7
        elif 35 <= l:
            ans += 8
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys
from functools import lru_cache
 
#read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**6)
def read():
  return int(readline())
def reads():
  return map(int, readline().split())
def mp(arg):
  return map(int,arg.split())
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=read()
ls=factorization(n)
res=0
for num in ls:
    k=num[1]
    i=1
    while True:
        k-=i
        if k>=0:
            res+=1
        else:break
        i+=1
print(res)

Submission status: Wrong Answer

Solution code:
n=int(input())

def divisore(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

l=divisore(n)[1:]
#print(l)

ans=0
for i in l:
  if n%i==0:
    ans+=1
    n//=i
#  else:
#    break
  if n==1:
    break
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


ans = 0
prime = factorization(N)
for li in prime:
    check = li[1]
    i = 1
    while check > 0:
        if check >= i:
            ans += 1
        check -= i
        i += 1
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter
n = int(input())
def prime_factorize(n):
    # Return list of prime factorized result
    # O(sqrt(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)
cnt = Counter(l)

ans = 0
for key in cnt.keys():
    cur = 1
    while True:
        if cnt[key] >= cur:
            cnt[key] -= 1
            ans += 1
            cur += 1
        else:
            break
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
li=[0]*(10**6+1)
flag=False
if N==1:
  print(0)
  exit()
for i in range(2,int(N**0.5)+2):
  while N%i==0:
    flag=True
    N/=i
    li[i]+=1
if flag==False:
  print(1)
  exit()
ans=0
for count in li:
  use=1
  while count-use>=0:
    ans+=1
    count-=use
    use+=1
print(ans)

Submission status: Wrong Answer

Solution code:
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

# Factoring by trial split -- START --
def getPrimeList(n):
  l=[]
  t=int(math.sqrt(n))+1
  
  for a in range(2,t):
    while n%a==0:
      n//=a
      l.append(a)
  
  if n!=1:
    l.append(n)
  
  return l
# Factoring by trial split --- END ---

# Summarize count of factor within list -- START --
def summarize_list(l):
  sl=sorted(l)

  a=sl[0]
  c=1
  res=[]

  for x in sl[1:]:
    if x==a:
      c+=1
    else:
      res.append([a,c])
      a=x
      c=1
  res.append([a,c])

  return res
# Summarize count of factor within list --- END ---

def main():
  n=I()
  if n==1:
    return 0
  l=getPrimeList(n)
  a=summarize_list(l)

  # print(l)
  # print(a)

  ans=0
  for x,y in a:
    st=1
    while True:
      if st>y:
        break

      ans+=1
      y-=st
      st*=2

  return ans

# main()
print(main())

Submission status: Wrong Answer

Solution code:
N = int(input())
n = N
ans = 0
for i in range(2, int(n**0.5)+1):
    if N % i == 0:
        N = N // i
        ans += 1
if ans == 0 and N != 1:
    ans = 1

print(ans)

Submission status: Wrong Answer

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

L = math.ceil(math.sqrt(N)) + 1
isPrime = [True] * L
isPrime[0] = isPrime[1] = False
primes = []
for n in range(2, L):
    if isPrime[n]:
        primes.append(n)
        isPrime[2*n::n] = [False] * ((L-n-1) // n)

ans = 0
for p in primes:
    d = p
    while N % d == 0:
        ans += 1
        N //= d
        d *= p

print(max(1, ans))

Submission status: Wrong Answer

Solution code:
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

def input():
    return sys.stdin.readline().strip()

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

# 改行またはスペース区切りの入力をすべて読み込んでイテレータを返します。
def get_all_int():
    return map(int, open(0).read().split())

def rangeI(it, l, r):
    for i, e in enumerate(it):
        if l <= i < r:
            yield e
        elif l >= r:
            break

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

INF = 999999999999999999999999
MOD = 10**9+7

n = int(input())

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

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

    if len(arr) == 0:
        arr.append((n, 1))
    return arr

fac = factorization(n)
# log(fac)

ans = 0
for p,e in fac:
    x = e
    for i in range(1, 99999999):
        if x >= i:
            x -= i
            ans += 1
        else:
            break

print(ans)

Submission status: Wrong Answer

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


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


def main():
    N = int(input().strip())
    if N == 1:
        return 0
    factors = factorization(N)
    ans = 0
    for factor in factors:
        counter = 1
        while True:
            if factor[1] >= counter:
                factor[1] -= counter
                counter += 1
                ans += 1
            else:
                break
    return ans

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
from functools import lru_cache
from bisect import bisect_right as bir
N = int(input())

def get_prime_numbers(n):
    is_prime = [True]*(n+1)
    is_prime[0] = 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]]


dev = []
for i in get_prime_numbers(int(N**0.5)+1):
    if N % i == 0:
        dev.append(i)
        if i != N // i:
            dev.append(N//i)

D = defaultdict(int)
for i in dev:
    if i == 1:
        continue
    while N % i == 0:
        D[i] += 1
        N //= i


comb = []
m = 0
for i in range(1, 10000):
    m += i
    comb.append(m)

ans = 0
for k, v in D.items():
    ans += bir(comb, v)

print(ans)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

n = int(input())
dd = defaultdict(int)
for i in range(2, int(n ** (1 / 3) + 2)):
    while n % i == 0:
        dd[i] += 1
        n //= i
if n != 1:
    dd[n] += 1
ans = 0
cnt = {}
for i in range(9, 0, -1):
    tmp = i * (i + 1) // 2
    cnt[tmp] = i
for i, j in dd.items():
    for num in cnt:
        if j >= num:
            ans += cnt[num]
            break
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
from collections import Counter
#a,b = map(int,input().split())
#L = list(map(int,input().split()))
def pr(n):
    L = []
    for i in range(2,int(n**0.5)+1):
        while n % i==0:
            L.append(i)
            n = n//i
    if n != 1:
        L.append(n)
    return L

L = pr(n)
L = Counter(L)
num = 0
for k,v in L.items():
    if v%2 == 1:
        num +=v//2 +1
    else:
        num +=v//2
print(num)

Submission status: Wrong Answer

Solution code:
from sys import stdin
import math
def I(): return int(stdin.readline().rstrip())

n = I()

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

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

Submission status: Wrong Answer

Solution code:
def p(n):
    a=[]
    while n%2==0:
        a.append(2)
        n//=2
    f=3
    while f*f<=n:
        if n%f==0:
            a.append(f)
            n//=f
        else:
            f+=2
    if n!=1:
        a.append(n)
    return a
n=int(input())
a=p(n)
d={}
for i in a:
  d[i]=d.get(i,0)+1
b=list(d.values())
ans=0
d=[1]*50
for i in range(1,50):
    d[i]=d[i-1]+i
for i in b:
    c=0
    while d[c]<i:
        c+=1
    ans+=c    
print(ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    n = II()
    ans = 0
    d = defaultdict(int)
    d[1] = 1 
    for i in range(2, int(sqrt(n)) + 2):
        x = i
        while 1:
            if n % x == 0:
                ans += 1
                n //= x
                d[x] = 1
            else:
                break
            x *= i
    if d[n]:
        print(ans)
    else:
        print(ans + 1)
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

U = 10 ** 8 + 10
is_prime = np.zeros(U, np.bool)
is_prime[2] = 1
is_prime[3::2] = 1
for p in range(3, U, 2):
    if p*p > U:
        break
    if is_prime[p]:
        is_prime[p*p::p+p] = 0

M = 10 ** 5
small_primes = np.where(is_prime[:M])[0].tolist()

N = ir()
answer = 0
used = set([1])
for p in small_primes:
    d = p
    while N%d == 0:
        answer += 1
        N //= d
        used.add(d)
        d *= p

if N > 1 and N not in used:
    answer += 1

print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())
n = N
ans = 0
for i in range(2, int(n**0.5)+1):
    if N % i == 0:
        N = N // i
        ans += 1
if ans == 0:
    ans = 1

print(ans)

Submission status: Wrong Answer

Solution code:
def prime_factorize(N): #素因数分解
    exponent = 0
    while N%2 == 0:
        exponent += 1
        N //= 2
    if exponent: factorization = [[2,exponent]]
    else: factorization = []
    i=1
    while i*i <=N:
        i += 2
        if N%i: continue
        exponent = 0
        while N%i == 0:
            exponent += 1
            N //= i
        factorization.append([i,exponent])
    if N!= 1: factorization.append([N,1])
    assert N != 0, "zero"
    return factorization

N = int(input())

p = prime_factorize(N)


l = len(p)
s = sum((i for _,i in p))
ans = 0
for i in range(1,120):
    if s-i*l <= 0:
        ans += s//i
        break
    ans += l
    s -= l

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

#nの約数列挙
def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    ass.sort()
    return ass #sortされていない

D = divisor(N)
ans = 0
for d in D:
    if d == 1:
        continue
    if N >= d and N%d == 0:
        N //= d
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

# Factoring by trial split -- START --
def getPrimeList(n):
  l=[]
  t=int(math.sqrt(n))+1
  
  for a in range(2,t):
    while n%a==0:
      n//=a
      l.append(a)
  
  if n!=1:
    l.append(n)
  
  return l
# Factoring by trial split --- END ---

# Summarize count of factor within list -- START --
def summarize_list(l):
  sl=sorted(l)

  a=sl[0]
  c=1
  res=[]

  for x in sl[1:]:
    if x==a:
      c+=1
    else:
      res.append([a,c])
      a=x
      c=1
  res.append([a,c])

  return res
# Summarize count of factor within list --- END ---

def main():
  n=I()
  if n==1:
    return 0
  l=getPrimeList(n)
  a=summarize_list(l)

  # print(l)
  # print(a)

  ans=0
  for x,y in a:
    st=1
    while True:
      if st>y:
        break

      ans+=1
      y-=1
      st*=2

  return ans


# main()
print(main())

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())
ans = prime_factorize(N)
print(len(ans))

Submission status: Wrong Answer

Solution code:
import sys, collections
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    N = I()

    ans = []
    temp = N
    for i in range(2, int(N**0.5)+1):
        if temp%i == 0:
            ans.append(i)
            temp //= i
    if temp > 1:
        ans.append(temp)

    print(len(set(ans)))

if __name__ == '__main__':
    resolve()

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

dat = factorization(n)
#print(dat)

buf = []

for a,b in dat:
    for j in range(b):
        buf.append(a)
buf.sort(reverse=True)
#print(buf)

used = dict()
#print(used)
cur = 1
res = 0
for i in range(len(buf)):

    if buf[i] == 1:
        continue
    #print("i", i, "buf", buf[i])
    cur = cur * buf[i]
    #print("cur", cur)
    if cur not in used:
        #print("not use", cur)
        used[cur] = True
        #print(used)
        res += 1
        cur = 1

#print(used)
print(res)

Submission status: Wrong Answer

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

x = factorization(n)
ans = 0

for i, j in x:
    cnt = 1
    while j >= 1:
        if j == 1:
            ans += 1
            j -= 1
        elif j == 2:
            ans += 1
            j -= 2
        elif j > 1:
            ans += 1
            j -= cnt
        cnt += 1

print(ans)