Problem:


Score : 400 points

Problem Statement

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

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

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

z divides N;

z is different from all integers chosen in previous operations.

Then, replace N with N/z.

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

Constraints

All values in input are integers.

1 \leq N \leq 10^{12}

Input

Input is given from Standard Input in the following format:

N

Output

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

Sample Input 1

24

Sample Output 1

3

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

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

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

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

Sample Input 2

1

Sample Output 2

0

We cannot apply the operation at all.

Sample Input 3

64

Sample Output 3

3

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

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

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

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

Sample Input 4

1000000007

Sample Output 4

1

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

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

Sample Input 5

997764507000

Sample Output 5

7



Sample input:
24


Sample output:
3

Submission status: Wrong Answer

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

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

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

    return arr

N = int(input())
lis = factorization(N)
i = 0
sum = 0
while i < len(lis):
  sum += lis[i][1]
  i += 1
  
print(sum)

Submission status: Wrong Answer

Solution code:
def pri_me(x):
    if x == 2:
        return True
    for i in range(2,int(x**0.5)+1):
        if x%i==0:
            return False
    return True
#print(pri_me(n))


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())
if n==1 or n == 0:
    print(0)
    exit()
if pri_me(n):
    print(1)
    exit()
N = n
ans = 0
for i in range(2,N+1):
    if n%i==0: 
        n=n//i
        ans += 1
    if n <=i:
        break
        #print(n,i)
        #print(len(set(prime_factorize(i)))
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

def get_primenumber(N):
    prime_list = [2]
    for num in range(3,N+1,2):
      if all( num % prime != 0 for prime in prime_list):
        prime_list.append(num)

    return prime_list

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

pri = get_primenumber(40000)
l = []
for z in make_divisors(n):
  if n == 1:
    break
  if n == z:
    l.append(z)
    break
  for i in pri:
    for e in range(1,100):
      if z < i**e:
        break
      if z == i**e:
        if n%z == 0:
          l.append(z)
          n = int(n/z)
          if n == 1:
            print(l)
            exit()
        
print(len(l))

Submission status: Wrong Answer

Solution code:
from collections import Counter

def Eratosthenes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n ** 0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

n = int(input())
n2 = n

if n < 2:
    print(0)
    exit()

prime_factors = [] #素因数
for i in Eratosthenes(int(n ** 0.5)):
    if i**2 > n2:
        break
    while n2 % i == 0:
        prime_factors.append(i)
        n2 //= i
if n2 > 1:
    prime_factors.append(n2)

ans = []
list = []
for i in prime_factors:
    for j in list:
        if j % i == 0:
            tmp = list.pop(list.index(j)) * i
            if tmp in ans:
                list.append(tmp)
                continue
            ans.append(tmp)
    if i in list:
        tmp = list.pop(list.index(i)) * i
        if tmp in ans:
            list.append(tmp)
            continue
        ans.append(tmp)
    elif i in ans:
        list.append(i)
    else:
        ans.append(i)

