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())
Nk=N
rootN=int(N**0.5)
p=[1]*(rootN+1)
p[0]=0
p[1]=0
for i in range(2,rootN+1):
    for j in range(i*2,rootN+1,i):
        p[j]=0
ps=[i for i in range(1,rootN+1) if p[i]==1]
pq=[]
for i in ps:
    c=0
    for j in range(1,41):
        if (N/i).is_integer():
            c+=1
            N/=i
        else:
            break
    if c!=0:
        pq.append(c)

res=0
for j in pq:
    c=0
    for k in range(1,41):
        if j-k >=0:
            c+=1
            j-=k
        else:
            break
    res+=c
if N==Nk:
    res+=1
    
print(res)

Submission status: Wrong Answer

Solution code:
def prime(N):
    for i in range(2, int(N**0.5)):
        if N%i == 0:
            return False, i
    return True, 0

def main():
    N=int(input())
    tmp = {}
    cnt = 0
    z = 2
    if N == 1:
        print(0)
        exit()
    bl, num = prime(N)
    if bl:
        print(1)
        exit()
    z = num
    while 1:
        if (N%z == 0) and (z not in tmp):
            tmp[z] = z
            N = N//z
            cnt += 1
        if N < z:
            break
        z += 1
    print(cnt)

main()

Submission status: Wrong Answer

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


if n == 1:
    print(0)
else:
    prime = []
    saidai = math.sqrt(n)
    i = 2
    while i <= saidai:
        if n % i == 0:
            n /= i
            prime.append(i)
        else:
            i +=1
    if len(prime) == 0:
        print(1)
    else:
        count = 1
        ans = 0
        i = 0
        prime.append(0)
        while i < len(prime)-1 :
            if count == 1:
                ans += 1
                if prime[i] == prime[i+1]:
                    count += 1
                i += 1
            else:
                hantei = True
                atai = prime[i]
                j = 1
                while hantei:
                    if i + j >= len(prime)-1:
                        hantei = False
                        i = i+j
                    elif atai != prime[i+j]:
                        hantei == False
                        i = i+j
                    else:
                        if j + 1 == count:
                            hantei = False
                            ans += 1
                            i = i + j + 1
                            if atai == prime[i]:
                                count += 1
                            else:
                                count = 1
                        else:
                            j += 1
        print(ans)

Submission status: Wrong Answer

Solution code:
def isprime(x):
    for i in range(2,int(x**0.5)+1):
        if x%i==0:
            return False
    return x!=1
def sieve(m):
    n=1
    primes = {}
    arr=set([])
    for i in range(2, int(m ** 0.5) + 1):
        a = n // i
        b = m // i
        for k in range(max(2, a), b + 1):
            c = i * k
            primes[c] = 1

    for i in range(max(n, 2), m + 1):
        if i not in primes:
            arr.add(i)

    return arr
arr=sieve(10**6)
dic={}
n=int(input())

if isprime(n):
    print(1)
    exit()
for i in arr:
    if n%i==0:
        cnt=0
        while n%i==0:
            cnt+=1
            n//=i
        dic[i]=cnt
ans=0
for i in dic:
    x=dic[i]
    r=(-1+(1+8*x)**0.5)//2
    ans+=r
print(int(ans))

Submission status: Wrong Answer

Solution code:
import math
data = input()
target = int(data)

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

list = primes(2000000)
result =[]
for i in list:
    check = target
    k = 0
    while True:
        if check % i != 0:
            break
        else:
            check = check/i
            k +=1
    result.append(k)

ans = 0
for j in result:
    y = 0
    z = j
    while z > y:
        y += 1
        z -= y
        ans +=1
if ans == 0 and target != 1:
    ans =1
print(ans)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
org_n = n

array = [True] * (math.ceil(math.sqrt(n))+10)
                  
for i in range(2,len(array)):
  if not array[i]:
    continue
    
  for j in range(i*2,len(array), i):
    array[j] = False
    
sosu = []

for i in range(2,len(array)):
  if array[i]:
    sosu.append(i)
    
count = 0
for i in range(len(sosu)):
  j = 1
  while (n % (sosu[i]**j) == 0) and n != 1:
    n //= (sosu[i]**j)
    count += 1
    j += 1
    
  if n == 1:
    break

if org_n == 1:
  count = 0
  
elif org_n == n:
  count += 1

    
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 prime_len(n):
    a = set()
    while n % 2 == 0:
        a.add(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.add(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.add(n)
    return len(a)


n = int(input())
c = 0
for z in make_divisors(n):
    if prime_len(z) == 1:
        tmp = n / z
        if tmp.is_integer():
            n = tmp
            c += 1
            print(z, n)
        else:
            continue

print(c)

Submission status: Wrong Answer

Solution code:
from math import sqrt, ceil

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

ans = 0
search_list = list(range(2, int(sqrt(N))+1))
if (N > 1) and (N not in search_list):
    search_list.append(N)

for i in search_list:
    if N%i == 0:
        fact = factorization(i)
        if len(fact) == 1:
            N = N // i
            if N >= 1:
                ans += 1
            else:
                break

print(ans)

Submission status: Wrong Answer

Solution code:
from math import log, floor, sqrt


def main():
    n = int(input())
    prime = [2]
    i = 3
    while i * i <= pow(10, 9) + 10:
        if all(i % pp != 0 for pp in prime):
            prime.append(i)
        i += 2
    ans = 1
    is_one = n == 1
    for p in prime:
        if n % p == 0:
            d = floor(log(n * (p - 1) + p, p))
            ans += floor(sqrt(d))
            n //= p * (pow(p, d) - 1) // (p - 1)
        if n <= 1:
            break
    print(ans if not is_one else 0)


if __name__ == '__main__':
    main()

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]

if N == 1:
    print(1)
else:
    a = make_divisors(N)
    if len(a) == 2:
        print(1)
    else:
        b = len(a) / 2
        c = round(b) - 1
        print(c)

Submission status: Wrong Answer

Solution code:
import copy
from collections import defaultdict
N = int(input())
tmp = copy.copy(N)
d = defaultdict(int)
for i in range(2,int(pow(N,0.5))+3):
    while N%i==0:
        N //= i
        d[i] += 1
if N%tmp==0:
    d[N]+=1
ans = 0
for i in d.values():
    tmp = 1
    while i - tmp >= 0:
        i -= tmp
        tmp += 1
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:

import collections
from collections import defaultdict

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

count = 0
n = int(input())
d = defaultdict(int)
ans = prime_factorize(n)
for i in ans:
    d[i] += 1
for i in d.values():
        if i < 3:
            count +=1
        elif i < 6:
            count +=2
        elif i < 10:
            count +=3
        elif i < 15:
            count +=4
        elif i < 21:
            count +=5
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
li = []
while n != 0:
	rem = n % 2
	li.append(rem)
	n //= 2
count = 0
for i in reversed(li):
	if i == 1:
		count += 1
	else:
		break
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
aaa = n
maxi = 2
def prime(aaa):
    if n != 1:
        i = 2
        while i*i <= aaa:
            if aaa % i == 0:
                return False
            i += 1
        return True
    else:
        return False
def divisors(a, i):
    global ans, aaa, maxi
    while i*i <= n:
        if a % i == 0:
            ans += 1
            num = a / i
            aaa = num
            if maxi <= i:
                maxi = i
            divisors(num, i+1)
            break
        i += 1
def divisors2(a, i):
    global ans
    while i <= n:
        if a % i == 0:
            ans += 1
            num = a / i
            divisors(num, i+1)
            break
        i += 1
divisors(n, 2)
divisors(aaa, maxi + 1)
if prime(n):
    ans += 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

cnt = 0
n = int(input())
if n == 1:
  print(0)
else:
  f_list = factorization(n)

  for item in f_list:
    power = item[1]
    counter = 1
    while(True):
      power -= counter
      if power<0:
        break
      cnt+=1
      counter+=1
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
res = 0
p = 1

def f(N):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= N:
        if N % i == 0:
            lower_divisors.append(int(i))
            if i != N // i:
                upper_divisors.append(int(N//i))
        i += 1
    return lower_divisors + upper_divisors[::-1]

while True:
    if N <= 1:
        break
    L = f(N)
    for i in range(len(L)):
        if L[i] > p:
            p = L[i]
            break
    N = N // p
    res += 1
print(res)

Submission status: Wrong Answer

Solution code:
from math import sqrt

def is_prime(n):
  for i in range(2, int(sqrt(n))):
    if n % i == 0:
      return False
  return True

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

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

base=int(input())
tmp=base
num=[]
if is_prime(base):
  num.append(base)
else:
  for i in range(2, base+1):
    if i > tmp:
      break
    if tmp % i == 0 and len(factorization(i)) == 1:
      num.append(i)
      tmp/=i
print(len(num))

Submission status: Wrong Answer

Solution code:
import sys
N=int(input())
ans=0
for i in range(2,int(N**(1/2))+1):
  if N%i==0:
    break
  if i==int(N**(1/2)):
    print(1)
    sys.exit()
i=1
k=1
while N % (2**i) == 0:
  ans+=1
  N=N//(2**i)
  i+=1
while N % 2 == 0:
  N=N//2
f=3
while f*f <= N:
  if N % (f**k) == 0:
    ans+=1
    N=N//(f**k)
    k+=1
  else:
    while N % f == 0:
      N=N//f
    f += 2
    k=1
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

# 初期入力
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:
    q,mod =divmod(N,i)
    if mod ==0:
        count +=1
        N =q
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
n = int(input())
x = factorization(n)
x.sort(key=lambda x: x[-1])
a = [0]
b = 0
for i in range(3,9):
    b += i
    a.append(b)
ans = 0
c = 1
for i in range(len(x)):
    if x[i][1] >= a[c]:
        c += 1
    ans += c
if n == 1:
    print(0)
else:
    print(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

import sys
inp = int(input())
x=prime_factorize(inp)
a=0
xset = set(x)
for i in xset:
  z=x.count(i)
  a+=1
  n=1
  ar=(n*(n+1))/2
  while z>ar:
    a+=1
    n+=1
    ar=(n*(n+1))/2
print(a)

Submission status: Wrong Answer

Solution code:
def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n ** 0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]


def main():
    m = 10 ** 12
    limit = int(m ** 0.5 // 1)
    prime_list = primes(limit)
    for i in range(len(prime_list)):
        n = prime_list[i]
        tmp = n ** 2
        while tmp <= limit:
            if not tmp in prime_list:
                prime_list.append(tmp)
                tmp *= n

    sorted(prime_list)

    N = int(input())

    tmp_n = N
    ans = 0

    for i in prime_list:
        if tmp_n % i == 0:
            ans+=1
            tmp_n /= i
    if ans == 0 and N != 1:
        ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
def isprime(n: int):
    flag = 0
    for N in range(3,int(math.sqrt(n))+1,2):
      if n % N == 0:
        flag = 1
    if flag == 1:
        return False
    else:
        return True
x = int(input())
exponent = [];a = 0;aa = 0;prime_list = [2]
z = x;new_prime_list = [];new_exponent = []
for p in range(3, int(x/2+1)):
    if isprime(p) == True:
        prime_list.append(p)
for s in prime_list:
    while x % s == 0:
        aa += 1;x /= s
    exponent.append(aa)
    aa = 0
QWE = 0
for qwe in exponent:
    if qwe > QWE:
        QWE = qwe
print(QWE)

Submission status: Wrong Answer

Solution code:
import bisect
import math
from typing import Dict, List, NoReturn


def factorize(n: int) -> Dict[int, int]:
    result: Dict[int, int] = {}

    for d in range(2, int(math.sqrt(n)) + 1):
        div_count: int = 0
        while n % d == 0:
            n /= d
            div_count += 1

        result[d] = div_count

        if n == 1:
            break

    return result


def reverse_sum(n: int) -> int:
    sum_of_k: List[int] = [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]

    return bisect.bisect_left(sum_of_k, n)


def main() -> NoReturn:
    n: int = int(input())

    factors: Dict[int, int] = factorize(n)

    answer: int = 0

    for value in factors:
        answer += reverse_sum(value)

    print(answer)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
re = 0
if n == 1:
    print(0)
else:
    for i in range(2, int(math.sqrt(n))+1):
        i2 = 1
        while n % (i**i2) == 0:
            re += 1
            n = n/(i**i2)
            i += 1
    if re == 0:
        print(1)
    else:
        print(re)

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())
    on = n
    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(6, 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)
    #print(numsd)
    r = 0
    while n != 1:
        if not numsd:
            break
        nextn = numsd.popleft()
        if nextn > on:
            continue
        elif n % nextn == 0:
            n = int(n / nextn)
            r += 1
    print(r)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = {}
max_count = 0
while n % 2 == 0:
    if 2 in a:
        a[2] += 1
    else:
        a[2] = 1
#    a.append(2)
    n //= 2
    max_count += 1

f = 3
while f * f <= n:
    tmp_max_count = 1
    if n % f == 0:
        if f in a:
            a[f] += 1
        else:
            a[f] = 1
#        a.append(f)
        n //= f
        tmp_max_count += 1
    else:
        f += 2
    if max_count < tmp_max_count:
        max_count = tmp_max_count

if len(a) == 0:
    cnt = 1
else:
    cnt = 0
    for k, v in a.items():
        d = 1
        while (v - d >= 0):
            v = v - d
            d +=1
            cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
L = N
if L == 1:
    print(0)
else:
    num = 0
    for i in range(2,int(math.sqrt(L))+10):
        if N % i == 0:
            N = N / i
            num = num + 1

    if num == 0:
        print(1)
    else:
        print(num)

Submission status: Wrong Answer

Solution code:
#D
# [[素因数、指数], ...]
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)
count = 0

for k in arr:
    now = 1
    while k[1] >= now:
        k[1] -= now
        now += 1
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
n = N

import math

def func(N,n,cnt):
        for i in range(3, int(math.sqrt(N)) + 2):
                m0 = i
                m = m0
                while n % m == 0:
                        n = n // m
                        m = m * m0
                        cnt +=1
        return (cnt)

cnt = 0

if n == 1:
        ans = 0
else:
        m0 = 2
        m  = m0
        while n % m == 0:
                n = n // m
                m = m * m0
                cnt += 1
        cnt = func(N,n,cnt)

if n!=1 and cnt == 0: #素数の場合 (平方根＋1までには割り切れる数がない)
        ans = 1
else:
        ans = cnt
        
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
i=2
while i*i<=n:
    cnt=0
    while n%i==0:
        n//=i
        cnt+=1
    j=0
    # print(i,cnt)
    for k in range(1,cnt):
        if (k*(k+1))//2<=cnt:
            j=k
    ans+=j
    i+=1
# print('n',n)
if n>1:
    ans+=1
print(ans)

Submission status: Wrong Answer

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

N= int(input().rstrip('\n'))
M=N
lim = math.floor(math.sqrt(N))+10
res = 0
pri=[2]
for i in range(2,lim+1):
  if all(i % x != 0 for x in pri) or i==2:
    if N % i ==0:
      pri.append(i)
      add = 1
      pl = 1
      n = N//i
      while n%i==0:
        pl += 1
        n = n//i
        if pl==((add+1)*(add+2)/2):
          add += 1
      res += add
      N = N//(i**pl)
if M == N:
  res += 1
print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())
counter = 0

prime = False

for j in range(int(n**0.5)):
  if(n%(j+2) == 0):
    break
else:
  prime = True
    
if(n == 1):
  counter = 0
  
if(prime):
  counter = 1
  
else:
  i = 2
  while(i <= n):
    if(n%i == 0):
      n = n/i
      counter = counter + 1
    i = i + 1

print(counter)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys
import math
from collections import Counter
import itertools
import fractions
from decimal import *
#import numpy as np
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################
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=II()


ans = factorization(N)

cnt = 0

for an in ans:
    if an[0] != 1:
        k = an[1]
        i = 1

        if k == 1:
            cnt += 1
        if k == 2:
            cnt += 1
        if k == 3:
            cnt += 2
        if k == 4:
            cnt += 1
        if k == 6:
            cnt += 3
        if k == 10:
            cnt += 4
        if k == 15:
            cnt += 5
        if k == 21:
            cnt += 6
        if k == 28:
            cnt += 7
        if k == 36:
            cnt += 8
        if k == 45:
            cnt += 9
        if k == 55:
            cnt += 10
        if k == 66:
            cnt += 11


print(cnt)

Submission status: Wrong Answer

Solution code:
#23ぐらいまでで良さそう。
z = [2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23]

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

sosuu = primes(1000001)
count = [0] * len(sosuu)
convert = [0] * 56

N = int(input())
ans = 0

flag = True
while (flag):
        flag = False
        for i in range(len(sosuu)):
                if N % sosuu[i] == 0:
                        N = N // sosuu[i]
                        count[i] += 1
                        flag = True

tmp = 0
for i in range(1, 11):
        tmp += i
        convert[tmp] = i
for i in range(1, len(convert)):
        if convert[i] == 0:
                convert[i] = convert[i - 1]


for i in count:
        ans += convert[i]

if N > sosuu[-1] and ans == 0:
        ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
# 引用元
# https://note.nkmk.me/python-prime-factorization/

from collections import Counter
from itertools import combinations
import numpy as np

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 get_list(counter, index):
    ans = []
    for key, val in sorted(counter.items()):
        if val > index:
            ans += [key] * index
        else:
            ans += [key] * val
    return ans

def choice_min_data(counter, min_num):
    temp = sum(counter.values())
    temp_min_num = 10**12
    co_li = None
    for index in range(1, temp+1):
        # flag = False
        to_comb_list = get_list(counter, index)
        for co in combinations(to_comb_list, index):
            check_val = np.prod(co)
            if temp_min_num > check_val > min_num:
                co_li = co
                temp_min_num = check_val
                # flag = True
                break

        # 最小更新せず = 終了
        # if temp_min_num != 10**12 and flag == False:
        #     break

    if co_li is None:
        return None, -1
    else:
        # print(co_li, temp_min_num)
        return counter - Counter(co_li), temp_min_num

def main():
    # ルール
    # 素数p, 整数e: z == p ** e
    # N / z = int(x)
    # zは被らない
    # N を N/zに置き換える
    N = int(input())

    if N <= 1:
        print(0)
        return

    counter = Counter(prime_factorize(N))
    # print(counter)
    ans = 0
    min_num = 0
    while counter is not None:
        counter, min_num = choice_min_data(counter, min_num)
        if min_num == -1:
            break
        ans += 1
    
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())

