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
sys.setrecursionlimit(10 ** 9)
a = int(input())
count = 0
#used = []
#def div_battle(a, first):
#  if a%first == 0:
#    #used.append(first)
#    a /= first
#    count += 1
#  if a==1:
#    return count
#  else:
#    div_battle(a,first+1)
count = 0
first = a
while a!=1:
  if a % first == 0:
    a /= first
    count += 1
    first -= 1
print(count)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
count = 0

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

for i in range(2, int(math.sqrt(n)) + 1):
    temp = True
    if n % i == 0:
        temp = False
        count += 1
        n = n // i
        
if temp == True:
    print(1)
    exit()

print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
r=int(n**0.5)+1
for i in range(2,r):
    if n%i==0:
        ans+=1
        n/=i
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
    
n=int(input())
f=prime_factorize(n)
if len(f)==0:
  print(0)
  exit()
s=set(f)
r=0

def func(m):
  r=1
  for ii in range(m):
    if m>ii+1:
      m-=(ii+1)
      r+=1
    else:
      break
  return r

for ii in s:
  m=f.count(ii)
  #print(m,func(m))
  r+=func(m)
  
print(r)

Submission status: Wrong Answer

Solution code:
from bisect import bisect_right
from collections import defaultdict
import numpy as np
N = int(input())

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

A = np.arange(1, 100)
cumsum_A = A.cumsum()
# print(cumsum_A)


def f(N):
    d = defaultdict(int)
    i = 2
    V = N
    while i * i <= N:
        if V % i == 0:
            V //= i
            d[i] += 1
        else:
            i += 1
    return d


d = f(N)
# print('d', d, len(d))
if len(d) == 0:
    print(1)
    exit()

ans = 0
for key, value in zip(d.keys(), d.values()):
    idx = bisect_right(cumsum_A, value)
    ans += idx
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(cnt)

    if temp!=1:
        arr.append(1)

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

    return arr
ans=0
n=int(input())
L=factorization(n)
if n>1:
    for l in L:
        tmp=0
        for i in range(1,l+1):
            tmp+=i
            if tmp==l:
                ans+=i
                break
            if tmp>l:
                ans+=1
                break
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(0.5*i*(i+1)) for i in range(10)]
import math
res = 0
top = int(math.sqrt(N))
for i in range(2,top):
    count = 0
    while N%i == 0:
        N = N//i
        count += 1
    for j in range(10):
        if count < a[j]:
            res += (j-1)
            break
print(res)

Submission status: Wrong Answer

Solution code:
import collections
n = int(input())
if n == 1 or n == 2 or n == 3:
    print(0)
else:
    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 = collections.Counter(prime_factorize(n))

    ans = 0
    if len(c) == 1:
        if c.values() == 1:
            ans += 1
        else:
            for k in range(1,100):
                if k/2*(2+(k-1)) >= list(c.values())[0]:
                    ans += k
                    break
    else:
        i = 0
        j = 0
        for l in range(len(c)):
            i == list(c.keys())[l]
            j = list(c.values())[l]
            if j == 1 or j == 2:
                ans += 1
            else:
                for k in range(1,100):
                    if k/2*(2+(k-1)) >= j:
                        ans += k
                        break

    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

N = int(input())
A = prime_factorize(N)

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

k = 1
cnt = 1

for i in range(1,len(A)):
    if A[i] == A[i-1]:
        k += 1
        if N % (A[i]**(k)) == 0:
            N = N //(A[i]**(k))
            cnt += 1
    else:
        k = 1
        if N % (A[i]) == 0:
            N = N//(A[i])
            cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
X=[0]*(10**6+1)
if n==1:
    ans=0
else:
    for i in range(2,int(math.sqrt(n)+1)):
        cnt=0
        while n%i==0:
            n//=i
            cnt+=1
        X[i]=cnt
    ans=0
    for x in X:
        if x>=21:
            ans+=6
        elif x>=15:
            ans+=5
        elif x>=10:
            ans+=4
        elif x>=6:
            ans+=3
        elif x>=3:
            ans+=2
        elif x>=1:
            ans+=1

    if all([x==0 for x in X]):
        ans=1

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
import math
import numpy as np
t = []
b = n

for i in range(int(math.sqrt(n))-1):
    if b >= i+2:
        if b % (i + 2) == 0:
            t.append(0)
            while b % (i + 2) == 0:
                t[-1] += 1
                b /= (i+2)
    # print('a')