print(len(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
n = N
count=0
if N == 1:
    print("0")
elif N == 2 or N == 3:
    print("1")
else:
    for i in range(2,n):
        if i*i > n:
            # N が素数か判定
            for k in range(2,int(N)):
                if k*k > N:
                    count += 1
                    break
                else:
                    if N % k == 0:
                        break
            break
            
        else:
            for j in range(1,10):
                if N % (i**j) == 0:
                    count += 1
                    N = int(N / (i**j))
                else:
                    break
    print(count)

Submission status: Wrong Answer

Solution code:
import math
import numpy as np
def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True
def primes(n):
    ass = []
    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
    for i in range(len(is_prime)):
        if is_prime[i]:
            ass.append(i)
    return ass
primelist=set(primes(10**6))

N=int(input())
if N==1:
    print(0)
    exit()
if is_prime(N):
    print(1)
    exit()
N_SQ=math.sqrt(N)
target=N
ans=0
last=0
sum=1
for i in range(2,int(N_SQ)+1):
    if target%i==0:
        for j in primelist:
            if j**math.log(i, j) == i:
                ans+=1
                target/=i
                last=i
                break
if target!=1 and target!=last and N%target==0:
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
def main():
  n = int(input())
  if n == 1:
    return 0
  index = []
  no = []
  i = 1
  result = 0
  while n > 1 and i ** 2 < n:
    i += 1
    if n % i == 0:
      n /= i
      cnt = 1
      while n % i == 0:
        n /= i
        cnt += 1
      index.append(cnt)
  else:
    return 1
  for j in index:
    result += (j + 1) // 2
  return result

print(main())

Submission status: Wrong Answer

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

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

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

    return tmp

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

    return total


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

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

Submission status: Wrong Answer

Solution code:
def resolve():
    import math

    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())
    p = prime_factorize(n)
    if len(p) == 0:
        print(0)
        return
    print(int(math.log2(len(p))) + 1)

resolve()

Submission status: Wrong Answer

Solution code:
N = int(input())

import math

def sieve_of_eratosthenes(n):
    candidate = [i for i in range(2, n+1)]
    prime = []
    limit = math.sqrt(n) + 1

    while True:
        p = min(candidate)
        if limit <= p:
            prime.extend(candidate)
            break
        prime.append(p)

        candidate = [i for i in candidate if i % p != 0]

    return prime


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

rn = math.ceil(math.sqrt(N))
L = sieve_of_eratosthenes(rn)

n = N
c = 0
used = {}

for l in L:
    if n % l == 0:
        i = 1
        l2 = l
        while n % l2 == 0:
            c += 1
            i += 1
            used[l2] = True
            n = n // l2
            l2 = l ** i

if c == 0:
    print(1)
else:
    if n != 1:
        # x = sieve_of_eratosthenes(n)
        if n not in used:
            c += 1
    print(c)

Submission status: Wrong Answer

Solution code:
n = int(input())

repeat = [1]*9
for i in range(1,10):
    repeat[i-1] = i*(i+1)//2

d = 1
ans = 0
judge = False
if n < 10**6 +1: 
    while n != 1:
        d += 1
        count = 0
        if n%d == 0:
            judge = True
            j = -1
        while n%d == 0:
            n = n//d
            count += 1
        while judge:
            j += 1
            if count < repeat[j]:
                ans += j
                judge = False
else:
    ans = 1

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""
if n==1:
    print(0)
    exit(0)
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)

n = len(a)

arr1=[1,2]
arr2=[3,4,5]
arr3=[6,7,8,9]
arr4=[10,11,12,13]
arr5=[14,15,16,17,18]
arr6=[19,20,21,22,23,24]
arr7=[25,26,27,28,29,30,31]
arr8=[32,33,34,35,36,37,38,39]
arr8=[40,41,42,43,44,45,46,47,48]
arr9=[49,50,51,52,53,54,55,56,57,58]
arr10=[59,60,61,62,63,64,65,66,67,68,69]


cnt =0
for i in range(n):
    if a[i][1] in arr1:
        cnt+=1
    elif a[i][1] in arr2:
        cnt+=2
    elif a[i][1] in arr3:
        cnt+=3
    elif a[i][1] in arr4:
        cnt+=4
    elif a[i][1] in arr5:
        cnt+=5
    elif a[i][1] in arr6:
        cnt+=6
    elif a[i][1] in arr7:
        cnt+=7
    elif a[i][1] in arr8:
        cnt+=8
    elif a[i][1] in arr9:
        cnt+=9
    elif a[i][1] in arr10:
        cnt+=10
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

A = prime_factorize(N)
B = list(set(A))
lb = len(B)
C = [[] for _ in range(lb)]
D = [0 for _ in range(lb)]
for i in range(lb):
  C[i] = [a for a in A if a == B[i]]
  D[i] = len(C[i])
ans = []
for j in range(len(D)):
  for i in range(1,D[j]):
    if D[j] - i < 0:
      break
    ans.append(D[j] - i)
print(A)
print(D)
print(ans)
if len(D) == 0 and len(ans) == 0:
  print(0)
elif len(D) == 1 and len(ans) == 0:
  print(1)
else:
  print(sum(ans))

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

hist = set()
counter = 0

while True:
    for i in range(1, int(math.sqrt(N)+1)):
        
        # check
        chk = False
        for j in range(1, int(math.log10(N)+1)):
            if N % (i**j) == 0:
                chk = True
        if not chk:
            continue
        if i**j in hist:
            continue
    
        # saiyou
        hist.add(i**j)
        N /= (i**j)
            
        counter += 1

    #if N <= max(hist)-1:
    #    break
    break

print(counter)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math


n = int(input())
cnt_list = [1,3,6,10,15,21,28,36]

def get_cnt(i):
    loop_cnt = min([int(math.sqrt(i)) + 10, i])
    ret = 0
    j = 2
    cnt = 0
    while j <= loop_cnt:
        if i % j == 0:
            i /= j
            cnt += 1
        else:
            if cnt > 0:
                for k in range(8):
                    if cnt < cnt_list[k]:
                        ret += k
                        break
                cnt = 0
            j += 1
    if i != 1:
        ret += 1
    return ret

