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

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:
import math
n = int(input())

#s = [int(x) for x in input().split()]#yoko
#a = [int(input()) for _ in range(n)]#tate
count = 0

def sosu(n,z):
    for i in range(z, int(math.sqrt(n))+1):
        if n%i == 0:
            return i
            break
    return -1

if sosu(n,2) == -1:
    print(1)
    exit()

ans  = 0
z = 2



def hantei(n):
    i = sosu(n,2)
    s = 0
    if sosu(n,2) == -1:
        return True
    if sosu(n,2) > 0:
        s = n ** (1/i)
        if int(s) == math.floor(s):
            return True
        else:
            return False

memo = []

while(n != 1) :
    ans = sosu(n,z)
    #print(n,ans,z)
    if ans == -1:
        if memo.count(n) == 0 and hantei(n):
            count +=1
            break
        else:
            break

    if hantei(ans) :
        memo.append(ans)
        z = ans+1
        n = n//ans
        count += 1
    else:
        z = ans +1
    #print(count)



print(count)

Submission status: Wrong Answer

Solution code:
def factorization(n):
    temp = n
    coun=0
    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
            for l in range(1,cnt+1):
                cnt-=l
                #print(cnt)
                if cnt<0:
                    pass
                else:
                    coun+=1

    return coun
n =int(input())

print(factorization(n))

Submission status: Wrong Answer

Solution code:
import math

def primefact(n):
	facts = {}
	prime = True
	while n > 1:
		for d in range(2,int(math.sqrt(n))+1):
			while n%d == 0:
				if d in facts:
					facts[d] += 1
				else:
					facts[d] = 1
				n /= d
				prime = False
		if prime:
			facts[n] = 1
			n = 1
		prime = True
	return facts

n = int(input())
count = 0
facts = primefact(n)
#print(facts)
for key,value in facts.items():
	if value < 3:
		count += 1
	elif value < 6:
		count += 2
	elif value < 10:
		count += 3
	elif value < 15:
		count += 4
	elif value < 21:
		count += 5
	elif value < 28:
		count += 6
	else:
		count += 7
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
mem=set([])
def is_prime(x):
    for i in range(2,int(x**.5)+1):
        if x%i == 0:
            return False
    return True

cnt=0
if is_prime(n):
    cnt+=1
    print(cnt)
    exit()

for i in range(2, int(n**.5)+1):
    if not is_prime(i):
        continue
    if n%i==0:
        n//=i
        cnt+=1
        k=2
        while k<10000:
            if n%(i**k)==0:
                n//=(i**k)
                cnt+=1
                k+=1
            else:
                break
print(cnt)

Submission status: Wrong Answer

Solution code:
import itertools
from collections import defaultdict

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[i] = cnt

    if temp!=1:
        arr[temp] = 1

    if arr==[]:
        arr[n] = 1

    return arr

ng = {}
lv = 1
F = factorization(N)

result = 0
remain = 0
check = 1
for k, v in F.items():
    remain += v

while remain > 0:

    # 候補を取得
    f_candidate = []
    for k, v in F.items():
        for i in range(lv):
            f_candidate.append(k)

    candidates = itertools.combinations_with_replacement(f_candidate, lv)
    allNg = True
    for candidate in candidates:
        red_map = defaultdict(int)

        next = False
        value = 1

        for c in candidate:
            value *= c
            red_map[c] += 1
            if red_map[c] > F[c]:
                next = True
                break
        if next:
            continue

        if value in ng:
            continue

        ng[value] = True
        result+=1

        # 減らす
        for c in candidate:
            F[c] -= 1
            remain -= 1
        allNg = False
        break

    if allNg:
        lv+=1
    if lv > remain:
        break

