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

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


hoge = factorization(n)
ret = 0

if (hoge[0][0] == 1):
    print(0)
else:
    for i in hoge:
        tmp = i[1]
        cnt = 1
        while True:
            if tmp >= cnt:
                tmp -= cnt
                ret += 1
            else:
                break
            cnt += 1
print(ret)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
N = n

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

yakusu = []
multi = []

i = 2
while(i <= math.ceil(math.sqrt(n))):
    
    if(n % i == 0):
        if(i in yakusu):
            multi[yakusu.index(i)] += 1
        else:
            yakusu.append(i)
            multi.append(1)
        n = int(n / i)
        continue
    
    if(n == 1):
        break
    
    i += 1

if(len(yakusu) == 0):
    print(1)
    exit()
    
ans = 0

for j in range(len(multi)):
    h = int(math.sqrt(1 + 8 * multi[j]))
    h = (h - 1) if h % 2 == 0 else h
    h = (-1 + h) / 2
    ans += int(h)

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

def factorizatio(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
for i in factorizatio(N):
    cnt = i[1]
    a = 0
    b = 0
    for j in range(1, cnt+1):
        a += j            
        if a > cnt:
            break
        b += 1    
    ans += b

Submission status: Wrong Answer

Solution code:
n = int(input())
cnt = 0
cntN = n

for i in range(2,n+1):
  p = i
  while n%p ==0:
    cnt += 1
    cntN /= p
    p *= p
  if cntN+1 <= i:
    break
print(cnt)

Submission status: Wrong Answer

Solution code:
import itertools
import numpy as np
N = int(input())
z_list = []
ans = 0

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
temp_list = []
prime_list = prime_factorize(N)
if len(prime_list) == 1:
    print(1)
    exit()

for i in range(1, int(len(prime_list)/2)):
    for v in itertools.combinations(prime_list, i):
        temp_list.append(np.prod(v))

ans_list = list(set(temp_list))

for z in sorted(ans_list):
    if z not in z_list and N % z == 0:
        ans += 1
        N /= z
        z_list.append(z)

print(ans)

Submission status: Wrong Answer

Solution code:
#4問目
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

def has_duplicates2(seq):
    seen = []
    unique_list = [x for x in seq if x not in seen and not seen.append(x)]
    return len(seq) != len(unique_list)

fact = prime_factorize(N)
print(fact)
result  =  0

if has_duplicates2(fact):
    #重複した数字のリスト
    chofuku = [x for x in set(fact) if fact.count(x) > 1]
    for i in chofuku:
        flag = True
        n = 1
        Count = fact.count(i) + 1
        while flag:
            if(1/2 * n * (n - 1) < Count <= 1/2 * n * (n + 1)):
                result += n-1
                flag = False
            else:
                n += 1
    
    #重複していない数の個数
    NOTchofuku = len((list(set(fact)))) - len(chofuku)
    print(result + NOTchofuku)
else:
    print(len(fact))

Submission status: Wrong Answer

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

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

def main():
    n = int(input())
    cache = set()
    a = prime_factorize(n)
    tmp = 1
    ans = 0
    while a:
        x = a.pop()
        tmp *= x
        if tmp in cache:
            continue
        cache.add(tmp)
        ans += 1
        tmp = 1


    print(ans)


main()

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

fact = factorization(N)
fact_num = []
fact_num2 = []
 

for i in range(len(fact)):
    fact_num.append(fact[i][0])
    fact_num2.append(fact[i][1])

cnt=0

for j in range(max(fact_num2)):
    for i in range(len(fact)):
        if N%fact_num[i]==0 and N%(fact_num[i]**(j+1))==0:
            N = N/(fact_num[i]**(j+1))
            cnt+=1
            print(N)
            if N==1:
                print(cnt)
                sys.exit()
print(cnt)

Submission status: Wrong Answer

Solution code:
# 素因数分解
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=NTL_1_A&lang=ja

import math
from collections import Counter
n = int(input())
origin = n
ans = []

i = 2
while i <= math.sqrt(n):
    if n % i == 0:
        n //= i
        ans.append(str(i))
    else:
        i += 1

if n != 1:
    ans.append(str(n))
# print(Counter(ans))
f_ans = 0
for x, y in Counter(ans).items():
    cnt = 0
    for i in range(1, 5):
        cnt += i
        if cnt == y:
            f_ans += i
            break
        if cnt > y:
            f_ans += (i - 1)
            break

print(f_ans)

Submission status: Wrong Answer

Solution code:
I = lambda : list(map(int,input().split()))
ans=0
n,=I()
for i in range(2,int(n**0.5)+1):
	if n%i==0:
		n//=i
		ans+=1
if n!=1:
	ans+=1
print(ans)

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():
    ans += 1
    z = 1
    for _ in range(2, c):
        z += z
        if c - z < 0:
            break
        ans += 1
print(ans)

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)))
print(arr)
ans = 0
for v, c in arr.items():
    ans += 1
    z = 1
    for _ in range(2, c):
        z += z
        if c - z < 0:
            break
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import collections as cc
I = lambda : list(map(int,input().split()))
ans=0
n,=I()
k=2
ff=cc.defaultdict(int)
while 1:
	f=0
	g=0
	for i in range(k,int(n**0.5)+1):
		if n%i==0:
			g=1
			ff[i]=n
			n//=i
			f=1
			k+=1
			ans+=1
	if not g and ff[n]:
		ans+=1
		break
	if not f :
		break