ans = 0
# print(t)
# exit()
for i in t:
    count = 1
    while i >= count:
        ans += 1
        i = i - count
        count += 1

if n != 1 and ans == 0:
    print('1')
    exit()
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

num = int(input())
val = factorization(num)
ans = 0
for x in val:
    if x[0] == 1: break
    val = 0
    for i in range(40):
        val += i + 1
        if x[1] <= val:
            ans += i + 1
            break
print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    from math import log
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    N = int(input())
    prime = [True for i in range(int(N**.5)+1)]
    max_ = int(N ** .5) + 1
    ans = 0
    if N == 1:
        print(0)
        exit()

    for p in range(2, max_):
        if not prime[p]:
            continue
        for q in range(p, max_, p):
            prime[q] = False
        if N % p != 0:
            continue
        # print('p = {}'.format(p))
        t = 1
        p_ = p
        while N % p_ == 0:
            t += 1
            p_ *= p
        if N % p_ > 0:
            t -= 1
        l, r = 0, 10 ** 6
        # print('t = {}'.format(t))
        while l + 1 < r:
            m = (l + r) // 2
            if m * (m + 1) // 2 <= t:
                l = m
            else:
                r = m
        # print('ans += {}'.format(l))
        ans += l
    if ans == 0:
        ans = 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
lst = []
for i in range(2, int(math.sqrt(n))+1):
  if n % i == 0:
    lst.append(i)
lst.append(n)
c = 0
for i in range(len(lst)):
  a = lst.pop(0)
  if n % a == 0:
    n = n / a
    c += 1
if n == 1:
  print(0)
else:
  print(c)

Submission status: Wrong Answer

Solution code:
n = int(input())
N = n
ans = 0
def pri_me(x):
    if x == 2:
        return True
    for i in range(3,int(x**0.5)+1):
        if x%i==0:
            return False
    return True
if n==1:
    print(0)
    exit()
if pri_me(n):
    print(1)
    exit()
for i in range(2,int(N**0.5)+4):
    if n%i==0:
        n=n//i
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
def era(num):
    input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)]
    input_list[0] = input_list[1] = False
    input_list[2] = input_list[3] = input_list[5] = True
    sqrt = num**0.5

    for serial in range(3, num, 2):

        if serial >= sqrt:
            return input_list

        for s in range(serial ** 2, num, serial): 
            input_list[s] = False

N=int(input())
if N<25:
    Prime=[2,3,5]
else:
    input_list=era(int(N**0.5)+1)
    Prime=[i for i, b in enumerate(input_list) if b == True]

Fac={}

for p in Prime:
    while N%p==0:
        N//=p
        if p in Fac:
            Fac[p]+=1
        else:
            Fac[p]=1

ans=0
for k in Fac:
    nec=1
    while True:
        if Fac[k]>=nec:
            ans+=1
            Fac[k]-=nec
            nec+=1
        else:
            break
if len(Fac)==0 and N>1:
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())

def func(n):
  a=[]
  f=2
  while f*f<=n:
    if n%f==0:
      a.append(f)
      n//=f
    f+=1
  if n!=1 and f-1!=n:
    a.append(n)
  return a

print(len(func(n)))

Submission status: Wrong Answer

Solution code:
from collections import Counter

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

def check(j):
    if j <= 2:
        return 1
    else:
        return int((j * 2) ** 0.5)


N = int(input())
ans = 0
for i, j in prime_factorize(N).items():
    ans += check(j)
print(ans)

Submission status: Wrong Answer

Solution code:
from math import *

n=int(input())
val=n
ans=0
for i in range(2,1000001):
	if val==1:
		break
	if val%i==0:
		val=val//i
		ans+=1

if val!=1 and val%n==0:
	val=val//n
	ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
import math
import scipy as sp
import queue
import collections

MOD = 10 ** 9 + 7
INF = 10 ** 9

def main(kwargs):
    n = kwargs["n"]
    arr = factorization(n)

    res = 0

    for i in arr:
        res += sankaku(i[1])

    if n == 1:
        res = 0

    return res

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

def sankaku(n):
    res = 1

    while True:
        n -= res

        if n <= 0:
            break

        res += 1

    return res