print(get_cnt(n))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
count = 0
li = [0 for i in range(int(math.sqrt(N))+1)]
for i in range(2, int(math.sqrt(N))+1):
    #print(li)
    if i > N:
        break
    if li[i] !=-1:

        if N % i == 0:
            count += 1
            num =i
            N = N // i
            while(1):
                li[num] = 1
                num *= i
                if num > len(li):
                    break
        num = i
        while(1):
            #print(num)
            if li[num] == 0:
                li[num] = -1
            num += num
            if num >= len(li):
                break
#print(N)
if N != 1 and count == 0:
    flag = 1
    for i in range(2, int(math.sqrt(N)+1)):
        if N % i == 0:
            flag = 0
            break
    if flag == 1:
        count += 1
print(count)

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,6):
      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)
P2 = seachPrimeNum3(1000)
P = P+P2+seachPrimeNum4(1000000)
P.sort()
P = set(P)
N = int(input())
ans = 0
for p in list(P):
  if N%p == 0:
    ans += 1
    N = N//p
  if N == 1:
    print(ans)
    exit()
if ans == 0:
  print(1)
  exit()
print(ans+1)

Submission status: Wrong Answer

Solution code:
import itertools
import copy

N = int(input())
# N = (2 ** 4) * (3 ** 5) * (5 ** 2) * (7 ** 5)

# 素因数分解
# 戻り値: リスト
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

pf = prime_factor(N)
if len(pf) == 0:
    print(0)
    exit()

d = {}
for i in pf:
    if i not in d:
        d[i] = 1
        continue
    d[i] += 1

exist_num = []
ans = 0
for k in d.keys():
    for c in range(1, 100):
        if d[k] >= c:
            exist_num.append(k ** c)
            ans += 1
            d[k] -= c

l = []
for k in d.keys():
    if d[k] > 0:
        for _ in range(d[k]):
            l.append(k)
for i in range(1, len(l)+1):
    combs = list(itertools.combinations(l, i))
    if len(combs) > 0:
        for comb in combs:
            d_tmp = copy.copy(d)
            if max(d_tmp) not in comb:
                continue
            n = 1
            for j in comb:
                d_tmp[j] -= 1
                if d_tmp[j] < 0:
                    break
                n *= j
            if n not in exist_num and n != 1:
                print(n)
                ans += 1
                d = copy.copy(d_tmp)
                exist_num.append(n)
print(ans)

Submission status: Wrong Answer

Solution code:
import math as mp
N = int(input())
count=0
for i in range(2, int(mp.sqrt(N))+1):
    q, mod = divmod(N,i)
    if mod ==0:
        count = count+1
        N = q

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

Submission status: Wrong Answer

Solution code:
import math

#nの素因数分解(O(n**0.5)
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


N = int(input())
if N == 1:
    print(0)
    exit()
orig = N
num = sorted(prime_factor(N))
count = 0
base = 0
for i in num:
    num = i
    if base ==num:
        pass
    base = i

    for j in range(math.floor(math.log(N,i))):
        if N % num == 0:

            N = N//num
            num*= base
            count += 1
        else:
            break


print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
pf = {}
for i in range(2, int(N**0.5) + 1):
    while N % i == 0:
        pf[i] = pf.get(i, 0) + 1
        N //= i
if N > 1:
    pf[N] = pf.get(N, 0) + 1

ans = 0
for i in pf.values():
    if i < 3:
        ans += 1
    elif i < 6:
        ans += 2
    elif i < 10:
        ans += 3
    elif i < 15:
        ans += 4
    elif i < 21:
        ans += 5
    elif i < 28:
        ans += 6
    elif i < 35:
        ans += 7
    elif i < 44:
        ans += 8
    elif i < 54:
        ans += 9
print(ans)

Submission status: Wrong Answer

Solution code:
import math
import sys
n=int(input())
i=0
l=list()
n2=n
while True:
        i=i+1
        n1=n2/(2**i)
        if n1-math.floor(n1)>0:
            l.append(i-1)
            break
        n2=n1
for p in range (3,(10**6)-1,2): 
    i=0
    while True:
        i=i+1
        n1=n2/(p**i)
        if n1-math.floor(n1)>0:
            l.append(i-1)
            while True:
                if n2/p-math.floor(n2/p)>0:
                    break
                else:
                    n2=n2/p
            break
        n2=n1
    if n2<p:
        break
if n2>p:
    print(1)
else:
    print(sum(l))

Submission status: Wrong Answer

Solution code:
from collections import Counter