print(ans)

Submission status: Wrong Answer

Solution code:
import sys 
input = sys.stdin.readline
n = int(input())
m = int(n**0.5)




def factorization(n):
    #arr = []
    temp = n
    total = 0
    p = 2
    flag = False
    while p <= m:
        if temp % p == 0:
            flag = True
            z = p
            while temp % z == 0:
                temp //= z
                z *= p
                total += 1
                
        p += 1
    

    return total

def is_prime(num):
    this_is_prime = True
    for i in range(2, int(num**0.5 + 1)):
        if num % i == 0:
            this_is_prime = False
    return this_is_prime


def main():
    if n >= 2 and is_prime(n):
        ans = 1
    elif n == 1:
        ans = 0
    else:
        ans = factorization(n)
    print(ans)
    
main()

Submission status: Wrong Answer

Solution code:
from collections import Counter

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

def get_count(c):
  ans = 0
  _max = c
  for i in range(1,c+1):
    if i <= _max:
      ans += 1
      _max -= i
    else:
      break
  return ans
a = int(input())
counter = Counter(prime_factor(a))
ans = 0
for i in counter:
  ans += get_count(counter[i])
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

sNR = [
  [j**i for i in range(1,3)] for j in [2,3,5,7,11,13]
      ]
sNR = sum(sNR, [])
#print(sNR)
  
count=0

divs = make_divisors(n)
#print(divs)
for div in divs:
  if is_prime(div) or div in sNR:
    if n == 1:
      break
    #print(n,div)
    n /= div
    count+=1

print(count)

Submission status: Wrong Answer

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

l=factorization(n) 

for i in range(len(l)):
    m=l[i]
    m2=m[1]
    a=1
    while m2>=a:
        count+=1
        m2-=a
        a+=1

print(count)

Submission status: Wrong Answer

Solution code:
import collections as cc
I = lambda : list(map(int,input().split()))
ans=0
n,=I()
k=2
ff=cc.defaultdict(int)
while 1:
	f=0
	g=0
	for i in range(k,int(n**0.5)+1):
		if n%i==0:
			g=1
			ff[i]=n
			n//=i
			f=1
			k+=1
			ans+=1

	if not f :
		break
print(ans)

Submission status: Wrong Answer

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

l=factorization(n) 
print(l)

for i in range(len(l)):
    m=l[i]
    m2=m[1]
    a=1
    while m2>=a:
        count+=1
        m2-=a
        a+=1

print(count)

Submission status: Wrong Answer

Solution code:
#4問目
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

def has_duplicates2(seq):
    seen = []
    unique_list = [x for x in seq if x not in seen and not seen.append(x)]
    return len(seq) != len(unique_list)

fact = prime_factorize(N)
# print(fact)
result  =  0

if has_duplicates2(fact):
    #重複した数字のリスト
    chofuku = [x for x in set(fact) if fact.count(x) > 1]
    for i in chofuku:
        flag = True
        n = 1
        Count = fact.count(i)
        while flag:
            if Count == 2:
                result += 1
                flag = False
            elif(1/2 * n * (n - 1) < Count <= 1/2 * n * (n + 1)):
                result += n
                flag = False
            else:
                n += 1
    
    #重複していない数の個数
    NOTchofuku = len((list(set(fact)))) - len(chofuku)
    print(result + NOTchofuku)
else:
    print(len(fact))

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


hoge = factorization(n)
ret = 0

if (hoge[0][0] == 1):
    print(0)
else:
    for i in hoge:
        tmp = i[1]
        for j in range(1, 41):
            if tmp - j >= j + 1:
                tmp -= j
                ret += 1
            else:
                ret += 1
                break
print(ret)