def factorization(n):
    d = {}
    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
            d[i] = cnt

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

    if d.keys()==[]:
        d[n] = 1

    return d

def calc_a(n):
    a = [1]
    while 1:
        n = n - a[-1]
        if n==0:
            break
        if n >= 0:
            a.append(a[-1]+1)
        else:
            a.append(n)
    return a

z_list = []
ans = 0
fact_dict = factorization(n)

for val in fact_dict.values():
    #print(val, calc_a(val))
    ans += len(calc_a(val))

if ans>0:
    print(ans)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
#D
import math
N = int(input())
Nsyo = N
count = 0
div = 2
divcount = 0
divlist = []
while N > 1 and div <= math.sqrt(N):
    if N%div == 0:
        while N%div == 0:
            N = N/div
            divcount = divcount+1
        divlist.append(divcount)
        divcount = 0
    else:
        pass
    div = div + 1
div = 1
divcount = 0
for i in divlist:
    while i >= div:
        i = i-div
        divcount = divcount + 1
        div = div + 1
        
    count = count +divcount
    divcount = 0
    div = 1
if divlist == [] and N >0:
    count = 1
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

import heapq 
from collections import defaultdict

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

heap = [2]
cand = 3
heapq.heapify(heap)
ans = 0
dict_prime = defaultdict(int)
# dict_prime[2] = 2
cnt = 0

