Problem: 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.

Submission attempts (in order):
N = int(input())

def Prime_factorize(n):
    cnt = 0
    
    two_div = 2
    while n%2==0 and (n>=two_div):
        cnt += 1
        n //= two_div
        
        two_div *= 2
    
    print(n)
    f = 3
    f_div = 3
    
    while f*f <= n:
        if n%f_div == 0:
            cnt += 1
            n //= f_div
            
            f_div = f_div*f
        
        else:
            f += 2
            f_div = f
    
    if n != 1:
        cnt += 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

N = int(input())

def Prime_factorize(n):
    cnt = 0
    
    two_div = 2
    while n%2==0:
        cnt += 1
        n //= two_div
        
        two_div *= 2
    
    f = 3
    f_div = 3
    
    while f*f <= n:
        if n%f_div == 0:
            cnt += 1
            n //= f_div
            
            f_div = f_div*f
        
        else:
            f += 2
            f_div = f
    
    if cnt == 0:
        cnt = 1
    return cnt
ans = Prime_factorize(N)
print(ans)

N = int(input())

def Prime_factorize(n):
    cnt = 0
    
    two_div = 2
    while n%2==0 and (n>=two_div):
        cnt += 1
        n //= two_div
        
        print(two_div,n)
        two_div *= 2
    
    f = 3
    f_div = 3
    
    while f*f <= n:
        if n%f_div == 0:
            cnt += 1
            n //= f_div
            print(f_div,n)
            
            f_div = f_div*f
        
        else:
            f += 2
            f_div = f
    
    if n != 1 and (n ==f_div+2):
        cnt += 1
        print(n)
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

N = int(input())

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

Primes = Prime_Factorize(N)
print(Primes,N)
cnt = 0
for p in Primes:
    e = 1
    z = p
    while (N%z == 0) and (N >= z):
        print('N,z,p,e',N,z,p,e)
        N //= z
        e += 1 
        z = p**e
        cnt += 1
    while N%p == 0:
        N //= p
print(cnt)

#D - Div Game
N = int(input())

def Prime_factorize(n):
    cnt = 0
    A = []
    
    z = 2
    while n%z==0 and (n>=z):
        cnt += 1
        n //= z
        print(n,z)
        A.append(z)
        
        z *= 2
    
    f = 3
    z = 3
    
    while f*f <= n:
        if n%z == 0:
            cnt += 1
            n //= z
            A.append(z)
            print(n,z,f)
            
            z = z*f
        
        else:
            f += 2
            z = f
    print(list(A))
    
    if n != 1 and all((n%i != 0 for i in A)):
        A.append(z)
        cnt += 1
    
    if cnt == 0:
        cnt = 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

N = int(input())

def Prime_factorize(n):
    cnt = 0
    
    two_div = 2
    while n%2==0 and (n>=two_div):
        cnt += 1
        n //= two_div
        
        two_div *= 2
    
    f = 3
    f_div = 3
    
    while f*f <= n:
        if n%f_div == 0:
            cnt += 1
            n //= f_div
            
            f_div = f_div*f
        
        else:
            f += 2
            f_div = f
    
    if n != 1 and (n ==f_div+2):
        cnt += 1
    return cnt
if N == 1:
    ans = 0
else:
    ans = Prime_factorize(N)
print(ans)

N = int(input())

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

Primes = Prime_Factorize(N)
cnt = 0
for p in Primes:
    e = 1
    z = p
    while (N%z == 0) and (N >= z):
        N //= z
        e += 1 
        z = p**e
        cnt += 1
    while N%p == 0:
        N //= p
print(cnt)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted