Problem:


Score : 400 points

Problem Statement

Given is a positive integer N. Consider repeatedly applying the operation below on N:

First, choose a positive integer z satisfying all of the conditions below:

z can be represented as z=p^e, where p is a prime number and e is a positive integer;

z divides N;

z is different from all integers chosen in previous operations.

Then, replace N with N/z.

Find the maximum number of times the operation can be applied.

Constraints

All values in input are integers.

1 \leq N \leq 10^{12}

Input

Input is given from Standard Input in the following format:

N

Output

Print the maximum number of times the operation can be applied.

Sample Input 1

24

Sample Output 1

3

We can apply the operation three times by, for example, making the following choices:

Choose z=2 (=2^1). (Now we have N=12.)

Choose z=3 (=3^1). (Now we have N=4.)

Choose z=4 (=2^2). (Now we have N=1.)

Sample Input 2

1

Sample Output 2

0

We cannot apply the operation at all.

Sample Input 3

64

Sample Output 3

3

We can apply the operation three times by, for example, making the following choices:

Choose z=2 (=2^1). (Now we have N=32.)

Choose z=4 (=2^2). (Now we have N=8.)

Choose z=8 (=2^3). (Now we have N=1.)

Sample Input 4

1000000007

Sample Output 4

1

We can apply the operation once by, for example, making the following choice:

z=1000000007 (=1000000007^1). (Now we have N=1.)

Sample Input 5

997764507000

Sample Output 5

7



Sample input:
24


Sample output:
3

Submission status: Wrong Answer

Solution code:
import math

N=int(input())

ans=0
arr=[]

tmp=1

for i in range(int(math.sqrt(N))+10):
    tmp=1
    while N % (i+2) == 0:
        for j in range(tmp):
            if N % (i+2) == 0:
                N=N/(i+2)
                flg=True
            else:
                flg=False
        if flg:
            ans+=1
        #print("tmp:"+str(tmp))
        #print("N:"+str(N))
        #print("ans:"+str(ans))
        tmp+=1


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

print(ans)

Submission status: Wrong Answer

Solution code:
import math
from collections import defaultdict


N = int(input())
n = N
#素因数分解
factor = defaultdict(lambda: 0)
tmp = int(math.sqrt(N))+1
for num in range(2,tmp):
    while N % num == 0:
        N //= num
        factor[num] += 1
if not factor:
    factor[n] += 1
else:
    factor[N] += 1



ans = 0
for num in factor:
    i = 1
    while True:
        factor[num] -= i
        if factor[num]<0:
            break
        ans += 1
        i+=1

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
nn=N
import math
sq=int(math.sqrt(N))+10000

i=2
ans=0
count1=0
count2=1
while sq>=i:
    if nn%i==0:
        nn//=i
        count1+=1
        if count1//count2>0:
            ans+=1
            count2+=1
            count1=0
    else:
        i+=1
        count1=0
        count2=1

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

print(ans)

Submission status: Wrong Answer

Solution code:
import math

def isPrime(num):
    if num < 2:
        return False
    elif num == 2:
        return True
    elif num % 2 == 0:
        return False

    for i in range(3, math.floor(math.sqrt(num))+1, 2):
        if num % i == 0:
            return False
    return True


def find_all_prime(num):
    prime_list = [2]
    for i in range(3, num, 2):
        if isPrime(i):
            prime_list.append(i)

    return prime_list


if __name__ == "__main__":
    N = int(input())
    prime_list = find_all_prime(10**6)
    count = 0
    if isPrime(N):
        print(1)
    else:        
        for i in prime_list:
            j = 1
            while N > 1:
                if N // i**j == 0:
                    break
                if N % i**j == 0:
                    N = N // i**j
                    count += 1

                    print('i: ',i, 'j: ',j, 'N: ', N)
                j +=1
        
        print(count)

Submission status: Wrong Answer

