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

n = N
memo = []
cnt = 0
a = int(N**0.5)
flg = True

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

for i in range(2,a+1):
    if i in memo:
        continue
    if N % i == 0:
        flg = False
        memo.append(i)
        n = N // i
        cnt += 1
    N = n    
print(1 if flg else cnt)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
@author: H_Hoshigi
"""
import math

def main():
    N = int(input())
    # Nが1のときは答えは0
    if N == 1:
        return 0
    else:
        N_remein = N
        # Nを素因数分解する。
        p_list = []
        p_factor_list = []
        p = 2
        while N_remein >= 2:
        #for p in range(2, math.ceil(math.sqrt(N))+1):
            if N_remein%p == 0:
                counter = 0
                #p_pow_counter = 1
                while True:
                    #p_pow_counter *= p
                    if N_remein%p == 0:
                        N_remein = N_remein//p
                        counter+=1
                    else:
                        p_list.append(p)
                        p_factor_list.append(counter)
                        break
            if p > math.ceil(math.sqrt(N)):
                break
            p += 1
        #print(p_list)
        #print(p_factor_list)
        # Nが素数の場合は、答えは1。
        if not p_factor_list:
            return 1
        else:
            answer = 0
            # 各素因数の指数に対して、、
            # 1,2,3,...と正整数を順番に引いていき、
            # 引けた回数を合計する。
            for factor in p_factor_list:
                counter = 1
                while (counter*(counter+1))//2 <= factor:
                    counter += 1
                answer += (counter-1) 
            #return answer, p_list, p_factor_list
            return answer

if __name__ == "__main__":
    print(main())
    #for i in range(1, 100):
    #    print(i, main(test, i))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
L = N
if L == 1:
    print(0)
else:
    num = 0
    if L > 100:
        limit = int(math.sqrt(L)) + 2
    else:
        limit = L
    for i in range(2, limit):
        if N % i == 0:
            N = N / i
            num = num + 1

    if num == 0:
        print(1)
    else:
        print(num)

Submission status: Wrong Answer

Solution code:
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]
import sys
N=int(input())
if(N==1):
  print(0)
  sys.exit()
div = make_divisors(N)
div.remove(1)
ans=0
for i in div:
  if(N%i==0):
    N=N/i
    ans+=1
  if(N==1):
    print(ans)
    sys.exit()

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
re = 0
if n == 1:
    print(0)
else:
    li = []
    for i in range(2, int(math.sqrt(n))+1):
        i2 = 1
        while n % (i**i2) == 0:
            if (i**i2) not in li:
                re += 1
                n = n/(i**i2)
                li.append(i**i2)
            i += 1
            # print(i**i2)
    if re == 0:
        print(1)
    else:
        print(re)

Submission status: Wrong Answer

Solution code:
import sys
n=int(input())

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

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

if n == orgn:
    print(1)

if n > int(n ** 0.5):
        counter+=1
print(counter)

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
elif N != 1:
    factor[N] += 1

print(factor)

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:
import copy
from collections import defaultdict
N = int(input())
tmp = copy.copy(N)
d = defaultdict(int)
for i in range(2,int(N**0.5)+3):
    while N%i==0:
        N //= i
        d[i] += 1
if N%tmp==0:
    print(1)
    exit()
ans = 0
for i in d.values():
    tmp = 1
    while i - tmp >= 0:
        i -= tmp
        tmp += 1
        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:
from numba import jit
import math


@jit
def solve(N):
    cnt = 0
    for i in range(2, math.sqrt(N) + 1):
        if N % i == 0:
            N = N // i
            cnt += 1
        else:
            continue
    return cnt


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

    if N == 1:
        print(0)
        return
    if N % 2 != 0:
        print(1)
        return

    print(solve(N))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
i=2
A=N
app=0
for i in range(2, int(N**(1/2)+1)+1):
    suma=0
    while A%i==0:
        A=A/i
        suma+=1
    if suma>0:
        n=(-1+(1+8*suma)**(1/2))/2
        n=math.floor(n)
        n=int(n)
        app=app+n
    suma=0
print(app)

Submission status: Wrong Answer

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

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

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

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

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

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

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

#

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

Yes = 'Yes'
No = 'No'


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





main()

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(1000)
P += seachPrimeNum3(10000)
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:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

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

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

    return arr

n=int(input())
if n==1:
    print(0)
ans=0
t=factorization(n)
tmp=[]
for i in range(len(t)):
    if t[i][1]%2==0:
        if t[i][1]==2:
            tmp.append(t[i][0])
        ans+=t[i][1]//2
    else:
        ans+=(t[i][1]+1)//2

print(ans+len(tmp)//2)

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:
            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:
N = int(input())
if N == 1:
  print(0)
  exit(0)
import math
import numpy as np
def seachPrimeNum(N):
  max = int(np.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum

primenumbers=seachPrimeNum(100000)
primenumbers.append(N)
cnts=[0] * 4
ans=0
for i in range(len(primenumbers)):
  for j in range(len(cnts)):
    cnt = j+1
    data = primenumbers[i]**cnt
    if N % data == 0:
      ans += 1
      N = N // data
print(ans)

Submission status: Wrong Answer

Solution code:
def divisor(n):
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table

def is_prime(n):
    for i in range(2, n + 1):
        if i * i > n:
            break
        if n % i == 0:
            return False
    return n != 1

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

n = int(input())
a = divisor(n)

s = n
cnt = 0

if is_prime(n) == True:
    print("1")
    exit(0)
if n == 1:
    print("0")
    exit(0)

for i in range(1,len(a)):
    if is_prime(a[i]) == True or len(set(prime_decomposition(a[i]))) == 1:
        if s % a[i] == 0:
            s = s/a[i]
            cnt += 1
    if s == 1:
        print(cnt)
        exit(0)

print(cnt)

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
                j +=1
        
        print(count)

Submission status: Wrong Answer

Solution code:
import math 

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

factorization(24) 
if __name__ == "__main__":
    s = int(input())
    a = factorization(s) #行列
    print(a)
    if a[0][0] == 1:
        print(0)
    else:
        an = 0
        for list1 in a: #[3,6]の形
            z = 0
            check = 0
            count = list1[1]
            while True:
                z += 1
                count -= z
                if count < 0:
                    break
                check += 1
            an += check
        print(an)

Submission status: Wrong Answer

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

arr = factorization(n) 
#print(arr)
ans = 0

tosa = [0 for _ in range(1000)]
for i in range(1000):
    tosa[i] = int(i*(i+1)/2)

#print(tosa)
for s in arr:
    if(s[0] == 1):
        continue
    num = s[1]
    cnt = bisect.bisect_right(tosa, num) - 1
    print(cnt)
    ans += cnt

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
from copy import deepcopy
from collections import deque
from math import floor

def main():
    n = int(input())
    on = n
    def is_prime(n):
        for i in range(2, n + 1):
            if i * i > n:
                break
            if n % i == 0:
                return False
        return n != 1
    if is_prime(n):
        print(1)
        sys.exit()

    nn = floor(n**0.5)
    nn = max(6, nn)
    p = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(nn + 1)]
    p[0] = p[1] = False
    p[2] = p[3] = p[5] = True
    for i1 in range(7, floor(nn ** 0.5) + 1, 2):
        if p[i1]:
            for i2 in range(i1 ** 2, nn + 1, i1):
                p[i2] = False
        else:
            continue
    pl = [i for i, b in enumerate(p) if b == True]

    nums = deepcopy(pl)
    for pe in pl:
        cnt = 2
        while True:
            tnum = pow(pe, cnt)
            if tnum > n:
                break
            elif tnum != 0:
                if n % tnum == 0:
                    nums.append(tnum)
            cnt += 1
    nums.sort()
    numsd = deque(nums)

    r = 0
    while True:
        if not numsd:
            break
        if n == 1:
            break
        nextn = numsd.popleft()
        if nextn > on:
            continue
        elif n % nextn == 0:
            n = int(n / nextn)
            r += 1
    print(r)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

import sys
from collections import defaultdict

sys.setrecursionlimit(10 ** 7)
# ----------

INF = float("inf")
MOD = 10 ** 9 + 7
# ----------

def P(n):
    # n=0 のときは初期値として空のリストを返す。
    if n == 0:
        yield []
        return

    for p in P(n-1):
        p.append(1)
        yield p
        p.pop()
        if p:
            p[-1] += 1
            yield p

N = int(input())

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

e = defaultdict(int)
for i in range(2, int(N ** 0.5) + 1):
    while N % i == 0:
        e[i] += 1
        N //= i

if len(e) == 0:
    print(1)
    exit()

ans = 0
for k, v in e.items():
    p = P(v)
    tmp = 0
    for p in P(v):
        if len(p) == len(set(p)):
            tmp = max(tmp, len(p))
    ans += tmp
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

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


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


def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a


if n==1:
    print(1)
else:
    div = []
    count = 0
    fct = factorize(n)
    div += [num(div) for div in divisorize(fct)]
    div = sorted(div)
    #div = div
    for i in div[1:]:
        if n%i==0:
            n = n/i
            count += 1
        if n==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


num=factorization(n)

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


co=0
for i in num:
    cou=0
    con=1
    for j in range(i[1]):
        cou+=1*con
        con+=1
        if(i[1]>=cou):
            n/=i[0]*cou

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

    co+=a
"""

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

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

