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 sys
from collections import deque
import collections
import numpy as np

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 hantei(n):
    i = 0
    while (i+1)*i/2<n:
        i+=1
    return i

c = collections.Counter(prime_factorize(n))
ans = 0
#print(c)

for i in c.values():
    #print("val=",i)
    ans += hantei(i)
print(ans)

Submission status: Wrong Answer

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

    N = int(input())
    if is_prime(N):
        return 1

    cnt = 0
    for i in range(2, int(N + 1)):
        if N % i == 0:
            cnt += 1
            N /= i

        if N < i:
            break
    return cnt


print(main())

Submission status: Wrong Answer

Solution code:
import math


def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


def primes(n):
    ps = {}
    for i in range(2, int(math.sqrt(n)) + 1):
        if n == 1:
            break
        cnt = 0
        while n % i == 0:
            n = n // i
            cnt += 1
        if cnt > 0:
            ps[i] = cnt

    return ps


def main():
    import decimal
    n = int(input())
    if n == 1:
        print(0)
        exit()

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

    ps = primes(n)

    ans = sum([int(decimal.Decimal((-1 + (1 + 8 * v) ** 0.5) / 2)) for v in ps.values()])
    print(ans)


if __name__ == '__main__':
    main()

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

list=factorization(N)
#print(list)

a=len(list)
A=[0]*a
def fun(n):
    qw=0
    qe=1
    while not n-qe<0:
        n=n-qe
        qe=qe+1
        qw+=1
    return qw
qwe=0
for i in list:
    qwe+=fun(i[1])
print(qwe)

Submission status: Wrong Answer

Solution code:
n = int(input())

z = 2
c = 0
while n != 1:
	if n % z == 0:
		n /= z
		c += 1
	z += 1

print(c)

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())
S=0
if n>1:
    l=factorization(n)
    for k in l:
        x=k[1]
        n=1
        while n*(n+1)<2*x:
            n+=1
        S+=n
    print(S)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
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
def numcount(n):
    if n <= 2:
        return 1
    ret = 0
    i = 1
    while True:
        n -= i

        if n < i:
            break
        i += 1
    return i
A = int(input())
if A == 1:
    print(0)
else:
    L = factorize(A)
    C = list()
    if len(L)>1:
        count = 1
        for i in range(1,len(L)):
            if L[i] != L[i-1]:
                C.append(count)
                count = 1
            else:
                count += 1
        C.append(count)
    else:
        C = [1]

    ret = 0
    for c in C:
        ret += numcount(c)
    print(ret)

Submission status: Wrong Answer

Solution code:
import sys
# from random import choice,randint
# from bisect import bisect_left as bl             
# from bisect import bisect_right as br  
# from collections import deque,defaultdict,Counter
from math import sqrt,floor,ceil
# from itertools import combinations,permutations
# from heapq import heapify,heappop,heappush,heappushpop
# inp=sys.stdin.readline
# out=sys.stdout.write
# flsh=sys.stdout.flush
# ranomd string generator --> a = ''.join(random.choices(string.ascii_lowercase, k = 1000))
 
sys.setrecursionlimit(10**9)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod1=998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

#fact=[1]
#for i in range(1,100001):
#    fact.append((fact[-1]*i)%mod)
#ifact=[0]*100001
#ifact[100000]=pow(fact[100000],mod-2,mod)
#for i in range(100000,0,-1):
#    ifact[i-1]=(i*ifact[i])%mod
 
def MI(): return map(int, inp().strip().split())
def LI(): return list(map(int, inp().strip().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]
def LI_(): return [int(x)-1 for x in inp().strip().split()] #use list comprehension for loops
def LF(): return [float(x) for x in inp().strip().split()] #use try and except for dictionaries
def LS(): return inp().strip().split() #declare local variables ... for functions assing them to variables
def I(): return int(inp().strip()) # before using example ... func = len for using len() funtcion
def F(): return float(inp().strip()) #sort dictionary after zipping
def S(): return inp().strip() #use map function for mapping list to a fuction
def pf(s): return out(s+'\n')
def JA(a, sep): return sep.join(map(str, a)) #use this for string concatenation
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)
def modinv(n,p):return pow(n,p-2,p)
def ncr(n,r,p):                      
    t=((fact[n])*((ifact[r]*ifact[n-r])%p))%p
    return t