Solution code:
def create_divisors(n):
  """
  自然数nの全ての約数を列挙したリストを作成する。

  Parameters
  ----------
  n : int
    自然数

  Returns
  -------
    divisors：list

  """
  divisors=[]
  for i in range(1,int(n**0.5)+1):
    if n%i==0:
      divisors.append(i)
      if i!=n//i:
        divisors.append(n//i)
  divisors.sort()
  return divisors
def factorization(n):
    """
    引数の値を素因数分解したリストを返す

    Parameters
    ----------
    n : int
        素因数分解したい自然数

    Returns
    -------
    retlist : list
        2以上の整数n => [[素因数, 指数], ...]の2次元リスト
    """
    retlist = []
    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
            retlist.append([i, cnt])

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

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

    return retlist
def isPrime(x):
  """
  xが素数か否か判定する。

  Parameters
  ----------
  x: int
      自然数

  Returns
  -------
      True:素数
      False:素数ではない
  """
  if x<2:
    return False
  for i in range(2,int(x**0.5)+1):
    if x%i==0:
      return False
  return True

n=int(input())
d=factorization(n)
# print(d)
p=[]
for i in range(len(d)):
  if isPrime(d[i][0]):
    p.append(d[i]) 

w=[int(i)  for i in range(1,1000001)]
from itertools import accumulate
from bisect import bisect_left
s=list(accumulate(w))
ans=0
for i in range(len(p)):
  idx=bisect_left(s,p[i][1])
  ans+=idx+1
  if p[i][1]-s[i-1]>1 and p[i][1]>1:
    ans-=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(float(input()))

res=0

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

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

Submission status: Wrong Answer

Solution code:
from math import sqrt as s
def fact(n):
    c=0
    m=1
    l=[]
    while n%2==0:
        if n!=1:
            m=m*2
            n=n//m
            c+=1
        else:
            break
    for i in range(3,int(s(n))+1,2):
        if n!=1:
            m=1
            while n%i==0:
                c+=1
                m=m*i
                n=n//m
        else:
            break
    if n>2:
        c+=1
    return c

print(fact(int(input())))

Submission status: Wrong Answer

Solution code:
import collections
import math

n = int(input())

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

a = collections.Counter(prime_factorize(n))

res = 0

for i in a.items():
    if i[1] > 3:
        x = 2
        y = 3
        while True:
            if y < i[1]:
                y = y * x
                x += 1
            else:
                res += x
                break
    elif i[1] == 3:
        res += 2
    else:
        res += 1

print(res)

Submission status: Wrong Answer

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

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

# print(*sosuu, sep='\n')
ans = 0
for i in sosuu:
    if N < i:
        break
    n = 1
    while 1:
        i_n = i ** n
        if N < i_n:
            break
        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 collections
from collections import defaultdict

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

count = 0
n = int(input())
d = defaultdict(int)
ans = prime_factorize(n)
for i in ans:
    d[i] += 1
for i in d.values():
        if i < 3:
            count +=1
        elif i < 6:
            count +=2
        elif i < 10:
            count +=3
        elif i < 15:
            count +=4
        elif i < 21:
            count +=5
        elif i < 28:
            count +=6
        elif i < 36:
            count +=7
print(count)

Submission status: Wrong Answer

Solution code:
import math
from collections import defaultdict
def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
          n /= i
          table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table
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())
    pri = factorization(n)
    res = 0
    ans = 0

    for i in pri:
        if i[1]%2 == 1:
            if i[1]>1:
                ans+=2
            else:
                ans+=1
        else:
            if i[1]>2:
                ans+=3
            else:
                ans+=1
    if len(pri)==1 and pri[0][1]==1:
        ans=1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import time
def check(n,k):
    start = time.time()
    if n == 1:
        return -1
    else:    
        for i in range(int(k),int(n+1)):
            end = time.time()-start
            if end>0.002:
                return 1
            if n%i==0:
                for j in range(2,i+1):
                    if i%j==0:
                        a=i
                        while a!=1:
                            a /= j
                            if a==1:
                                return i
                            if a%j!=0:
                                break
        return -1
            
n = int(input())
count = 0
k = 2
while check(n,k)!=-1:
    s = check(n,k)
    n //= s
    k = s+1
    count+=1
    if s == 1:
        break
print(count)

Submission status: Wrong Answer

Solution code:
import math
import collections


def trial_division(n):
    factor = []
    tmp = int(math.sqrt(n)) + 1
    for num in range(2, tmp):
        while n % num == 0:
            n //= num
            if num != 1:
                factor.append(num)
    if not factor:
        return -1
    else:
        factor.append(n)
        return factor


n = int(input())
l = trial_division(n)
if n == 1:
    print(0)
    exit(0)
if l == -1:
    print(n)
    exit(0)
c = collections.Counter(l[:-1])

ans = 0
for k, v in c.items():
    s = 1
    for i in range(1, v):
        if i * (i + 1) <= v * 2:
            s = max(s, i)
    ans += s
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