def 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())
arr = dict(Counter(factorize(N)))
ans = 0
for v, c in arr.items():
    if c > 2:
        i = 2
        while c > i:
            i += i
            ans += 1
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
Nk=N
rootN=int(N**0.5)
p=[1]*(rootN+1)
p[0]=0
p[1]=0
for i in range(2,rootN+1):
    for j in range(i*2,rootN,i):
        p[j]=0
ps=[i for i in range(1,rootN+1) if p[i]==1]
pq=[]
for i in ps:
    d=i
    c=0
    for j in range(1,10):
        if (N/i).is_integer():
            c+=1
            N/=(i)
        else:
            break
        d*=i
    if c!=0:
        pq.append(c)

res=0
for j in pq:
    res+=int(((8*j+1)**0.5-1)/2)


if N > rootN:
    res+=1
if N==Nk:
    res+=1
    
print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())
ar =  set()

def is_prime(q):
    if q == 1:
        return True
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
if N == 1:
    print(0)
    exit()
while N > 0:
    if is_prime(N):
        ar.add(N)
        break
    for i in range(2,(N//2)+2):
        if N%i == 0 and (not i in ar):
            ar.add(i)
            break
    N = N//i
print(len(ar))

Submission status: Wrong Answer

Solution code:
from math import floor, ceil
import decimal


def main():

    N = int(input())
    n = N
    count = 0
    pn = [2]
    A = 10000
    zlist = [1]
    for L in range(3, A):
        chk = True
        for L2 in pn:
            if L % L2 == 0:
                chk = False
        if chk == True:
            pn.append(L)

    for i in pn:
        z = 0
        for j in range(N):
            z = i**j
            if z > n:
                break
            if n % z != 0:
                continue
            else:
                n = n/z
                count += 1
        if n > i:
            break

    print(count)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    cnt = 0
    while n % 2 == 0:
        cnt += 1
        n //= 2
    a.append(cnt)
    f = 3
    cnt = 0
    while f * f <= n:

        if n % f == 0:
            cnt += 1
            n //= f
        else:
            f += 2
            a.append(cnt)
            cnt = 0

    if n != 1:
        a.append(1)
    return a

n = int(input())
ans = 0
lis = prime_factorize(n)
#print(lis)
if len(lis) == 0:
    print(0)
    exit()
# cnt = 1
# lis2 = []
# val = lis[0]
# for i in range(len(lis)):
#     if i+1< len(lis):
#         if val == lis[i]:
#             cnt += 1
#         elif val != lis[i]:
#             lis2.append(val)
#             cnt = 1
#             val = lis[i]
#     else:
#         if val == lis[i]:
#             cnt += 1
#             lis2.append(cnt)
#         else:
#             lis2.append(val)
#             cnt = 1
#             lis2.append(cnt)
# print(lis2)
for i in range(len(lis)):
    val = 1
    while val <= lis[i]:
        lis[i] -= val
        val += 1
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())

list=[2,3,4,5,7,8,9,11,13,16,17,19,23,25,27,29,31,32,37,41,43,47,49,53,59,61,64,67,71,73,79,81,83,89,97,121,125,128,169,243,256,289,343,361,512,529,625,729,841,961,1024,1331,1369,1681,1849,2048,2187,2197,2209,2401,2809,3125,3481,3721,4096,4489,4913,5041,5329,6241,6561,6859,6889,7921,8192,9409,12167,14641,15625,16384,16807,19683,24389,28561,29791,32768,50653,59049,65536,68921,78125,79507,83521,103823,117649,130321,131072,148877,161051,177147,205379,226981,262144,279841,300763,357911,371293,389017,390625,493039,531441,571787,704969,707281,823543,912673,923521]

Ans=0
now=0

if N==1:
    print(0)
    exit()
else:
    for i in range (117):
        if N%list[now]==0:
            Ans+=1
            N=N/list[now]
            now+=1
        else:
            pass
    else:
        if N==1:
            pass
        else:
            Ans+=1
    print(Ans)

Submission status: Wrong Answer

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

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

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

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

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):
    s = set()
    rest = n
    for i in range(1, n):
        if rest == 0:
            break
        if rest - i in s:
            pass
        else:
            s.add(i)
            rest -= i
    return len(s)

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():
    ans += P(v)
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

a=int(input())
b=factorization(a)
#print(b)
sum=0

for i in b:
    counter=0
    for j in range(1,50):
        #print(1+(j+2)*(j-1)//2)
        if i[1]>=1+(j+2)*(j-1)//2:
            counter=j
        else:
            break
    sum+=counter