Submission status: Wrong Answer

Solution code:
#4問目
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

def has_duplicates2(seq):
    seen = []
    unique_list = [x for x in seq if x not in seen and not seen.append(x)]
    return len(seq) != len(unique_list)

fact = prime_factorize(N)
# print(fact)
result  =  0

if has_duplicates2(fact):
    #重複した数字のリスト
    chofuku = [x for x in set(fact) if fact.count(x) > 1]
    for i in chofuku:
        flag = True
        n = 1
        Count = fact.count(i)
        print(Count)
        while flag:
            if Count == 2:
                result += 1
                flag = False
            elif(1/2 * n * (n - 1) < Count <= 1/2 * n * (n + 1)):
                result += n
                flag = False
            else:
                n += 1
    
    #重複していない数の個数
    NOTchofuku = len((list(set(fact)))) - len(chofuku)
    print(result + NOTchofuku)
else:
    print(len(fact))

Submission status: Wrong Answer

Solution code:
from collections import Counter

N = 2

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

c = Counter(prime(N))

ans = 0
for i in c.values():
    if i > 0:
        a = 0
        b = 0
        for j in range(1, i+1):
            a += j
            if a > i:
                break
            b += 1    
        ans += b

print(ans)

Submission status: Wrong Answer

Solution code:
class Sieve: 
    
    def __init__(self, n=1):
        self.f = [0 for _ in range(n+1)]
        self.f[0] = -1
        self.f[1] = -1
        self.primes = []
        for i in range(2, n+1):
            if self.f[i]:
                continue
            self.primes.append(i)
            self.f[i] = i
            for j in range(i*i, n+1, i):
                if not self.f[j]:
                    self.f[j] = i
    
    def isPrime(self, x):
        return self.f[x] == x
    
    def factorList(self, x):
        res = []
        while x != 1:
            res.append(self.f[x])
            x //= self.f[x]
        return res
    
    def factor(self, x):
        fl = self.factorList(x)
        if not len(fl):
            return []
        res = [[fl[0], 0]]
        for p in fl:
            if res[-1][0] == p:
                res[-1][1] += 1
            else:
                res.append([p, 1])
        return res



n = int(input())
N = n

s = Sieve(10**6+10)

prime_list = []
for i in range(2, 10**6+10):
    if s.isPrime(i):
        prime_list.append(i)

e = 1
pos = 0
ans = 0
while pos < len(prime_list) and n >= prime_list[pos]:
    p = prime_list[pos]
    if n%(p**e) == 0:
        ans += 1
        n //= p**e
        e += 1
    else:
        while n%p == 0:
            n //= p
        pos += 1
        e = 1

if ans == 0 and N > 1:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
N_prime = []

n = N
i = 2
while True:
    if i == N or i > (N**0.5):
        N_prime.append(int(n))
        break
    if n%i == 0:
        N_prime.append(i)
        n = n/i
        if n == 1:
            break
    else:
        i += 1
ct = []
temp_i = 0
for i in N_prime:
    if i in ct:
        if temp_i == i:
            temp_i *= i
            if temp_i in ct:
                continue
            else:
                ct.append(temp_i)
        else:
            temp_i = i    
    else:
        ct.append(i)

print(len(ct))

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
N = n

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

yakusu = []
multi = []

i = 2
while(i <= math.ceil(math.sqrt(n))):
    
    if(n % i == 0):
        if(i in yakusu):
            multi[yakusu.index(i)] += 1
        else:
            yakusu.append(i)
            multi.append(1)
        n = int(n / i)
        continue
    
    if(n == 1):
        break
    
    i += 1

if(len(yakusu) == 0):
    print(1)
    exit()
    
ans = 0

for j in range(len(multi)):
    h = (-1 + int(math.sqrt(1 + 8 * multi[j]))) / 2
    ans += int(h)

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

def func(i):
	temp = 0
	for j in range(i+2):
		temp+=j
		if(temp > i):
			break
	return j-1

i = 0
ret = 0
while n % 2 == 0:
	i += 1
	n //= 2

if(i >= 1):
	tempret = func(i)
	ret+=tempret
#	print(2,i,n,tempret,ret)
f = 3
i = 0
while f * f <= n:
	if n % f == 0:
		i += 1
		n //= f
#		print("bb",n,f,i,ret)
	else:
		f += 2
		if(i >= 1):
			tempret = func(i)
			ret+=tempret
#			print("cc",f,i,tempret,ret)
			i = 0

if(n > 1):
	i+=1
	if(i >= 1):
		tempret = func(i)
		ret+=tempret