####################Actualcode################################
def isPrime2(n):
    if n==2 or n==3: return True
    if n%2==0 or n<2: return False
    for i in range(3, int(n**0.5)+1, 2):
        if n%i==0:
            return False    

    return True

def solve():
    n = I()
    if n==1:
        print(0)
    else:
        x = n
        c=0
        for i in range(2,int(sqrt(x))+1):
            if n%i==0:
                print(n,i)
                n = n//i
                c+=1
        # print(n)
        # if isPrime2(n):
        #     c+=1
        print(c)
def main():
    solve()


######## Python 2 and 3 footer by Pajenegod and c1729
py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192
class FastIO(BytesIO):
    newlines = 0
    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
        return s
    def read(self):
        while self._fill(): pass
        return super(FastIO,self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill(); self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s:self.buffer.write(s.encode('ascii'))
            self.read = lambda:self.buffer.read().decode('ascii')
            self.readline = lambda:self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

inp = lambda: sys.stdin.readline().rstrip('\r\n')
out = lambda x: sys.stdout.write(x)
flsh= lambda: sys.stdout.flush()

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
def main():

    N = int(input())
    primes = []
    def isprime(n):
        if n == 1: return False
        for i in range(2, int(math.sqrt(n))+1):
            if n % i == 0:
                return False
        return True

    primes = set()
    for i in range(2, int(math.sqrt(N))+1):
        if isprime(i):
            primes.add(i)
            if isprime(N//i):
                primes.add(i)
    if isprime(N):
        primes.add(N)
    # print(primes)

    ans = 0
    for p in primes:
        q = p
        while N % q == 0:
            ans += 1
            N //= q
            q *= p
        if N == 1:
            break
    return ans


if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

Solution code:
import math
A= int(input())
resArray = []
tmpA = A
for i in range(2, int(math.sqrt(A))):
    if tmpA == 1:
        break
    tmp = tmpA%i
    resArray.append(0)
    while tmp == 0:
        tmpA = tmpA/i
        resArray[-1] += 1
        tmp = tmpA%i
if tmpA != 1:
    print(1)
    exit()
res = 0
for i in resArray:
    if i != 0:
        tmp = 0
        for j in range(i + 1):
            if j*(j+1)/2 > i:
                break
            tmp = j
        res += tmp
print(res)

Submission status: Wrong Answer

Solution code:
import math
def is_prime(n):
    for i in range(2, n + 1):
        if i * i > n:
            break
        if n % i == 0:
            return False
    return n != 1
N=int(input())
if N==1:
    print(0)
    exit()
if is_prime(N):
    print(1)
    exit()
N_SQ=math.sqrt(N)
if N==N_SQ**2:#整数なら
    N_SQ=int(N_SQ)
    if is_prime(N_SQ):
        print(1)
        exit()
    else:
        ans=1#N_SQを入れる
        target=N_SQ
        for i in range(2,N_SQ//2+1):
            if target%i==0:
                ans+=1
                target/=i
                if target==1:break
else:
    target=N
    ans=0
    last=0
    for i in range(2,int(N_SQ)+1):
        if target%i==0:
            ans+=1
            target/=i
            last=i
    if target!=1 and target!=last:
        ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
def D():
    N = int(input())
    if N == 1:
        print(0)
        return
    temp = N
    count = 0
    while temp % 2 == 0: 
       temp //= 2
       count += 1
    track = 1
    # print(count)
    while count-track >= 0:
        count -= track
        track += 1
    # print(temp, track-1)
    ans = max(0, track-1)
    for i in range(3,int(math.sqrt(N))+1,2): 
        count = 0
        while temp % i== 0: 
            temp //= i
            count += 1
        track = 1
        while count-track >= 0:
            count -= track
            track += 1
        ans += max(0, track - 1)
    print(ans)

D()

Submission status: Wrong Answer

Solution code:
#デフォルト
import itertools
from collections import defaultdict
import collections
from decimal import *
import math
import sys
sys.setrecursionlimit(200000)
mod = 1000000007

n = int(input())

def 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

MAX = 100010
is_prime = [True] * MAX
is_prime[0] = False
is_prime[1] = False
for i in range(2, MAX):
    if is_prime[i]:
        j = i * 2
        while j < MAX:
            is_prime[j] = False
            j += i

if (Prime(n)):
    print("1")
else:
    ans = 0
    for i in range(2, 100010):
        if is_prime[i]:
            for j in range(1, 100):
                sub = i**j
                if n % (sub) == 0:
                    ans += 1
                    n = n // (sub)
                if n == 1:
                    break
        if n == 1:
            break

    print(ans)

Submission status: Wrong Answer

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

import sys
from collections import deque, Counter
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

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


c = list(Counter(prime_factorize(N)).values())

ans = 0
used = {}

for i in range(len(c)):
    acc = 0
    cnt = 1
    while True:
        if c[i] >= acc + cnt:
            c[i] -= acc+cnt
            acc = acc+cnt
            ans += 1
        else:
            break
c = sorted(c)[::-1]

hoge = 1
for hoge in range(1, 10):
    for _ in range(1000):
        for i in range(len(c)-1):
            if min(c[i:i+hoge+1]) >= 1:
                for k in range(hoge+1):
                    c[i+k]-=1
                ans += 1
        c = sorted(c)[::-1]

print(ans)

Submission status: Wrong Answer

Solution code:
from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()
N=int(input())
#N=10**18

lst=defaultdict(int)
for i in list(range(2,int(N**.5)+100))+[N]:
    while N>1 and N%i==0:
        N//=i
        lst[i]+=1
c=0
#print(lst)
for l in lst:
    l=lst[l]
    i=1
    while l>=i:
        l-=i
        c+=1
        i+=1
print(c)

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys
sys.setrecursionlimit(10**6)

n=int(input())

m=int(np.sqrt(n))+1

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

ans=0
for i in range(2,m):
    cnt=0
    for j in range(44):
        if n%i==0:
#            print("i=",i,"n=",n)
            n=n/i
            cnt+=1
        else:
            break
    if 1<=cnt<3:
        ans+=1
    if 3<=cnt<6:
        ans+=2
    if 6<=cnt<10:
        ans+=3
    if 10<=cnt<15:
        ans+=4
    if 15<=cnt<21:
        ans+=5
    if 21<=cnt<28:
        ans+=6
    if 28<=cnt<36:
        ans+=7
    if 36<=cnt<45:
        ans+=8

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

print(ans)

Submission status: Wrong Answer

Solution code:
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math
from collections import deque
import itertools
import heapq
#import bisect
from fractions import Fraction
import copy
from functools import lru_cache
from collections import defaultdict


def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]

def ret(a):
    c=[None]*(len(a)-1)
    if len(a)==1:
        return a[0]
    elif len(a)==0:
        return 0
    for i in range(1,len(a)):
        c[i-1]=abs(a[i]-a[i-1])
    return ret(c)

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0 and i!=1:
            lower_divisors.append(i)
            n=n//i
  #          if i != n // i:
  #              upper_divisors.append(n//i)
        if n% i !=0 or i==1:
            i += 1
    nokori=[n]
    return lower_divisors + nokori # upper_divisors[::-1]

def main():
    n=int(input())
    yaku=make_divisors(n)
    memo = defaultdict(int)
    for i in range(len(yaku)):
        memo[yaku[i]]+=1
    ans=0
    for b in memo.values():
        if b<=2:
            ans+=1
        elif b>=3 and b<=5:
            ans+=2
        elif b>=6 and b<=9:
            ans+=3
        elif b >= 10 and b <= 14:
            ans += 4
        elif b >= 15 and b <= 20:
            ans += 5
        elif b >= 21:
            ans += 6
#    print(memo)
    if n==1:
        print(0)
    else:
        print(ans)
 #   print(yaku)








if __name__ == "__main__":

    main()

Submission status: Wrong Answer

Solution code:
import math
primes = []

def isnprimt(n) :
    i = 0
    while i<len(primes)  :
        if n%primes[i] == 0 :
            return False
        i += 1
    return True

def solve() :
    n = int(input())
    m = int(math.sqrt(n))+1
    is_prime = [True]*m
    ans = 0
    used = set()
    if n == 1 :
        return 0
    for i in range(2, m) :
        if is_prime[i] :
            primes.append(i)
            j=i 
            while n%j == 0 :
                n//=j 
                used.add(j)
                j*=i
                ans += 1
            j=i+i 
            while j<m :
                is_prime[j] = False
                j += i 
    if n != 1 and n not in used and isnprimt(n):
        ans += 1 
    return ans

print(solve())

Submission status: Wrong Answer

Solution code:
import numpy as np

#f = open('./input_D.txt')
#N = int(f.readline())

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

fact_N = factorization(N)
fact_N = np.array(fact_N)
num_sosuu = fact_N[:,1]

num_sosuu_max = num_sosuu.max()
ans = 0
for i in range(len(num_sosuu)):
    num_i = num_sosuu[i]
#    for j in range(np.uint64(np.sqrt(2*num_sosuu_max))):
    for j in range(int((2*num_sosuu_max)**0.5)):
        if num_i >= j+1:
            ans += 1
            num_i -= j+1
        else:
            break

print(str(int(ans)))

Submission status: Wrong Answer

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

N = int(input())
from collections import Counter

def check(v):
    if v <= 2:
        return 1
    an = 0
    i = 1
    subsum = 0
    while v - subsum > 0:
        subsum += i
        i += 1
        an += 1
    return an

# print(check(3))

def Main(N):
    p = prime_factorize(N)
    c = Counter(p)
    ans = 0
    for v in c.values():
        ans += check(v)
    return ans

print(Main(N))

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
 
def f(c):

	cumul = 0
	step = 1
	cc = 0
	while(cumul < c):
		cc +=1
		cumul += step
		step += 1
	if cumul > c: cc -=1
	return cc

d = 2
count = 0
on = n
while(n != 1 and d*d <= on):
	if n%d==0:
		c = 0
		while(n%d == 0): 
			c += 1
			n /= d
		count += f(c)
	d+=1
print count

Submission status: Wrong Answer

Solution code:
#r=[0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465, 496, 528, 561, 595, 630, 666, 703, 741, 780, 820]
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())
m=factorization(n)
t=0
for x in m:
  t+=((x[1]*2)**0.5)//1
t=int(t)
print(t)

Submission status: Wrong Answer

Solution code:
n = int(input())


def prime_factorize_n(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_list = prime_factorize_n(n)
# print(a_list)

tmp = 1
used_list = []
for i in range(len(a_list)):
    if tmp != 1 and tmp not in used_list:
        used_list.append(tmp)
        tmp = 1

    if a_list[i] not in used_list:
        used_list.append(a_list[i])
    else:
        tmp *= a_list[i]

if tmp != 1 and tmp not in used_list:
    used_list.append(tmp)
# print(used_list)
print(len(used_list))

Submission status: Wrong Answer

Solution code:
n = int(input())
p = [2,3,5,7,11,13,17,19,23,29]
for i in range(2,int(n**0.5)+1):
    x = 1
    for j in range(len(p)):
        if(i%p[j] == 0):
            x = 0
            break
    if(x == 1):
        p.append(i)
t = {}
for i in range(len(p)):
    t[p[i]] = 0
    while(n%p[i] == 0):
        n //= p[i]
        t[p[i]] += 1
    if(n == 1):
        break
z = 0
k = list(t.keys())
for i in range(len(k)):
    j = 1
    while(1):
        if(t[k[i]] - j >= 0):
            t[k[i]] -= j
            z += 1
            j += 1
        else:
            break
print(z)

Submission status: Wrong Answer

Solution code:
def solve(n):
    if n == 1:
        return 0
    res = 0
    cheked = set()
    for i in range(2, int(n ** 0.5) + 1):
        if i in cheked:
            continue
        cnt = 1
        while n % (i ** cnt) == 0:
            n //= i ** cnt
            res += 1
            cnt += 1
            cheked.add(i ** cnt)
    return max(res, 1)

n = int(input())
ans = solve(n)
print(ans)

Submission status: Wrong Answer

Solution code:
def eratos():
    primes = []
    for i in range(2, 10**4):
        flag = True
        for p in primes:
            if i%p == 0:
                flag = False
        if flag:
            primes.append(i)
    return primes

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

N = int(input())
prime = eratos()
ans = 0
if is_prime_for_x(N):
    ans = 1
else:
    for z in range(2, 10**4):
        for p in prime:
            if z%p != 0:
                continue
            for j in range(1, 3):
                if p**j == z:
                    if N%z == 0:
                        N //= p
                        ans += 1
                    break
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import deque

m=int(input())
def fa(n):
    arr =deque([])
    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

x=0
count=0
for i,j in fa(m):
    for k in range(10**12):
        if j<=k*(k+1)//2:
            x=k
            break
    count+=x


print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
L_P = []
num = N
ans = 0
if N == 1:
    print(ans)
else:
    for i in range(2,int(-(-num**0.5//1))+1):
        if num % i == 0:
            cnt = 0
            while num % i == 0:
                cnt += 1
                num //= i
            L_P.append(cnt)
        if num == 1:
            break
    if len(L_P) == 0:
        L_P.append(1)
    for x in L_P:
        for i in range(1,12):
               if i*(i+1)//2 > x:
                   ans += i-1
                   break
    print(ans)

Submission status: Wrong Answer

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

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

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

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

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

    r = 0
    while n != 1:
        if not numsd:
            break
        nextn = numsd.popleft()
        if n % nextn == 0:
            n = n / nextn
            r += 1


    print(r)



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
if N == 1:
    print(0)
    exit()
div = {}
for i in range(2, int(math.sqrt(N))+1):
    while N % i == 0:
        N //= i
        if i in div:
            div[i] += 1
        else:
            div[i] = 1
    if N == 1:
        break
if N != 1:
    div[N] = 1
ans = 0
cnt = []
for v in div.values():
    i = 1
    while v >= i:
        v -= i
        i += 1
        ans += 1
    if v != 0:
        cnt.append(v)
list.sort(cnt, reverse=True)
while len(cnt) >= 2:
    if cnt[0] > cnt[-1]:
        cnt[0] -= cnt[-1]
        ans += cnt[-1]
        cnt = cnt[:-1]
    elif cnt[0] == cnt[-1]:
        ans += cnt[0]
        cnt = cnt[1:-1]
    else:
        cnt[-1] -= cnt[0]
        ans += cnt[0]
        cnt = cnt[1:]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
n = N
ans = 0
num = [2]
for i in range(3,N + 1):
  if all(i % x != 0 for x in num):
    num.append(i)
  if n % i == 0:
    index = 1
    while n % i**index == 0:
      ans += 1
      n = n // (i**index)
      index += 1
  if n == 1:
    break
print(ans)

Submission status: Wrong Answer

Solution code:
from sys import *
from collections import Counter
N = int(stdin.readline())
things = []
if N ==1:
    print(0)
    exit()
for i in range(2,N):
    if i*i > N:
        if len(things) == 0:
            print(1)
            exit()
        things.append(int(N))
        break

    while(N%i == 0):
        things.append(i)
        N = N/i
c = Counter(things)
vals = 0
for item in c:
    hue = 0
    for i in range(1,100000):
        if (hue + i) > c[item]:
            break
        else:
            hue += i
            vals += 1
print(vals)

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


r = 0
if n != 1:
    f = factorization(n) 
    num = []
    for a, b in f:
        for i in range(b):
            num.append(a ** (i + 1))
    num.sort()
    for c in num:
        if n < c:
            break
        else:
            n /= c
            r += 1

print(r)

Submission status: Wrong Answer

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


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 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_root(n, li):
    for i in li:
        if n**(1 / i).is_integer():
            return True
    else:
        return False


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

if is_prime(n):
    print(1)
    sys.exit()


li = make_divisors(n)
li = [x for x in li if is_prime(x)]

ans = 1
n //= max(li)

for i in range(4, 10**12):
    if is_prime(n):
        ans += 1
        break
    if n == 1:
        break
    if is_root(i, li):
        if n % i == 0:
            n //= i
            ans += 1

print(ans)

Submission status: Wrong Answer

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


def get_knu(a):
    if a == 1:
        return 1
    before = 1
    n = 2
    while True:
        knum = (n * (n + 1)) // 2
        if a == knum:
            return n
        elif knum > a > before:
            return -1
        else:
            n += 1
            before = knum


D = int(input())
p = get_prime_fact(D)

if len(p) != len(set(p)):
    res = 0
    for n in set(p):
        count = p.count(n)
        if count == 1:
            res += 1
        else:
            add = get_knu(count)
            if add == -1:
                add = 1
            res += add

    print(res)
else:
    print(len(p))