if __name__ == "__main__":
    kwargs = {}

    cin = input().split()
    kwargs["n"] = [int(i) for i in cin][0]

    cout = main(kwargs)
    print(cout)

Submission status: Wrong Answer

Solution code:
def sieve(x):
    """
    Sieve of Eratosthenes
    :param x: max value
    :return: list of bool
    """

    is_prime = [True] * (x + 1)
    is_prime[0] = is_prime[1] = False

    for i in range(2, x + 1):
        if is_prime[i]:
            for j in range(i * 2, x + 1, i):
                is_prime[j] = False

    return is_prime


def f(x):
    if x < 2:
        return False

    i = 2
    while i * i <= x:
        if x % i == 0:
            return False
        i += 1

    return True


n = int(input())

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

is_prime = sieve(10 ** 7)
primes = [i for i, e in enumerate(is_prime) if e]

ans = 0
used = set()
for e in primes:
    div = e
    while div <= n:
        if n % div == 0:
            ans += 1
            n //= div
            used.add(div)
        div *= e

if n != 1 and n not in used:
    ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

data = factorization(n)
# print(data)
count = 0
for i in data:
  count += math.ceil(i[1] / 2)
print(count)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
n = int(input())
store = defaultdict(int)
num = 2
sq = int(n**0.5)
while num <= sq:
    if n % num == 0:
        store[num] += 1
        n = n // num
    else:
        num += 1
if len(store) == 0:
    if n <= 1:
        print(0)
    else:
        print(1)
else:
    count = 0
    for v in store.values():
        k = v
        for i in range(1, v+1):
            if k >= i:
                k -= i
                count += 1
            else:
                break
    print(count)

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

current = 2
ans = factorization(N)

cnt = 0

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

        if k == 2:
            cnt += 1
        else:

            while k >= 1:
                k -= i
                cnt+=1
                i += 1





print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy

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

if __name__ == "__main__":
    n = int(input())
    a = prime_factorize(n)
    c = collections.Counter(a)
    d = []
    for key,val in c.items():
        d.append((val+1)//2)
    print(sum(d))

Submission status: Wrong Answer

Solution code:
import math
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())
a = factorization(n)
cnt = 0
for i in a:
    #print(i,math.floor((math.sqrt(1+8*i[1])-1)/2))
    cnt += math.floor((math.sqrt(1+8*i[1])-1)/2)
print(cnt)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    n = II()
    ans = 0
    d = defaultdict(int)
    d[1] = 1 
    for i in range(2, int(sqrt(n)) + 1):
        x = i
        while 1:
            if n % x == 0 and d[x] != 1:
                ans += 1
                n //= x
                d[x] = 1
            else:
                break
            x *= i
    if d[n]:
        print(ans)
    else:
        print(ans + 1)
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

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

# 素数判定関数
def isPrime(num):
    # 2未満の数字は素数ではない
    if num < 2: return False
    # 2は素数
    elif num == 2: return True
    # 偶数は素数ではない
    elif num % 2 == 0: return False

    # 3 ~ numまでループし、途中で割り切れる数があるか検索
    # 途中で割り切れる場合は素数ではない
    for i in range(3, math.floor(math.sqrt(num))+1, 2):
        if num % i == 0:
            return False

    # 素数
    return True

# 素数判定
def callIsPrime(input_num=1000):
    numbers = []
    # ループしながら素数を検索する
    for i in range(1, input_num):
        if isPrime(i):
            numbers.append(i)

    # 素数配列を返す
    return numbers

# 関数の呼び出し

P=callIsPrime(int(math.sqrt(N)))
ans=0
ans+=isPrime(N)
for i in P:
  count=1
  while(N%(i**count)==0):
    ans+=1
    N=N//(i**count)
    #print(i**count)
    count+=1

#print(make_divisors(N))
#print(N)
print(ans)

Submission status: Wrong Answer

Solution code:
import math

def is_prime(n):
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
    
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct

n = int(input())

if n == 1:
    print(0)
elif is_prime(n) == True:
    print(1)
else:
    fct = factorize(n)
    print(len(fct))

Submission status: Wrong Answer

Solution code:
import math
M = int(input())
N = M
sq = math.floor(math.sqrt(N+0.01))
sum = 0
count = 0
while(N%2 == 0):
    count += 1
    N /= 2
sum += int(math.sqrt(8*count+1.00001)-1)//2
for i in range(3, sq+1, 6):
    if(N%i != 0 and N%(i+2) != 0):
        continue
    count = 0
    while(N%i == 0):
        count += 1
        N /= i
    sum += int(math.sqrt(8*count+1.0000001)-1)//2
    count = 0
    if(N%(i+2) != 0):
        continue
    while(N%(i+2) == 0):
        count += 1
        N /= i+2
    sum += int(math.sqrt(8*count+1.0000001)-1)//2
    if(N == 1):
        print(sum)
        exit()
if(N == M):
    print("1")
    exit()
if(N != 1):
    print(sum + 1)
else:
    print(sum)

Submission status: Wrong Answer

Solution code:
from collections import deque
n = int(input())


def factorization(n):
    retval = []
    tmp = n
    for i in range(2, int(-(-n**.5//1))+1):
        if tmp % i == 0:
            cnt = 0
            while tmp % i == 0:
                cnt += 1
                tmp //= i
            retval.extend([i]*cnt)
    if tmp != 1:
        retval.append(tmp)
    return retval


fact = factorization(n)
fact = deque(fact)
m = len(fact)
# print(fact)
ans = 0
used = set()
pop_cnt = 1
end = 0
while fact:
    if m == 0:
        pop_cnt += 1
        m = len(fact)

    pops = []
    x = 1
    for _ in range(pop_cnt):
        if not fact:
            end = 1
            break
        tmp = fact.popleft()
        pops.append(tmp)
        x *= tmp
    if end:
        break

    if x in used:
        fact.extend(pops)
    else:
        used.add(x)
        ans += 1
    m -= 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
count = 0

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

for i in range(2, int(math.sqrt(n)) + 1):
    temp = True
    if n % i == 0:
        temp = False
        count += 1
        n = n // i
    if temp == True:
        print(1)
        exit()

print(count)

Submission status: Wrong Answer

Solution code:
from collections import Counter
from math import sqrt

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

if not n >= 1:
    print(0)
    
else:
    count = 0
    for i in Counter(prime_factorize(n)).values():
        sub_count = int(sqrt(i)) + 1
        while sub_count * (sub_count + 1) > 2 * i:
            sub_count -= 1
        count += sub_count
    print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
lst=[]
i=2
while i**2<=n:
    if n%i==0:
        n//=i
        lst.append(i)
        continue
    i+=1
lst.append(n)
from collections import Counter
dic=dict(Counter(lst))
s=0
for i in dic:
    n=dic[i]
    k=0
    while n>=0:
        s+=1
        k+=1
        n-=k
    s-=1
print(s)

Submission status: Wrong Answer

Solution code:
import collections

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 judge(N):
  n = 0
  cnt = 0
  while n < N:
    n += n+1
    if n<=N:
      cnt += 1
  return cnt


c = collections.Counter(prime_factorize(N))

ans = 0

keys = c.keys()

for i in range(len(keys)):
  ans += judge(c[list(keys)[i]])

print(ans)

Submission status: Wrong Answer

Solution code:
def f(i,n):
  ans =0
  cnt = i
  while n%cnt == 0:
    n//=cnt
    cnt*=i
    ans +=1
  while n%i ==0:
    n//=i
  return n,ans

n = int(input())
nn = n
i = 2
ans = 0
while i <= int(n**0.5)+1:
  if n%i ==0:
    n,a = f(i,n)
    nn =n
    ans += a
  i += 1
  
if n == nn:
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
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

sosuu = prime_factorize(n)
z = []

import itertools

for i in range(len(sosuu)):
    c = list(itertools.combinations(sosuu,i+1))
    
    for j in c:
        add = 1
        
        for k in range(i+1):
            add *= j[k]
            
        z.append(add)
        
z = sorted(set(z))

ans = 0
        
for i in z:
    if n % i == 0:
        n //= i
        ans += 1
        
    if n == 1:
        break
        
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
if n == 1:
  print(1)
  exit(0)
  
pows = []
upto = int(math.sqrt(n))
for i in range(2, upto):
  if n % i == 0:
    cc = 0
    while n % i == 0:
      n //= i
      cc += 1
    pows.append(cc)

    
if len(pows) == 0:
  print(1)
  exit(0)
  
ans = 0
# print(pows)
for pp in pows:
  start = 1
  cc = 0
  while pp - start >= 0:
    cc += 1
    pp -= start
    start += 1
    
  ans += cc

print(ans)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
X=[0]*(10**6+1)
for i in range(2,int(math.sqrt(n)+1)):
    cnt=0
    while n%i==0:
        n//=i
        cnt+=1
    X[i]=cnt
ans=0
for x in X:
    if x>=21:
        ans+=6
    elif x>=15:
        ans+=5
    elif x>=10:
        ans+=4
    elif x>=6:
        ans+=3
    elif x>=3:
        ans+=2
    elif x>=1:
        ans+=1
if n==1:
    ans=0
else:
    if all([x==0 for x in X]):
        ans=1

print(ans)

Submission status: Wrong Answer

Solution code:
import math
ans = 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

arr = factorization(int(input()))

for i in range(len(arr)):
    arfa = arr[i][1]
    ans += math.floor((-1+math.sqrt(1+8*arfa))/2)
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter


def pf(x):
  if x == 1:
    return []
  r = []
  while not x & 1:
    r += [2]
    x >>= 1
  i = 3
  m = int(x ** 0.5)
  while i < m + 1:
    while not x % i:
      r += [i]
      x //= i
    i += 2
  return r or [x]


def main():
  n = int(input())
  
  pp = pf(n)
  
  cc = Counter(pp)
  
  res = 0
  
  for c, v in cc.items():
    i = 1
    while True:
      if i > v:
        break
      v -= i
      res += 1
      i += 1      
  print(res)

Submission status: Wrong Answer

Solution code:

answer = 0

def prime(N):
    f = []
    c = 0
    r = int(N**0.5)
    for i in range(2, r+2):
        while N % i == 0:
            c+= 1
            N = N //i
        if c != 0:
            f.append((i,c))
            c = 0
    if N!=1:
        f.append((N,1))
    return f
N = int(input())
import sys
A = []
a = 0
f = prime(N)
for p, c in f:
    for i in range(1, c+1):
        if c > 0 and N >=p**i:
            print(p**i)
            c -= i
            N //= p**i
            A.append(p**i)
            a += 1
c = 1
for x in A:
    c *= x
print(a)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
a = np.zeros(int(N**0.5)+1)
c = 0
i = 2
m = 0
while i < N**0.5:
    if N % i == 0:
        a[i] += 1
        N = N / i
        m = i
        i -= 1
    i += 1
    if N == 1:
        break 
for j in range(2, m+1):
    if a[j] != 0:
        d = 0
        while a[j] > d:
            a[j] -= d+1
            d += 1
        c += d
print(c+1)

Submission status: Wrong Answer

Solution code:
n=int(input())
count=0
z=2
p=1
while(n>1):
    if(z==100 and count<=1):
        break
    if(z>n):
        break
    if n%(z**p)==0:
        n=n//(z**p)
        p+=1
        count+=1
    else:
        p=1
        z+=1
if n>1 and count==0:
    print(1)
else:
    print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n==1:
    print(0)
def sosuu(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True
if sosuu(n):
    print(1)
    exit()
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

 


ff=factorization(n) 
d=[]
ans=0
for i,j in ff:
    tmp=0
    while j>0:
        tmp+=1
        j-=tmp

        if j<0:
            break
        ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
import collections
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
c =  collections.Counter(prime_factorize(n))
a = c.values()

count =0
for i in a:
    k=1
    for j in range(n):
        i-=k
        k +=j+1

        count +=1
        if (i<=j+1):
            break
    
print(count)

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

    return arr


res = factorization(N)
sum = 0

if len(res) == 0:
    print(0)
else:
    for fact in res:
        bin_ = '{:b}'.format(fact[1] - 1)
        sum += len(bin_)

    print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = int(n**0.5)+1

if n == 1:
    print(0)
    exit()
ans = 0
for i in range(2, a+1):
    j = 1
    while 1:
        if n % pow(i, j) == 0:
            n = n//pow(i, j)
            ans += 1
            j += 1
        else:
            break
if ans == 0:
    print(1)
    exit()
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())


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


D = sorted(make_divisors(N))

ans = 0
i = 0
while N >= 2 and i <= len(D)-1:
    if D[i] != 1 and N % D[i] == 0:
        ans += 1
        N //= D[i]
    i += 1
print(ans)