#		print("dd",f,i,tempret,ret)

print(ret)

Submission status: Wrong Answer

Solution code:
n = int(input())

def func(i):
	temp = 0
	for j in range(i+2):
		temp+=j
		if(temp > i):
			break
	return j-1

i = 0
ret = 0
while n % 2 == 0:
	i += 1
	n //= 2

if(i >= 1):
	tempret = func(i)
	ret+=tempret
	print(2,i,n,tempret,ret)
f = 3
i = 0
while f * f <= n:
	if n % f == 0:
		i += 1
		n //= f
		print("bb",n,f,i,ret)
	else:
		f += 2
		if(i >= 1):
			tempret = func(i)
			ret+=tempret
			print("cc",f,i,tempret,ret)
			i = 0

if(n > 1):
	i+=1
	if(i >= 1):
		tempret = func(i)
		ret+=tempret
		print("dd",f,i,tempret,ret)

print(ret)

Submission status: Wrong Answer

Solution code:
import itertools
import numpy as np
N = int(input())
z_list = []
ans = 0

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
temp_list = []
prime_list = prime_factorize(N)
if len(prime_list) == 1:
    print(1)
    exit()

for i in range(1, len(prime_list)):
    for v in itertools.combinations(prime_list, i):
        temp_list.append(np.prod(v))

ans_list = list(set(temp_list))

for z in ans_list:
    if z not in z_list and N % z == 0:
        ans += 1
        N /= z
        z_list.append(z)

print(ans)

Submission status: Wrong Answer

Solution code:
a=int(input())
def f(a):
    count=0
    t=2
    for z in range(t,a+1):
        if(a%z==0):
            for p in range(2,z+1):
                so=0
                if(p==2 or p==3 or (p%2>0 and p%3>0)):
                    e=1
                    while True:
                        if(z==p**e):
                            a=a/z
                            count+=1
                            so+=1
                            break
                        elif(z<p**e):
                            break
                        e+=1
                    if(so!=0): break
            t+=1 
    return count
f(a)

Submission status: Wrong Answer

Solution code:
N = int(input())
things = []
c = N
for i in range(2, c):
	if i*i > N:
		break
	count = 0
	if c%i == 0:
		while c%i == 0:
			c//=i
			count += 1
		things.append(count)
if c > 1:
	things.append(1)
final = 0
for x in things:
	count = 0
	start = 1
	step = 2
	while start <= x:
		start += step
		step += 1
		count += 1
	final += count

print(1) if things == [] else print(final)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
N = n

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

yakusu = []
multi = []

i = 2
while(i <= math.ceil(math.sqrt(N))):
    
    if(n % i == 0):
        if(i in yakusu):
            multi[yakusu.index(i)] += 1
        else:
            yakusu.append(i)
            multi.append(1)
        n = int(n / i)
        continue
    
    if(n == 1):
        break
    
    i += 1

if(len(yakusu) == 0):
    print(1)
    exit()
    
ans = 0

for j in range(len(multi)):
    h = (-1 + int(math.sqrt(1 + 8 * multi[j]))) / 2
    ans += int(h)

print(ans)

Submission status: Wrong Answer

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

cou = 0

for i in range(2,10**12):
    if N >=i:
        if N%i == 0:
            cou +=1
            N = N/i
    else:
        break
print(cou)

Submission status: Wrong Answer

Solution code:
import sys 
input = sys.stdin.readline
n = int(input())
m = int(n**0.5)

def factorization(n):
    #arr = []
    temp = n
    total = 0
    p = 2
    flag = False
    while p <= m:
        if temp % p == 0:
            flag = True
            z = p
            while temp % z == 0:
                temp //= z
                z *= p
                total += 1
                
        p += 1
            
    if temp > m:
        total += 1

    return total

def main():
    ans = factorization(n)
    if n == 1:
        ans = 0
    print(ans)
    
main()

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
N = n

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

yakusu = []
multi = []

i = 2
while(i <= int(math.sqrt(N))):
    
    if(n % i == 0):
        if(i in yakusu):
            multi[yakusu.index(i)] += 1
        else:
            yakusu.append(i)
            multi.append(1)
        n = int(n / i)
        continue
    
    if(n == 1):
        break
    
    i += 1

if(len(yakusu) == 0):
    print(1)
    exit()
    
ans = 0

for j in range(len(multi)):
    h = (-1 + int(math.sqrt(1 + 8 * multi[j]))) / 2
    ans += int(h)

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

if n==1:
  print(0)
  exit()  
  