if is_prime(N):
    ans = 1
else:

    while(1):
        if is_prime(N):
            break
        # print(N)
        # cnt += 1
        # if cnt > 10:break

        sub = heapq.heappop(heap)
        # print(sub)
        # print(cand)
        # print(heap)
        # print(cand)
        # print(heapq)
        if N < sub:
            # print(N,sub)
            # print("a")
            break
        if N % sub == 0:
            N = N // sub
            ans += 1
            if sub not in dict_prime:
                dict_prime[sub] = sub
                dict_prime[sub*sub] = sub
            else:
                dict_prime[sub*dict_prime[sub]] = dict_prime[sub]
                # print("a")
            heapq.heappush(heap, sub*dict_prime[sub])

        while(1):
            if is_prime(cand) and cand not in dict_prime:
                heapq.heappush(heap,cand)
                cand += 1
                break
            else:
                cand += 1


# print()
print(ans)
    



# sqrt(N)以下の素数の集合を求める
# heapqにいれる
# 一番小さいので割れなかったらスルー割れたら累乗してheapqへ入れる

# def get_primes(n):
#     ans = []
#     for i in range(1,n+1):
#         if is_prime(i):
#             ans.append(i)
#     return ans


# prime = get_primes(int(N**(1/2)))

Submission status: Wrong Answer

Solution code:
from math import log, floor, sqrt


def main():
    n = int(input())
    prime = [2]
    i = 3
    while i * i <= pow(10, 9) + 10:
        if all(i % pp != 0 for pp in prime):
            prime.append(i)
        i += 1
    ans = 1
    is_one = n == 1
    for p in prime:
        if n % p == 0:
            d = floor(log(n * (p - 1) + p, p))
            ans += floor(sqrt(d))
            print(ans, n, d, p)
            n //= p * (pow(p, d) - 1) // (p - 1)
        if n <= 1:
            break
    print(ans if not is_one else 0)


if __name__ == '__main__':
    main()