print(sum)

Submission status: Wrong Answer

Solution code:
m = int(input())

def prime_factorize(n):
    a = []
    num_factor = 0
    while n % 2 == 0:
        num_factor += 1
        n //= 2
        
    if num_factor > 0:
        a.append(num_factor)
    num_factor = 0
    
    f = 3
    while f * f <= n:
        if n % f == 0:
            num_factor += 1
            n //= f
        else:
            if num_factor > 0:
                a.append(num_factor)
                num_factor = 0
            f += 2
    if n != 1:
        a.append(1)
    return a
 
if not m >= 1:
    print(0)
    
else:
    count = 0
    for i in prime_factorize(m):
        sub_count = int(i ** 0.6) + 2
        while sub_count * (sub_count + 1) > 2 * i:
            sub_count -= 1
        count += sub_count
    print(count)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
z = 1
Nz = N
c = 0
rN = math.sqrt(N)
while Nz > z:
  z = z+1
  if Nz % z == 0:
    Nz = Nz / z
    c = c+1
  if z > rN:
    c = 1
    break
print(c)

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=0
T=factorization(N)
l=len(T)
for i in range(l):
    if T[i][1]<3:
        a+=1

    elif T[i][1]<6:
        a+=2
    elif T[i][1]<10:
        a+=3
    elif T[i][1]<15:
        a+=4
    elif T[i][1]<21:
        a+=5
    elif T[i][1]<28:
        a+=6
    elif T[i][1]<36:
        a+=7
    elif T[i][1]<45:
        a+=8
    elif T[i][1]<55:
        a+=9
    elif T[i][1]<66:
        a+=10
print(a)

Submission status: Wrong Answer

Solution code:
import math

def main():
    N = int(input())
    ans = 0
    used = []

    non = True
    while non:
        if N == 1:
            print(ans)
            exit()

        ok = True
        if used:
            i = max(used) + 1
        else:
            i = 2

        while ok:
            # print('i', i)

            if i > N:
                ok = False
                non = False
                continue

            # 大きい素数用
            if N % 2 != 0 and N % 3 != 0 and N % 5 != 0 and N % 7 != 0:
                sosuu = True
                s = 5
                s2 = s + 2
                if isinstance(math.sqrt(N), float):
                    N = N // N
                    ans += 1
                    used.append(s)
                    sosuu = False
                    ok = False

                while sosuu:
                    print('s', s)
                    if N % s == 0:
                        if s in used:
                            return
                        else:
                            N = N // s
                            ans += 1
                            used.append(s)
                            sosuu = False
                            ok = False

                    if N % s2 == 0:
                        if s2 in used:
                            return
                        else:
                            N = N // s2
                            ans += 1
                            used.append(s2)
                            sosuu = False
                            ok = False
                    s += 6
                    s2 = s + 2

            if N % i == 0:
                if i in used:
                    return
                else:
                    N = N // i
                    ans += 1
                    used.append(i)
                    ok = False

            i += 1


    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
primelist=[2]
if N > 10000000:
    num = int(math.sqrt(N))+1
else:
    num = int(N/2)+1
for i in range(3,num,2):
    if N % i == 0:
        for j in primelist:
            if i % j == 0:
#                 k = 0
                break
        else:
            primelist.append(i)
# print(primelist)
count = 0
for j in primelist:    
    i = j
    while N % i == 0:
        N = N / i
        i *= j
        count += 1
if count == 0 and N != 1:
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
counter = 0
half = n//2 +1
i = 2
while i <= n and i <= half:
  print(i,n)
  if n%i == 0:
    counter += 1
    n = n//i
  i += 1
if counter ==0:
  print(1)
print(counter)

Submission status: Wrong Answer

Solution code:
n =int(input())

wk =0
i =2
j =3
while n >=i:
    if n%i==0:
        wk+=1
        n/=i
        i*=2
    else:
        break
while n >=j:
    if n%j==0:
        wk+=1
        n/=j
        j*=3
    else:
        break
j+=2
while n>=j:
    if n%j==0:
        wk+=1
        n//=j
        j*=j
    else:
        j+=2
if n != 1:
    wk+=1
print(wk)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

A=make_divisors(N)
A.pop(0)
#print(A)

c=0
for i in range(len(A)):
    if N%A[i]==0:
        N = N//A[i]
        c+=1
print(c)

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 = sorted(list(set(table)))
    return table

N = int(input())
ans = -1
for i in divisor(N):
  if N%i == 0:
    N /= i
    ans += 1
  if N < i:
    break
print(ans)