f=factorization(n)
cnt=0
for i in range(len(f)):
  m=2 # 強引
  while f[i][1]>0:
    f[i][1]-=m
    m+=1
    cnt+=1
    print(f)
print(cnt)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

# import sympy
# sympy.divisors(10**9)

import sys
n = int(input())

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

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

s = make_divisors(n)
s.remove(1)

ss = [item for item in s if is_prime(item)]

sss = []
for i in ss:
    for p in range(2,100):
        nn = i**p
        if nn > n:
            break
        sss.append(nn)

ssss = sss + ss
ssss = list(dict.fromkeys(ssss))

cnt=0
for i, num in enumerate(ssss):
    if n%num==0:
        n = n//num
        cnt+=1
        if n==1:
            print(cnt)
            sys.exit()

Submission status: Wrong Answer

Solution code:
N = int(input())

import heapq 





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,i, cnt])

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

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

    return arr

# for N in range(1,100000):
# N = 288
# print(N)

heap = factorization(N) 
print(heap)
# print(heap)
heapq.heapify(heap)
ans = 0

while(heap):
    # print(heap)
    if N == 1:
        break
    sub,prime,cnt = heapq.heappop(heap)
    if N < sub:
        break
    if N % sub == 0:
        N = N // sub
        ans += 1
        if cnt > 0:
            cnt -= 1
            sub *= prime
            heapq.heappush(heap, [sub,prime,cnt])

    print(ans)

Submission status: Wrong Answer

Solution code:
#D
import math
#試し割法
def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割っていく
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            if num not in factor:
                factor.append(num)
    #リストが空ならそれは素数
    if not factor:
        return 'prime number'
    else:
        factor.append(n)
        return factor
    
n=int(input())
if n==1:
    ans=0
elif trial_division(n)== 'prime number':
    ans=1
else:
    z=2
    ans=0
    while z <= n/2:
        if n%z !=0:
            z +=1
            continue
        if trial_division(z)== 'prime number':
            n = n/z
            z += 1
            ans += 1
        elif len(trial_division(z))==2:
            n = n/z
            z += 1
            ans += 1
        else:
            z +=1
        
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
 
import sys     
N = int(input())
if N == 1:
    print(0)
    sys.exit()

fact = factorization(N)
fact_num = []
fact_num2 = []
 

for i in range(len(fact)):
    fact_num.append(fact[i][0])
    fact_num2.append(fact[i][1])

cnt=0

for j in range(max(fact_num2)**2):
    for i in range(len(fact)):
        if N%fact_num[i]==0 and N%(fact_num[i]*(j+1))==0:
            N = N/(fact_num[i]*(j+1))
            cnt+=1
            if N==1:
                print(cnt)
                sys.exit()
print(cnt)

Submission status: Wrong Answer

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

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 and n != 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)
    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)

Submission status: Wrong Answer

Solution code:

import math

def using_sqrt(p):
    # 2以外の偶数は素数ではないので無視する
    if p % 2 == 0 and p != 2:
        return False
    # 繰り返しの上限を対象の平方根にする
    for divisor in range(2, math.floor(math.sqrt(p))+1):
        if p % divisor == 0:
            return False
    return True

if __name__ == "__main__":
    N = int(input())    
    cnt = 0
    z = 0
    hoge = 0
    for z in range(1, N+1):
        if N % z == 0:
            p = 1
            if (using_sqrt(p)):
                e = 0
                for p in range(1, z):
                    hoge = p**e
                    e += 1
                    if  hoge == z:
                        cnt += 1
                        N = N / z
    print(cnt)

Submission status: Wrong Answer

Solution code:
import sys 
input = sys.stdin.readline
n = int(input())
m = int(n**0.5)

def factorization(n):
    #arr = []
    temp = n
    total = 0
    p = 2
    flag = False
    while p <= m:
        if temp % p == 0:
            flag = True
            z = p
            while temp % z == 0:
                temp //= z
                z *= p
                total += 1
                
        p += 1
            
    if temp!=1 and flag == False:
        total += 1

    return total

def main():
    ans = factorization(n)
    if n == 1:
        ans = 0
    print(ans)
    
main()

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

fact = factorization(N)
fact_num = []
fact_num2 = []
 

for i in range(len(fact)):
    fact_num.append(fact[i][0])
    fact_num2.append(fact[i][1])

cnt=0

for j in range(1000000000000):
    for i in range(len(fact)):
        if N%fact_num[i]==0 and N%(fact_num[i]*(j+1))==0:
            N = N/(fact_num[i]*(j+1))
            cnt+=1
            if N==1:
                print(cnt)
                sys.exit()
print(cnt)