def printlist(lst, k='\n'): print(k.join(list(map(str, lst))))
INF = float('inf')

from math import ceil, floor, log2
from collections import deque
from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product
from heapq import heapify, heappop, heappush


def solve():
    n = II()
    num = n
    memo = {}
    tui = 1
    s = 2
    ans = 0
    if n == 1:
        print(ans)
        return

    while 1:
    # for _ in range(100):
        pre = num
        for i in range(s, int(pow(num, 0.5)) + 1):
            if num % i: continue
            if memo.get(i, 1):
                num //= i
                memo[i] = 0
                s = i
                ans += 1
        if pre == num:
            break
    if num == 1:
        print(ans)
    else:
        cd = []
        for i in range(1, int(pow(num, 0.5)) + 1):
            if num % i: continue
            if i != 1:
                cd.append(i)
            cd.append(num // i)
        # print(cd)
        cd = sorted(cd)
        for d in cd:
            if memo.get(d, 1):
                num //= d
                memo[d] = 0
                ans += 1
            if num == 1:
                break
        print(ans)



if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
N = int(input())
n = (N**(1/2))//1
i = 2
c = 0
T=[]
while i <= n and N !=1:
  if N%i ==0:
    T.append(i)
    N = int(N/i)
  i += 1

if N in T :
  print(len(T))
elif N != 1:
  print(len(T)+1)
else:
  print(len(T))

Submission status: Wrong Answer

Solution code:
from math import sqrt, ceil

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
search_list = list(range(2, int(sqrt(N))+10))
if (N > 1) and (N not in search_list):
    search_list.append(N)

for i in search_list:
    if N%i == 0:
        fact = factorization(i)
        if len(fact) == 1:
            N = N // i
            if N >= 1:
                ans += 1
            else:
                break

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

A=factorization(N)

numlist=range(2,50)

ans=0
sinsa=1
for i in range(len(A)):
    N=N/A[i][0]
    ans+=1
    beki=A[i][1]
    sinsa=sinsa+numlist[i]
    if sinsa>beki:
        continue
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
n = round(N ** 0.5)
Z = N
cnt = 0
for i in range(2,n+1):
    if Z == 1:
        break
    if Z % i == 0:
        Z = Z // i
        cnt += 1
if cnt == 0 and Z > 1:
    cnt = 1

print(cnt)

Submission status: Wrong Answer

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

b=[2,3,4,5,7,8,9,11,13,16,17,19,23,25,27,29,31,32,37,39,41,43,47,49,53,57,59,61,64,67,71,73,79,81,83,89]

#b=[2,3,4,5,7,8,9,11,13,16,17,19,23]

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

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

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

Submission status: Wrong Answer

Solution code:
import math
import sys

n = int(input())
org_n = n

array = [True] * (math.ceil(math.sqrt(n))+2)
                  
for i in range(2,len(array)):
  if not array[i]:
    continue
    
  for j in range(i*2,len(array), i):
    array[j] = False
    
sosu = []
sosu_flag = True
for i in range(2,len(array)):
  if array[i]:
    if n % i ==0:
      sosu_flag =False
      
    sosu.append(i)
    
if n == 1:
  print(0)
  sys.exit()

if sosu_flag:
  print(1)
  sys.exit()
  
count = 0
for i in range(len(sosu)):
  j = 1
  while (n % (sosu[i]**j) == 0) and n != 1:
    n //= (sosu[i]**j)
    count += 1
    j += 1
    
  if n == 1:
    break

if org_n == 1:
  count = 0
    
print(count)

Submission status: Wrong Answer

Solution code:
import collections
def prime_factorize(n):
    a = []
    i=1
    j=1
    while n % 2**i == 0 and a.count(2**i)==0:
        a.append(2**i)
        n //= 2**i
        i+=1
        
    f = 3
    while f * f <= n:
        if n % f**j == 0 and a.count(f**j)==0:
            a.append(f**j)
            n //= f**j
            j+=1
           
        else:
            f += 2
            j=1
    if n != 1:
        a.append(n)
    return a
N = int(input())
c = prime_factorize(N)

c=set(c)

print(len(c))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

cnt = 0
z = 2
while True:
    if n % z == 0:
        n = n //z
        cnt += 1
        z += 1
    else:
        z += 1
    #print("n.cnt",n,cnt)
    if n == 1 or is_prime(n) == True:
        if z == 3:
            cnt = 1
        print(cnt)
        exit()

Submission status: Wrong Answer

Solution code:
from math import floor, sqrt


def func(x):
    return floor((sqrt(1 + 8 * x) - 1) / 2)


N = int(input())
limit = floor(sqrt(N))

primes = [2]

count = 0
flag = True
p = 2
while 1:
    print(p,N)
    isprime = True
    if N == 1:
        break
    if p > sqrt(N):
        count += 1
        break
    if p > 3:
        for i in primes:
            if i >= sqrt(p):
                break
            if p % i == 0:
                isprime = False
                break
        if not isprime:
            p += 2
            continue
        primes.append(p)
    a = 0
    while N % p == 0:
        print("while",p, a)
        a += 1
        N = N // p
    count += func(a)
    p += 2
print(count)

Submission status: Wrong Answer

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


def main():
    m = 10 ** 12
    limit = int(m ** 0.5 // 1)
    prime_list = primes(limit+10000)
    for i in range(len(prime_list)):
        n = prime_list[i]
        tmp = n ** 2
        while tmp <= limit:
            if not tmp in prime_list:
                prime_list.append(tmp)
                tmp *= n

    sorted(prime_list)

    N = int(input())

    tmp_n = N
    ans = 0

    for i in prime_list:
        if tmp_n % i == 0:
            ans+=1
            tmp_n /= i
    if ans == 0 and N != 1:
        ans += 1
    print(ans)


if __name__ == '__main__':
    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

A = prime_factorize(int(input()))

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:
#-------------------------------------------------------------------
import sys
def p(*_a):
  _s=" ".join(map(str,_a))
  #print(_s)
  sys.stderr.write(_s+"\n")
#-------------------------------------------------------------------
import math

def factorize(n):
  ret, a = [], n
  for i in range(2, int(n**0.5)+1):
    if a%i>0: continue
    c=0
    while a%i==0:
      a//=i
      c+=1
    else:
      ret.append((i,c))
  if a!=1: ret.append((a,1))
  return ret



n = int(input())
N = factorize(n)

i = 2
ans=0
while n >= i:
  if n % i ==0:
    for k,_ in N:
      a = math.log(i, k)
      #p("n,i,k,a,int(a)=",n,i,k,int(a),a)
      if int(a)==a:
        n /= k
        ans += 1
        #p("ans=",ans)
        continue

  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


bunkai = factorization(N)
count = 0

prime_flag = False
for x in bunkai:
    if x[0] == 1:
        prime_flag = True
        break
    else:
        check = x[1]
        current = 1
        while True:
            check -= current
            if check > 1:
                current += 1
            else:
                break
        count += current
if prime_flag:
    print(0)
else:
    print(count)

Submission status: Wrong Answer

Solution code:
import collections


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

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

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

    return arr


def solve():
    N = int(input())
    D = factorization(N)
    R = primes()

    result = 0
    for d in D:
        result += R[d[1]]

    return result


def primes():
    R = [0 for i in range(41)]
    for i in range(40, 0, -1):
        tmp_R = R[:]
        for j in range(i, 41):
            tmp_R[j] = max(R[j], R[j - i] + 1)
        R = tmp_R

    return R


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