def seachPrimeNum2(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    primeNum2 = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    for i in range(1,10):
      for j in primeNum:
        primeNum2.append(j**i)
    return primeNum2
def seachPrimeNum3(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    primeNum2 = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    for i in range(1,5):
      for j in primeNum:
        primeNum2.append(j**i)
    return primeNum2
def seachPrimeNum4(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    primeNum2 = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    for i in range(1,3):
      for j in primeNum:
        primeNum2.append(j**i)
    return primeNum2
P = seachPrimeNum2(100)
P += seachPrimeNum3(1000)
P = set(P+seachPrimeNum4(1000000))
N = int(input())
ans = 0
for p in P:
  if N%p == 0:
    ans += 1
    N = N//p
  if N == 1:
    print(ans)
    exit()
print(max(1,ans))

Submission status: Wrong Answer

Solution code:
import sys
n=int(input())
if n == 1:
    print(0)
    sys.exit()
tmp=n
ans=0
for i in range(2,n):
    if tmp % i == 0:
        tmp = tmp // i
        ans += 1
        continue
    if i > tmp:
        break
    if i > tmp // i:
        ans+=1
        break
print(ans)

Submission status: Wrong Answer

Solution code:
#23ぐらいまでで良さそう。
z = [2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23]

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

sosuu = primes(1000100)
count = [0] * len(sosuu)
convert = [0] * 56

N = int(input())
ans = 0

flag = True
while (flag):
        flag = False
        for i in range(len(sosuu)):
                if N % sosuu[i] == 0:
                        N = N // sosuu[i]
                        count[i] += 1
                        flag = True

tmp = 0
for i in range(1, 11):
        tmp += i
        convert[tmp] = i
for i in range(1, len(convert)):
        if convert[i] == 0:
                convert[i] = convert[i - 1]


for i in count:
        ans += convert[i]

if N > sosuu[-1] and ans == 0:
        ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
count = 0
def prime_factor(n):
    ass = []
    for i in range(2,int(n**0.5)+1):
        while n % i==0:
            ass.append(i)
            n = n//i
    if n != 1:
        ass.append(n)
    return ass
p_li = list(set(prime_factor(n)))

for z in range(2,n+1):
    for p in p_li:
        w = math.log(z)/math.log(p)
        div = n/z
        if w.is_integer() and div.is_integer():
            count+=1
            n = n/z
    if z > 16 :#高々2**40が10**12
        break
    
    

print(count)

Submission status: Wrong Answer

Solution code:
from collections import deque
import math
N = int(input())
# 以下の条件を全て満たすzを選ぶ
# ある素数pと正の整数eを用いてz=p**eと表すことができる
# Nがzで割り切れる
# 以前の操作で使ったものは使えない

# これを、N=N/zで繰り返し行い、何回行えるかを出力する

used_nums = deque([1])


def prime_numbers(n):
    if n < 2:
        return []

    m = (n + 1) // 2
    p = [True] * m
    for i in range(1, int((n ** 0.5 - 1) / 2) + 1):
        if p[i]:
            for j in range(2 * i * (i + 1), m, 2 * i + 1):
                p[j] = False
    # 素数のみ返す
    a = [2 * i + 1 for i in range(m) if p[i]]
    a[0] = 2
    return a


P = set(prime_numbers(int(math.sqrt(N))))
# これが素数
P = [n for n in P if (N % n) == 0]
# Nを割り切れるもののみのこす
# print(P)
ans = 0
for num in P:
    start_x = 1
    while N >= num**start_x:
        if N % num != 0:
            break
        if N % (num**start_x) == 0 and (num**start_x) not in used_nums:
            N = N / (num**start_x)
            ans += 1
            used_nums.append(num**start_x)
        start_x += 1
# print(N)
# print(used_nums)
if N not in used_nums:
    used_nums.append(N)
print(len(used_nums) - 1)

Submission status: Wrong Answer

Solution code:
N = int(input())

def primef(n):
  m = n
  i = 2
  p_nums = []
  while i * i<= m:
    j = i
    while n % j == 0:
      n /= j
      p_nums.append(j)
      j *= i
    i += 1
  return p_nums

ans = primef(N)

print(len(ans))

Submission status: Wrong Answer

Solution code:
#nの素数判定
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

import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
n = I()
ans = 0
if is_prime(n):
    ans = 1
elif n == 1:
    ans = 0
else:
    l = [i for i in range(2, 5000000)]
    # d = collections.deque(l)
    for i in l:
        if n % i == 0:
            ans += 1
            n = n//i
        if n == 1:
            break
print(ans)

Submission status: Wrong Answer

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

n = int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())

import math

def func(N, cnt):
        n = N
        for i in range(2, int(math.sqrt(N)) + 2):
                m0 = i
                m = m0
                while n % m == 0:
                        n = n // m
                        m = m * m0
                        cnt +=1
        return (cnt)

cnt = 0

if N == 1:
        ans = 0
else:
        cnt = func(N, cnt)

if N!=1 and cnt == 0: #素数の場合 (平方根＋1までには割り切れる数がない)
        ans = 1
else:
        ans = cnt
        
print(ans)

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())
L = factorization(N)
res = 0
for l in L:
    a = int(l[1])
    count = 1
    while True:
        if a >= count:
            a -= count
            res += 1
            count += 1
        else:
            break
print(res)

Submission status: Wrong Answer

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

"""
z = p^e where p is a prime number and e = positive int
z divides N
"""

def get_primes(up_to=1000):
    primes = []

    A = [True] * (up_to + 2)

    for i in range(2, int(up_to**0.5)+1):
        if A[i]:
            j = i*2
            while j < up_to:
                A[j] = False
                j += i
    
    i = 2

    while i < up_to:
        if A[i]:
            primes.append(i)
        i += 1

    return primes

from math import sqrt

n = int(input())
used = set()
primes = get_primes(int(sqrt(n))+2)
ze = []
for z in primes:
    i = 1
    zval = z**i
    while zval <= n:
        ze.append(zval)
        i += 1
        zval = z**i

ze.sort()

count = 0
#print(primes)
for z in ze:
    if z > n:
        break

    if n % z == 0 and not(z in used):
        used.add(z)
        count += 1
        n //= z

def is_prime(n):
    if n < 2:
        return False
    elif n == 2 or  n == 3:
        return True

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

if not primes:
    print(0)
elif is_prime(n) and not(n in used):
    print(count +1)
else:
    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
    
a=factorization(int(input()))

b=[1,3,6,10,15,21,28,36]

ans=0

for i in a:
    for j in range(len(b)):
        if i[1]<b[j]:
            ans+=j
            break
    
print(ans)

Submission status: Wrong Answer

Solution code:
import bisect
import math
from typing import Dict, List, NoReturn


def factorize(n: int) -> Dict[int, int]:
    result: Dict[int, int] = {}

    for d in range(2, int(math.sqrt(n)) + 1):
        div_count: int = 0
        while n % d == 0:
            n /= d
            div_count += 1

        result[d] = div_count

        if n == 1:
            break

    return result


def reverse_sum(n: int) -> int:
    sum_of_k: List[int] = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120,
                           136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378,
                           406, 435, 465, 496, 528, 561, 595, 630, 666, 703, 741, 780, 820]

    return bisect.bisect_right(sum_of_k, n)


