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


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


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

Verdicts: Wrong Answer

Wrong Answer

Accepted