print(result)

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,4*(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 typing import List
import heapq


class Solution:
    def kthSmallest(self, mat: List[List[int]], k: int) -> int:
        tt = set()
        n = len(mat)
        m = len(mat[0])
        tmp = [0] * n
        tt.add(tuple(tmp))
        s = 0
        for x in mat:
            s += x[0]
        h = [(s, tmp)]
        for i in range(1, k):
            t_s, it = heapq.heappop(h)
            for i, x in enumerate(it):
                if x < m - 1:
                    ttt = list(it)
                    ttt[i] = x + 1
                    ttt = tuple(ttt)
                    if ttt in tt:
                        continue
                    else:
                        heapq.heappush(h, (t_s - mat[i][x] + mat[i][x + 1], tuple(ttt)))
                        tt.add(ttt)
        return heapq.heappop(h)[0]



test = Solution()
mat = [[21, 33, 38, 41, 42, 44, 48, 54, 62], [8, 51, 56, 60, 80, 81, 83, 88, 92], [2, 40, 54, 56, 68, 92, 93, 94, 98],
       [28, 35, 41, 52, 55, 59, 62, 70, 99], [2, 16, 25, 30, 32, 38, 54, 73, 92], [1, 11, 14, 35, 35, 55, 59, 66, 66],
       [5, 9, 13, 29, 47, 49, 60, 73, 74], [19, 29, 32, 36, 59, 64, 66, 98, 100]]
print(test.kthSmallest(mat, 29))

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)
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:
s = list(map(int, input().split()))
li = s[0]
counter = 0
if li % 2 == 0:
    counter +=1
    li = li //2
    if li == 1:
        print(counter)
if li % 3 == 0:
    counter +=1
    li = li // 3
    if li == 1:
        print(counter)
if li % 4 ==0:
    counter +=1
    li = li // 4
    if li == 1:
        print(counter)

Submission status: Wrong Answer

Solution code:
def sieve(x):
    """
    Sieve of Eratosthenes
    :param x: max value
    :return: list of bool
    """

    is_prime = [True] * (x + 1)
    is_prime[0] = is_prime[1] = False

    for i in range(2, x + 1):
        if is_prime[i]:
            for j in range(i * 2, x + 1, i):
                is_prime[j] = False

    return is_prime


def f(x):
    if x < 2:
        return False

    i = 2
    while i * i <= x:
        if x % i == 0:
            return False
        i += 1

    return True


n = int(input())

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

is_prime = sieve(10 ** 6)
primes = [i for i, e in enumerate(is_prime) if e]

ans = 0
used = set()
for e in primes:
    div = e
    while div <= n:
        if n % div == 0:
            ans += 1
            n //= div
            used.add(div)
        div *= e


print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter
def factorize(n):
    b = 2
    fct = []
    while b * b <= n**1/2:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct
  
n = int(input())
fact = factorize(n)
c = Counter(fact)
ans = 0
for k, v in c.items():
  l = 0
  for i in range(1, 1000000):
    l += i
    if l > v:
      break
    ans+= 1
print(ans)

Submission status: Wrong Answer

Solution code:
import itertools

s = "2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101"
s = list(map(int,s.split()))

n = int(input())
ans = 0
tmp = 0

for i in s:
    
    for j in range(1,37):
        if (n % (i ** j)) == 0:
            tmp =  (n / (i ** j))
            ans = ans + 1
            if tmp == 1:
                itertools.product()

print(ans)

Submission status: Wrong Answer

Solution code:
#約数
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

#素因数分解
def soinsu_bunkai(m):
    pf={}

    for i in range(2,int(m**0.5)+1):
        while m%i==0:
            pf[i]=pf.get(i,0)+1
            m//=i
    if m>1:
        pf[m]=1
    return pf

# 初期入力
import sys
input = sys.stdin.readline
N = int(input())
div =make_divisors(N)
div.sort()
div_2 =div[1:]

count =0
for i in div_2:
    i2 = soinsu_bunkai(i)
    if len(i2) ==1:
        q,mod =divmod(N,i)
    if mod ==0:
        count +=1
        N =q
print(count)

Submission status: Wrong Answer

Solution code:
# import sys
# import math #sqrt,gcd,pi
# import decimal
# import queue # queue
# import bisect
# import heapq # priolity-queue
# import time
# from itertools import product,permutations,\
#     combinations,combinations_with_replacement
# 重複あり順列、順列、組み合わせ、重複あり組み合わせ
# import collections # deque
# from operator import itemgetter,mul
# from fractions import Fraction
# from functools import reduce

mod = int(1e9+7)
# mod = 998244353
INF = 1<<29
lINF = 1<<35

def Divisors(a): # 約数列挙
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    divisors.sort()
    return divisors

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

def main():
    N = int(input())
    if N==1:
        print(0)
        return
    ans = 0
    div = Divisors(N)
    div.pop(0)
    div.append(INF)
    while min(div)<=N:
        x = N
        for i in range(len(div)):
            if N%div[i]==0:
                N //= div[i]
                div.pop(i)
                ans += 1
                break
        if N==x:
            break
    print(ans)
    return

if __name__=='__main__':
    main()

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 = i + 2
        while sub_count * (sub_count + 1) > 2 * i:
            sub_count -= 1
        count += sub_count
    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=int(input())
b=factorization(a)
#print(b)
sum=0

for i in b:
    counter=0
    for j in range(1,100):
        #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:
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:
                break
            else:
                n = n/z
                count += 1
        if n > i:
            break

    print(count)


if __name__ == '__main__':
    main()

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

N = int(input())
arr = factorization(N)
ans = 0

for i in arr:
    j = 1
    ok = i[1]
    while(1):
        if ok - j >= 0:
            ans += 1
            ok -= j
            j += 1
        else:
            break

print(ans)

Submission status: Wrong Answer

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
#n = 2*10**8
n = 30001000
import math
prime = [0] * (n+1) # i番目の素数
is_prime = [True] * (n+1)
p = 0 # 何番目か　0-indexed
is_prime[0] = False
is_prime[1] = False
ll = 0
#print('a')
for i in range(2,n+1):
    #ll += 1
    #print(i)
    if is_prime[i] == True:
        prime[p] = i # p番目の素数はiとなる
        p += 1
        # print(ll)
        # if p == 1000*ll:
        #     print(p)
        for j in range(2*i, int(math.sqrt(n))+1,i):
            is_prime[j] = False # その素数の倍数のやつ

#print(sieve(n,11000000))
#print(prime)
import math
def is_prime():
    global n,cnt
    for i in range(2,int(math.sqrt(n)+1)):
        if n % i == 0:
            cnt += 1
            n //= i
            return False
    return n != 1 # 1の場合は除外

n = int(input())
cnt = 0
if is_prime():
    print(1)
    exit()
#print(n)
for i in range(p):
    if n == 1:
      break
    v = prime[i]
    if v == 2:
        v *= 2
    nya = prime[i]
    while n % v == 0:
        cnt += 1
        n //= v
        v *= nya
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
import math


def is_prime(N):
    if N == 1:
        return False
    i = 2
    while i * i <= N:
        if N % i == 0:
            return False
        i += 1
    return True

def prime(N):
    prime = []
    is_prime = [True for i in range(N+1)]  # 全て素数であると初期化
    is_prime[0] = is_prime[1] = False # 0,1は素数ではない
    for i in range(2, N+1):
        if is_prime[i]:
            # iは素数である
            prime.append(i)
            for j in range(2 * i, N+1, i):
                # iの倍数は素数でない
                is_prime[j] = False
    # N以下の素数を表示
    return prime

def main():
    N = int(input())
    if N == 1:
        print(0)
        sys.exit()
    if is_prime(N):
        print(1)
        sys.exit()
    else:
        n = math.ceil(math.sqrt(N))
        prime_list = prime(n)
        ans = []
        for i in range(len(prime_list)):
            now = prime_list[i]
            j = 1
            while now ** j <= N:
                ans.append(now ** j)
                j += 1
        ans.sort()
        count = 0
        for i in range(len(ans)):
            now = ans[i]
            if N < now:
                break
            if N % now == 0:
                count += 1
                N //= now
        print(count)

if __name__ == '__main__':
    main()

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


x = prime_factorize(N)
res = 0
transSet = set(x)

for val in transSet:
    q, mod = divmod(x.count(val), 2)
    if q <= 1:
        res += q + mod
    else:
        res += q

print(res)

Submission status: Wrong Answer

Solution code:
a = int(input())  # 素因数分解したい数
b = int(a ** (1 / 2))
s = 1
for i in range(2, b):
  if a%i==0:
    a = a/i
    s = s+1
  else:
    pass
if s>0: 
  print(s) 
else:
  pass

Submission status: Wrong Answer

Solution code:
from math import ceil,floor,sqrt
def is_prime(n):
    """
    Assumes that n is a positive natural number
    """
    # We know 1 is not a prime number
    if n == 1:
        return False

    i = 2
    # This will loop from 2 to int(sqrt(x))
    while i*i <= n:
        # Check if i divides x without leaving a remainder
        if n % i == 0:
            # This means that n has a factor in between 2 and sqrt(n)
            # So it is not a prime number
            return False
        i += 1
    # If we did not find any factor in the above loop,
    # then n is a prime number
    return True

primes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999,3001,3011,3019,3023,3037,3041,3049,3061,3067,3079,3083,3089,3109,3119,3121,3137,3163,3167,3169,3181,3187,3191,3203,3209,3217,3221,3229,3251,3253,3257,3259,3271,3299,3301,3307,3313,3319,3323,3329,3331,3343,3347,3359,3361,3371,3373,3389,3391,3407,3413,3433,3449,3457,3461,3463,3467,3469,3491,3499,3511,3517,3527,3529,3533,3539,3541,3547,3557,3559,3571,3581,3583,3593,3607,3613,3617,3623,3631,3637,3643,3659,3671,3673,3677,3691,3697,3701,3709,3719,3727,3733,3739,3761,3767,3769,3779,3793,3797,3803,3821,3823,3833,3847,3851,3853,3863,3877,3881,3889,3907,3911,3917,3919,3923,3929,3931,3943,3947,3967,3989,4001,4003,4007,4013,4019,4021,4027,4049,4051,4057,4073,4079,4091,4093,4099,4111,4127,4129,4133,4139,4153,4157,4159,4177,4201,4211,4217,4219,4229,4231,4241,4243,4253,4259,4261,4271,4273,4283,4289,4297,4327,4337,4339,4349,4357,4363,4373,4391,4397,4409,4421,4423,4441,4447,4451,4457,4463,4481,4483,4493,4507,4513,4517,4519,4523,4547,4549,4561,4567,4583,4591,4597,4603,4621,4637,4639,4643,4649,4651,4657,4663,4673,4679,4691,4703,4721,4723,4729,4733,4751,4759,4783,4787,4789,4793,4799,4801,4813,4817,4831,4861,4871,4877,4889,4903,4909,4919,4931,4933,4937,4943,4951,4957,4967,4969,4973,4987,4993,4999,5003,5009,5011,5021,5023,5039,5051,5059,5077,5081,5087,5099,5101,5107,5113,5119,5147,5153,5167,5171,5179,5189,5197,5209,5227,5231,5233,5237,5261,5273,5279,5281,5297,5303,5309,5323,5333,5347,5351,5381,5387,5393,5399,5407,5413,5417,5419,5431,5437,5441,5443,5449,5471,5477,5479,5483,5501,5503,5507,5519,5521,5527,5531,5557,5563,5569,5573,5581,5591,5623,5639,5641,5647,5651,5653,5657,5659,5669,5683,5689,5693,5701,5711,5717,5737,5741,5743,5749,5779,5783,5791,5801,5807,5813,5821,5827,5839,5843,5849,5851,5857,5861,5867,5869,5879,5881,5897,5903,5923,5927,5939,5953,5981,5987,6007,6011,6029,6037,6043,6047,6053,6067,6073,6079,6089,6091,6101,6113,6121,6131,6133,6143,6151,6163,6173,6197,6199,6203,6211,6217,6221,6229,6247,6257,6263,6269,6271,6277,6287,6299,6301,6311,6317,6323,6329,6337,6343,6353,6359,6361,6367,6373,6379,6389,6397,6421,6427,6449,6451,6469,6473,6481,6491,6521,6529,6547,6551,6553,6563,6569,6571,6577,6581,6599,6607,6619,6637,6653,6659,6661,6673,6679,6689,6691,6701,6703,6709,6719,6733,6737,6761,6763,6779,6781,6791,6793,6803,6823,6827,6829,6833,6841,6857,6863,6869,6871,6883,6899,6907,6911,6917,6947,6949,6959,6961,6967,6971,6977,6983,6991,6997,7001,7013,7019,7027,7039,7043,7057,7069,7079,7103,7109,7121,7127,7129,7151,7159,7177,7187,7193,7207,7211,7213,7219,7229,7237,7243,7247,7253,7283,7297,7307,7309,7321,7331,7333,7349,7351,7369,7393,7411,7417,7433,7451,7457,7459,7477,7481,7487,7489,7499,7507,7517,7523,7529,7537,7541,7547,7549,7559,7561,7573,7577,7583,7589,7591,7603,7607,7621,7639,7643,7649,7669,7673,7681,7687,7691,7699,7703,7717,7723,7727,7741,7753,7757,7759,7789,7793,7817,7823,7829,7841,7853,7867,7873,7877,7879,7883,7901,7907,7919]
n=int(input())
x=True
if n==1:
	print(0)
elif is_prime(n):
	print(1)
else:
	count=0
	for i in range(2,1000+1):
		if n%i==0:
			if is_prime(i):
				count+=1
				n=n//i
			if is_prime(floor(sqrt(i))) and is_prime(ceil(sqrt(i))):
				continue
			else:
				if n%i==0:
					n=n//i
					count+=1

			if n==1:
				break
	print(count)

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]

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) 

import sys
N=int(input())
if(N==1):
  print(0)
  sys.exit()
div = make_divisors(N)
div.remove(1)
new_div=[]
for k in div:
  jud=factorization(k) 
  if(len(jud)==1):
    new_div.append(k)
ans=0
print(new_div)
for i in new_div:
  if(N%i==0):
    N=N/i
    ans+=1
  if(N==1):
    print(ans)
    sys.exit()
print(ans)

Submission status: Wrong Answer

Solution code:
pn=[2];A=50000
for L in range(3,A):
    chk=True
    for L2 in pn:
        if L%L2 == 0:chk=False
    if chk==True:pn.append(L)
      
ln=[]
for i in range(len(pn)):
  for j in range(10):
    ln.append(pn[i]**j)
mn=sorted(list(set(ln)))

n=int(input())

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

count=0
for k in range(1,len(mn)):
  if n%mn[k]==0:
    n=n//mn[k]
    count+=1
    if n==1:
      break
if count==0:
  print(1)
  exit()
print(count)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
import math
l = []
def primeFactors(n): 
    while n % 2 == 0: 
        l.append(2) 
        n = n / 2
    for i in range(3,int(math.sqrt(n))+1,2): 
        while n % i== 0: 
            l.append(i)
            n = n / i 
    if n > 2: 
        l.append(n)

n = int(input())
if n == 1:
    print(0)
else:
    ans = 0
    primeFactors(n)
    l2 = [1,2,3,4,5,6,7,8,9,10]
    for i in range(1,len(l2)):
        l2[i] = l2[i] + l2[i-1]

    # print(l2)

    if len(set(l)) == 1:
        res = len(l)
        # print(res)
        ans2 = 0
        for i in range(len(l2)):
            if res >= l2[i]:
                ans = i+1
        print(ans)
    else:
        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())
# N = (2 ** 16) * (3 ** 16)
ans = 0
t = []
primeList = [2]
maxNumber = 15 * 10 ** 4
for x in range(3, maxNumber):
    for y in primeList:
        if x % y == 0:
            break
    else:
        primeList.append(x)  # 割り切れるものがなければリストに追加

for i in primeList:
    for x in range(1, 40):
        y = i ** x
        if N // y == N / y:
            ans += 1
            N = N // y
        else:
            break

if N > 10 ** 5:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
sosuu = [2]
A = int(input())
for L in range(3, int(A**0.5+1), 2): # 2 以外の素数は奇数なので
    for L2 in sosuu:
        if L % L2 == 0:
            break # 素数でないことがわかったらそれ以上ループする必要はない
    else: # break で抜けることがなかったら L は素数（Python 特有の制御構文）
        sosuu.append(L)

ans=0
for i in sosuu:
    if A%i==0:
        ans+=1
        A/=i
if ans==0 and not A==0:
    ans=1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import math

n = int(input())
if n == 1:
  print(0)
  sys.exit()
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

#prime = get_primenumber(n)
yaku = make_divisors(n)
#print(yaku)
ans = 0
for i in range(1,len(yaku)):

    t = math.sqrt(yaku[i])
    #print(yaku[i])
    if not is_prime(yaku[i]) and not t.is_integer():
        i=i+1
        continue
    n = n/yaku[i] 
    #print(n)
    ans+=1
    if n==1 or not n.is_integer():
        print(ans)
        sys.exit()