def main() -> NoReturn:
    n: int = int(input())

    factors: Dict[int, int] = factorize(n)

    answer: int = 0

    for value in factors.values():
        answer += reverse_sum(value)

    print(answer)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#import sympy
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]
    
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
    
n = int(input())
a_list = []
count = 0

while(n > 1):
  a = make_divisors(n)
  #print(a)
  for i in range(len(a)):
      if n == 1:
        break
      b = a[i]
      b_list = make_divisors(a[i])
      flag = 0
      for j in range(len(b_list)):
        if is_prime(b_list[j]):
          flag = 1
          break
      #print(b, b_list, flag)
      if flag and a[i] not in a_list:
          #print("a[i]2 :", a[i])
          n /= a[i]
          #print("n:", n)
          a_list.append(a[i])
          #print("a[i]:", a[i])
          count += 1
          break
      if n == 1:
          break
print(count)

Submission status: Wrong Answer

Solution code:
# abc169_d.py

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())
lis = factorization(N)
ans = 0
# print(lis)
for i in lis:
    cnt = 1
    target = i[1]
    while target>0:
        if target - cnt >= 0:
            ans += 1
        target -= cnt
        cnt+=1
print(ans)

Submission status: Wrong Answer

Solution code:
import math

n=int(input())
if n==1:
    print(0)
    exit()
ans=0
for i in range(2,int(math.sqrt(n))+1):
    if n%i==0:
        x=i#xは素数
        s=1
        while n>1:
            #print(n,s)
            if n%(x**s)==0:
                n=n//x**s
                s+=1
                ans+=1
            else:
                break
    if n==1:
        break
if ans==0:
    print(1)
else:
    print(ans)

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:
    ans = 1
else:
    ans = sum([e[1] // 2 + (1 if e[1] % 2 > 0 else 0) for e in factorization(n)])

print(ans)

Submission status: Wrong Answer

Solution code:
def fact(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 = []
l = fact(n)
for i in l:
    a = i[0]
    b = i[1]
    up = 1
    if b > 2:
        for i in range(1,b+1):
            if up <= b:
                ans.append(a**i)
                up += i
            else:
                break
    else:
        ans.append(a)
        
ans = sorted(ans)
cnt = 0
for i in ans:
    if n == 1 or n < i:
        break
    else:
        n //= i
        cnt += 1
print(cnt)

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

arr2=[]
arr2=factorization(n)

def cnt(nn):
    if nn<3:
        return 1
    elif nn<6:
        return 2
    elif nn<10:
        return 3
    elif nn<=15:
        return 4
    elif nn<=21:
        return 5
    elif nn<=28:
        return 6
    elif nn<=36:
        return 7
    elif nn<=45:
        return 8
    elif nn<=55:
        return 9
    else:
        return 10
icnt=0
for i in range(len(arr2)):
    icnt=icnt+cnt(arr2[i][1])

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

Submission status: Wrong Answer

Solution code:
def create_divisors(n):
  """
  自然数nの全ての約数を列挙したリストを作成する。

  Parameters
  ----------
  n : int
    自然数

  Returns
  -------
    divisors：list

  """
  divisors=[]
  for i in range(1,int(n**0.5)+1):
    if n%i==0:
      divisors.append(i)
      if i!=n//i:
        divisors.append(n//i)
  divisors.sort()
  return divisors
def factorization(n):
    """
    引数の値を素因数分解したリストを返す

    Parameters
    ----------
    n : int
        素因数分解したい自然数

    Returns
    -------
    retlist : list
        2以上の整数n => [[素因数, 指数], ...]の2次元リスト
    """
    retlist = []
    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
            retlist.append([i, cnt])

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

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

    return retlist
def isPrime(x):
  """
  xが素数か否か判定する。

  Parameters
  ----------
  x: int
      自然数

  Returns
  -------
      True:素数
      False:素数ではない
  """
  if x<2:
    return False
  for i in range(2,int(x**0.5)+1):
    if x%i==0:
      return False
  return True

n=int(input())
d=factorization(n)
# print(d)
p=[]
for i in range(len(d)):
  if isPrime(d[i][0]):
    p.append(d[i]) 

w=[int(i)  for i in range(1,100001)]
from itertools import accumulate
from bisect import bisect_left
s=list(accumulate(w))
ans=0
for i in range(len(p)):
  idx=bisect_left(s,p[i][1])
  ans+=idx+1
  if p[i][1]-s[i-1]>1 and p[i][1]>1:
    ans-=1
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

A = prime_factorize(int(input()))+[4]

for a in A:
  if A.count(a)==1:
    pass
  else:
    A.append(a**2)
    A.remove(a)
    A.remove(a)

print(len(A))

Submission status: Wrong Answer

Solution code:
# Contest No.: ABC169
# Problem No.: D
# Solver:      JEMINI
# Date:        20200531

import sys
import heapq

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

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
from math import sqrt as sq
n=int(input())
s=set()
div=2
while n>1:
  comp=int(sq(n))
  if n%div:
    if div>comp:
      s.add(n)
      break
    div+=1
  elif div in s:
    div+=1
  else:
    s.add(div)
    n//=div
    div=2
print(len(s))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
M = N
count = 0
for i in range(2, N):
	if M % i == 0:
		M = M/i
		count +=1
		if i > math.sqrt(M):
			break
	if count == 0 and i > math.sqrt(M):
		count = 1
		break

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

a=factorization(n)

l=len(a)
ans=l
c=1
for i in range(l):
    a[i][1]-=1

while(c<100):
    c+=1
    for i in range(l):
        if a[i][1]>=c:
            a[i][1]-=c
            ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

cnt = 0
start = 2
z = 1

#nの素数判定
def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

    
if is_prime(N) == False:
    while N != 1:
        for i in range(start, N+1):
            if N % i == 0:
                z = i
                start = i+1
                break
        cnt += 1
        N = N // z
        if z == N:
            break
        # print(z, N, start)
    print(cnt)

# 素数の時は必ず1
else:
    print(1)

Submission status: Wrong Answer

Solution code:
n = int(input())
counter = 0

prime = False

for j in range(int(n**0.5)):
  if(n%(j+2) == 0):
    break
else:
  prime = True
    
if(n == 1):
  counter = 0
  
elif(prime):
  counter = 1
  
else:
  i = 2
  while(i <= n):
    if(n%i == 0):
      n = n/i
      counter = counter + 1
    i = i + 1

print(counter)