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

N = int(input())
# a,b = map(int,sys.stdin.readline().split())
# arr= list(map(int,sys.stdin.readline().split()))

n= int(1000000000000 ** 0.5)
a = [False,False] + [True]*(n-1)
primes=[]

for i in range(2,n+1):
  if a[i]:
    primes.append(i)
    for j in range(2*i, n+1, i):
        a[j] = False
        
ans_dict = {}

# 1일 경우
if N == 1:
    print(0)
    exit()
else:
    i=0
    while N!=1:
        try:
            if N%primes[i] == 0:
                N = N//primes[i]
                if primes[i] in ans_dict:
                    ans_dict[primes[i]] +=1
                else:
                    ans_dict[primes[i]] = 1
            else:
                i+=1
        except:
            print(1)
            exit()
    ans = 0
    for i in ans_dict:
        m = ans_dict[i]
        j = 1
        while m-j >= 0:
            m -= j
            j+=1
            ans+=1
    print(ans)

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())
# a,b = map(int,sys.stdin.readline().split())
# arr= list(map(int,sys.stdin.readline().split()))

n= int(N ** 0.5)
a = [False,False] + [True]*(n-1)
primes=[]

for i in range(2,n+1):
  if a[i]:
    primes.append(i)
    for j in range(2*i, n+1, i):
        a[j] = False
        
ans_dict = {}

# 1일 경우
if N == 1:
    print(0)
    exit()
else:
    i=0
    while N!=1:
        try:
            if N%primes[i] == 0:
                N = N//primes[i]
                if primes[i] in ans_dict:
                    ans_dict[primes[i]] +=1
                else:
                    ans_dict[primes[i]] = 1
            else:
                i+=1
        except:
            print(1)
            exit()
    ans = 0
    for i in ans_dict:
        m = ans_dict[i]
        j = 1
        while m-j >= 0:
            m -= j
            j+=1
            ans+=1
    print(ans)

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())
# a,b = map(int,sys.stdin.readline().split())
# arr= list(map(int,sys.stdin.readline().split()))

n= int(N ** 0.5)
a = [False,False] + [True]*(n-1)
primes=[]

for i in range(2,n+1):
  if a[i]:
    primes.append(i)
    for j in range(2*i, n+1, i):
        a[j] = False
        
ans_dict = {}

# 1일 경우
if N == 1:
    print(0)
    exit()
else:
    i = 0
    while N!=1:
        if len(primes) == i:
            print(1)
            exit()
        elif N%primes[i] == 0:
            N = N//primes[i]
            if primes[i] in ans_dict:
                ans_dict[primes[i]] +=1
            else:
                ans_dict[primes[i]] = 1
        else:
            i+=1
ans = 0
for i in ans_dict:
    m = ans_dict[i]
    j = 1
    while m-j >= 0:
        m -= j
        j+=1
        ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())
# a,b = map(int,sys.stdin.readline().split())
# arr= list(map(int,sys.stdin.readline().split()))

n= int(N ** 0.5)
a = [False,False] + [True]*(n-1)
primes=[]

for i in range(2,n+1):
  if a[i]:
    primes.append(i)
    for j in range(2*i, n+1, i):
        a[j] = False
        
ans_dict = {}

# 1일 경우
if N == 1:
    print(0)
    exit()
else:
    i = 0
    while N!=1:
        if len(primes) == i:
            print(1)
            exit()
        elif N%primes[i] == 0:
            N = N//primes[i]
            if primes[i] in ans_dict:
                ans_dict[primes[i]] +=1
            else:
                ans_dict[primes[i]] = 1
        else:
            i+=1
ans = 0
for i in ans_dict:
    m = ans_dict[i]
    j = 1
    while m-j > 0:
        j+=1
        ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
primes = {}
for num in range(2, int(N**0.5)+1):
  while N%num == 0:
    if num in primes:
      primes[num] += 1
    else:
      primes[num] = 1
    N //= num
ans = 0
# print(primes)
for p in primes.values():
  n = 1
  while n*(n+1)//2 <= p:
    n += 1
  ans += n-1
if ans == 0 and N > 1:
  ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
RN = int(N**0.5)
for num in range(2, RN+1):
  d = num
  while N%d == 0:
    ans += 1
    N //= d
    d *= num
  if N == 0:
    break
if RN < N :
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for num in range(2, int(N**0.5)+1):
  if N%num == 0:
    ans += 1
    N //= num
  if N == 0:
    break
if N > 1:
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for num in range(2, int(N**0.5)+1):
  if N%num == 0:
    ans += 1
    N //= num
if ans == 0 and N > 1:
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
def fac(n):
    arr=[]
    temp=n
    for i in range(2,math.ceil(math.sqrt(n)+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
l=fac(n)
ans=0
for i in range(len(l)):
    count=l[i][1]
    p=0
    k=1
    while count>0:
        if count-k<0:
            break
        p+=1
        count-=k
        k+=1
    ans+=p
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
def solve(n):
    if n == 1:
        return 0
    ans = 0
    f = []
    for i in range(2, int(n ** 0.5) + 2):
        cnt = 0
        while n % i == 0:
            n /= i
            cnt += 1
            if n % i != 0:
                f.append([i, cnt])

    if len(f) == 0:
        return 1
    
    for c in f:
        for i in range(1, int(c[1] ** 0.5) + 2):
            if i * (i + 1) / 2 <= c[1] < (i + 1) * (i + 2) / 2:
                ans += i
    
    return ans

print(solve(n))

Submission status: Wrong Answer

Solution code:
n = int(input())
def solve(n):
    if n == 1:
        return 0
    ans = 0
    f = []
    for i in range(2, int(n ** 0.5) + 1):
        cnt = 0
        while n % i == 0:
            n /= i
            cnt += 1
            if n % i != 0:
                f.append([i, cnt])

    if len(f) == 0:
        return 1
    
    for c in f:
        for i in range(1, int(c[1] ** 0.5) + 2):
            if i * (i + 1) / 2 <= c[1] < (i + 1) * (i + 2) / 2:
                ans += i
    
    return ans

print(solve(n))

Submission status: Wrong Answer

Solution code:
n = int(input())
def solve(n):
    if n == 1:
        return 0
    ans = 0
    f = []
    for i in range(2, int(n ** 0.5) + 1):
        cnt = 0
        while n % i == 0:
            n /= i
            cnt += 1
            if n % i != 0:
                f.append([i, cnt])
    print(f)

    if len(f) == 0:
        return 1
    
    for c in f:
        for i in range(1, int(c[1] ** 0.5) + 2):
            if i * (i + 1) / 2 <= c[1] < (i + 1) * (i + 2) / 2:
                ans += i
    
    return ans

print(solve(n))

Submission status: Wrong Answer

Solution code:
n = int(input())

def solve(n):
    res = 0
    for i in range(2, int(n ** 0.5) + 2):
        cnt = 0
        while n % pow(i, cnt + 1) == 0:
            n /= pow(i, cnt + 1)
            cnt += 1
            if n % pow(i, cnt + 1) != 0:
                res += cnt
                while n % i == 0:
                    n /= i
    
    if n != 1:
            res = 1
    
    return res

print(solve(n))

Submission status: Wrong Answer

Solution code:
n = int(input())

def solve(n):
    res = 0
    for i in range(2, int(n ** 0.5) + 2):
        cnt = 0
        while n % pow(i, cnt + 1) == 0:
            n /= pow(i, cnt + 1)
            cnt += 1
            if n % pow(i, cnt + 1) != 0:
                res += cnt
                break
    
    if n != 1:
            res = 1
    
    return res

print(solve(n))

Submission status: Wrong Answer

Solution code:
n = int(input())

def solve(n):
    res = 0
    for i in range(2, int(n ** 0.5) + 1):
        cnt = 0
        while n % pow(i, cnt + 1) == 0:
            n /= pow(i, cnt + 1)
            cnt += 1
            if n % pow(i, cnt + 1) != 0:
                res += cnt
                break
    
    if n != 1:
            res = 1
    
    return res

print(solve(n))

Submission status: Wrong Answer

Solution code:
n = int(input())

def solve(n):
    res = 0
    for i in range(2, int(n ** 0.5) + 1):
        cnt = 0
        while n % pow(i, cnt + 1) == 0:
            n /= pow(i, cnt + 1)
            cnt += 1
            if n % pow(i, cnt + 1) != 0:
                res += cnt
                break
    
    if n != 1:
            res += 1
    
    return res

print(solve(n))

Submission status: Wrong Answer

Solution code:
n = int(input())

def solve(n):
    res = 0
    for i in range(2, int(n ** 0.5) + 1):
        cnt = 0
        while n % pow(i, cnt + 1) == 0:
            n /= pow(i, cnt + 1)
            cnt += 1
            if n % pow(i, cnt + 1) != 0:
                res += cnt
    
    return res

print(solve(n))

Submission status: Wrong Answer

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

a = []
b = []
for i in range(2,int(math.sqrt(n))+1):
    if n % i == 0:
        n //= i
        a.append(n)
        b.append(i)

if len(b) == 0:
    print(1)
else:
    print(len(b))

Submission status: Wrong Answer

Solution code:
import collections

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f**2 <= 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())

if N <= 1:
  print(0)
  exit()
else:
  c = collections.Counter(prime_factorize(N))

  K = [sum(range(1,i)) for i in range(2,10)]
  #print(K)
 
  for i in c:
    for j in range(len(K)):
      if c[i] < K[j]:
        count += j
        break

  print(count)

Submission status: Wrong Answer

Solution code:
import collections

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f**2 <= 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())
c = collections.Counter(prime_factorize(N))

K = [sum(range(1,i)) for i in range(2,10)]
#print(K)
 
for i in c:
  for j in range(len(K)):
    if c[i] < K[j]:
      count += j
      break
      
print(count)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
Max = 10**6
count = 0

def sosu(x):
  for i in range(2,int(math.sqrt(n))+1):
    if x % i == 0:
      return False
  return True

if sosu(n):
  print(count +1)
  exit()

alst = [0] * Max
alst[0] = 2
alst[1] = 1
for i in range(2,Max):
  for j in range(i, Max, i):
    alst[j] += 1
    if alst[j] >= 2:
      alst[j] = 2
      break

Prime = []
for i in range(1,Max):
  if alst[i] == 1:
    Prime.append(int(i))

p = len(Prime)
PF = [0]*Max


for i in range(1,p):
  if n%Prime[i] == 0:
    for j in range(20,1,-1):
      if n%Prime[i]**j == 0:
        count += 1
        PF[i] = j
        n = n / Prime[i]
        if sosu(n):
          print(count + 1)
          exit()
          
print(count)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
Max = 10**6
count = 0

def sosu(x):
  for i in range(2,int(math.sqrt(n))+1):
    if n % i == 0:
      return False
  return True

if sosu(n):
  print(count +1)
  exit()

alst = [0] * Max
alst[0] = 2
alst[1] = 1
for i in range(2,Max):
  for j in range(i, Max, i):
    alst[j] += 1
    if alst[j] >= 2:
      alst[j] = 2
      break

Prime = []
for i in range(1,Max):
  if alst[i] == 1:
    Prime.append(int(i))

p = len(Prime)
PF = [0]*Max


for i in range(1,p):
  if n%Prime[i] == 0:
    for j in range(20,1,-1):
      if n%Prime[i]**j == 0:
        count += 1
        PF[i] = j
        n = n / Prime[i]
        if sosu(n):
          print(count + 1)
          exit()
          
print(count)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
Max = 10**6
count = 0

def sosu(x):
  for i in range(2,int(math.sqrt(n))+1):
    if n % i == 0:
      return False
  return True

if sosu(n):
  print(count +1)
  exit()

alst = [0] * Max
alst[0] = 2
alst[1] = 1
for i in range(2,Max):
  for j in range(i, Max, i):
    alst[j] += 1
    if alst[j] >= 2:
      alst[j] = 2
      break

Prime = []
for i in range(1,Max):
  if alst[i] == 1:
    Prime.append(int(i))

p = len(Prime)
PF = [0]*Max


for i in range(1,p):
  if n%Prime[i] == 0:
    for j in range(20,1,-1):
      if n%Prime[i]**j == 0:
        count += 1
        PF[i] = j
        n = n / Prime[i]
        sosu(n)
print(count)

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
l=prime_factorize(N)
L=set(l)
print(l,L)
z=0
for j in L:
  i=1
  while i*(i+1)//2<=l.count(j):
    i+=1
  z+=i-1;print(z)
print(z)

Submission status: Wrong Answer

Solution code:
from collections import Counter
import math

N = int(input())
c = Counter()
# create sieve
#MAXLEN = math.ceil(math.sqrt(N+1))+1
#sv = [False] * (MAXLEN+1)
#pr = list()
#for i in range(2, MAXLEN+1):
#    if sv[i]: continue
#    pr.append(i)
#    for j in range(i, MAXLEN+1, i):
#        sv[j] = True
#if N!=1: pr.append(N)

for i in range(2, math.ceil(math.sqrt(N)+1)):
    while N%i == 0:
        c.update([i])
        N = N // i
            
def R(n):
    ret = 0
    for i in range(1, n+1):
        if n>=i:
            ret += 1
            n -= i
        else:
            break
    return ret
 
ans = 0
for n in c:
    ans += R(c[n])
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter
import math

N = int(input())
c = Counter()
# create sieve
MAXLEN = math.ceil(math.sqrt(N+1))+1
sv = [False] * (MAXLEN+1)
pr = list()
for i in range(2, MAXLEN+1):
    if sv[i]: continue
    pr.append(i)
    for j in range(i, MAXLEN+1, i):
        sv[j] = True
if N!=1: pr.append(N)

i = 2
for i in range(len(pr)):
    p = pr[i]
    while N%p == 0:
        c.update([p])
        N = N // p
            
def R(n):
    ret = 0
    for i in range(1, n+1):
        if n>=i:
            ret += 1
            n -= i
        else:
            break
    return ret
 
ans = 0
for n in c:
    ans += R(c[n])
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
nums = []
exps = {}
import math
p = 2
while p * p <= N:
  if N % p == 0:
    nums.append(p)
    e = 0
    z = p
    while True:
      if N % z == 0:
        z *= p
        e += 1
      else:
        exps[p] = e
        break
#    print(p, exps[p])
    N /= p ** exps[p]
    if N <= 1:
      break
  if p == 2:
    p  = 3
  else:
    p += 2
if not len(nums) and N >= 2:
  exps[N] = 1
  nums.append(N)

import numpy as np
prod = 0
for p in nums:
  num = 0
  cum = 0
  while True:
    cum += num
    num += 1
    if exps[p] - cum < num:
      break
  prod += num - 1
print(prod)

Submission status: Wrong Answer

Solution code:
N = int(input())
nums = []
exps = {}
import math
p = 2
while p * p <= N:
  if N % p == 0:
    nums.append(p)
    e = 0
    z = p
    while True:
      if N % z == 0:
        z *= p
        e += 1
      else:
        exps[p] = e
        break
#    print(p, exps[p])
    N /= p ** exps[p]
    if N <= 1:
      break
  if p == 2:
    p  = 3
  else:
    p += 2
if not len(nums):
  exps[N] = 1
  nums.append(N)

import numpy as np
prod = 0
for p in nums:
  num = 0
  cum = 0
  while True:
    cum += num
    num += 1
    if exps[p] - cum < num:
      break
  prod += num - 1
print(prod)

Submission status: Wrong Answer

Solution code:
N = int(input())
nums = []
exps = {}
import math
for p in range(2, int(math.sqrt(N))+1):
  if N % p == 0:
    nums.append(p)
    e = 0
    z = p
    while True:
      if N % z == 0:
        z *= p
        e += 1
      else:
        exps[p] = e
        break
#    print(p, exps[p])
    N /= p ** exps[p]
    if N <= 1:
      break
if not len(nums):
  exps[N] = 1
  nums.append(N)

import numpy as np
prod = 0
for p in nums:
  num = 0
  cum = 0
  while True:
    cum += num
    num += 1
    if exps[p] - cum < num:
      break
      
#  print(p, exps[p], num - 1)
  prod += num - 1
print(prod)

Submission status: Wrong Answer

Solution code:
N = int(input())
nums = []
exps = {}
import math
for p in range(2, N):#int(math.sqrt(N))+1):
  if N % p == 0:
    nums.append(p)
    e = 0
    z = p
    while True:
      if N % z == 0:
        z *= p
        e += 1
      else:
        exps[p] = e
        break
#    print(p, exps[p])
    N /= p ** exps[p]
    if N <= 1:
      break
if not len(nums):
  exps[N] = 1
  nums.append(N)

import numpy as np
prod = 0
for p in nums:
  num = 0
  cum = 0
  while True:
    cum += num
    num += 1
    if exps[p] - cum < num:
      break
      
#  print(p, exps[p], num - 1)
  prod += num - 1
print(prod)

Submission status: Wrong Answer

Solution code:
N = int(input())
nums = []
exps = {}
import math
for p in range(2, N):#int(math.sqrt(N))+1):
  if N % p == 0:
    nums.append(p)
    e = 0
    z = p
    while True:
      if N % z == 0:
        z *= p
        e += 1
      else:
        exps[p] = e
        break
    print(p, exps[p])
    N /= p ** exps[p]
    if N <= 1:
      break
if not len(nums):
  exps[N] = 1
  nums.append(N)

import numpy as np
prod = 0
for p in nums:
  num = 0
  cum = 0
  while True:
    cum += num
    num += 1
    if exps[p] - cum < num:
      break
      
#  print(p, exps[p], num - 1)
  prod += num - 1
print(prod)

Submission status: Wrong Answer

Solution code:
N = int(input())
nums = []
exps = {}
import math
for p in range(2, int(math.sqrt(N))+1):
  if N % p == 0:
    nums.append(p)
    e = 0
    z = p
    while True:
      if N % z == 0:
        z *= p
        e += 1
      else:
        exps[p] = e
        break
#    print(p, exps[p])
    N /= p ** exps[p]
if not len(nums):
  exps[N] = 1
  nums.append(N)

import numpy as np
prod = 0
for p in nums:
  num = 0
  cum = 0
  while True:
    cum += num
    num += 1
#    print(cum, num)
    if cum >= exps[p]:
      break
#  print(p, exps[p], num - 1)
  prod += num - 1
print(prod)

Submission status: Wrong Answer

Solution code:
N = int(input())
nums = []
exps = {}
import math
for p in range(2, int(math.sqrt(N))+1):
  if N % p == 0:
    nums.append(p)
    e = 0
    z = p
    while True:
      if N % z == 0:
        z *= p
        e += 1
      else:
        exps[p] = e
        break
    N /= p ** exps[p]

import numpy as np
prod = 0
for p in nums:
  num = 0
  cum = 0
  while True:
    cum += num
    num += 1
#    print(cum, num)
    if cum >= exps[p]:
      break
#  print(p, exps[p], num - 1)
  prod += num - 1
print(prod)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

if N == 1:
  print(0)
  import sys
  sys.exit()

distinct_facts = []
for i in range(2, math.ceil(N ** 0.5) + 1):
  if N % i == 0:
    N //= i
    distinct_facts.append(i)

print(len(distinct_facts))

Submission status: Wrong Answer

Solution code:
from math import sqrt
n=int(input())
t=1
i=2
while i*i<=n:
  if n%i==0:
    c=0
    while n%i==0:
      n//=i
      c+=1
    #1+2+...+k<=c
    #k(k+1)<=2c
    #k^2+k-2c<=0
    #k=(-1+sqrt(8c))/2
    t*=(sqrt(8*c)-1)//2
  i+=1
print(t)

Submission status: Wrong Answer

Solution code:
import math
import collections


def main():
    N = int(input())
    if N == 1:
        print(0)
        exit()
    limit = math.sqrt(N)
    vals = []
    i = 2
    while True:
        if i > limit:
            break
        if N % i == 0:
            vals.append(i)
            N //= i
        else:
            i += 1
    if len(vals) == 0:
        print(1)
        exit()
    c = collections.Counter(vals)
    ans = 0
    for v, freq in c.items():
        i = 0
        while True:
            i += 1
            freq -= i
            if freq < 0:
                break
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
import collections


def main():
    N = int(input())
    limit = math.sqrt(N)
    vals = []
    i = 2
    while True:
        if i > limit:
            break
        if N % i ==0:
            vals.append(i)
            N //= i
        else:
            i += 1
    if len(vals) == 0:
        print(1)
        exit()
    c = collections.Counter(vals)
    ans = 0
    for v, freq in c.items():
        i = 0
        while True:
            i += 1
            freq -= i
            if freq < 0:
                break
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
m = 2
MAX = 10**12
n = int(MAX**0.5)
checked = [False for _ in range(n+1)]
primes = []
while m**2 <= N:
  if not checked[m]:
    primes.append(m)
    for l in range(m, n+1, m):
      checked[l] = True
  m += 1
answer = 0
# print(checked)
# print(primes)
for p in primes:
  if p > N:
    break
  else:
    c = p
    while N%p == 0:
      N //= p
      answer += 1
      p *= c
if N > 1 and answer == 0:
  print(answer+1)
else:
  print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())
m = 2
n = int(N**0.5)
checked = [False for _ in range(n+1)]
primes = []
# print(n)
while m**2 <= N:
  if not checked[m]:
    primes.append(m)
    for l in range(m, n+1, m):
      checked[l] = True
  m += 1
answer = 0
# print(checked)
# print(primes)
for p in primes:
  if p > N:
    break
  else:
    c = p
    while N%p == 0:
      N //= p
      answer += 1
      p *= c
if N > 1 and answer == 0:
  print(answer+1)
else:
  print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())
m = 2
n = int(N**0.5)
checked = [False for _ in range(n+1)]
primes = []
# print(n)
while m**2 <= N:
  if not checked[m]:
    primes.append(m)
    for l in range(m, n+1, m):
      checked[l] = True
  m += 1
answer = 0
# print(checked)
# print(primes)
for p in primes:
  if p > N:
    break
  else:
    while N%p == 0:
      N //= p
      answer += 1
      p *= p
if N > 1 and answer == 0:
  print(answer+1)
else:
  print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())
m = 2
n = N
answer = 0
checked = [False for _ in range(int(N**0.5)+1)]
while m**2 <= N:
  if n%m == 0 and not checked[m]:
    l = m
    while n%l == 0:
      n //= l
      answer += 1
      if l**2 <= N:
        checked[l] = True
      l *= l
  m += 1
if N > 1 and answer == 0:
  print(answer+1)
else:
  print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())
m = 2
n = N
answer = 0
while m**2 <= N:
  if n%m == 0:
    l = m
    while n%l == 0:
      n //= l
      answer += 1
      l *= l
  m += 1
if N > 1 and answer == 0:
  print(answer+1)
else:
  print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())
m = 2
n = N
answer = 0
while m**2 <= N and m <= n:
  if n%m == 0:
    l = m
    while n%l == 0:
      n //= l
      answer += 1
      l *= l
  m += 1
if N > 1 and answer == 0:
  print(answer+1)
else:
  print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())
m = 2
n = N
answer = 0
while m <= n:
  if m**2 > N and n == N:
    break
  if n%m == 0:
    n //= m
    answer += 1
  m += 1
if N > 1 and answer == 0:
  print(answer+1)
else:
  print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())
m = 2
n = N
answer = 0
while m**2 <= N and m <= n:
  if n%m == 0:
    n //= m
    answer += 1
  m += 1
if N > 1 and answer == 0:
  print(answer+1)
else:
  print(answer)

Submission status: Wrong Answer

Solution code:
import math
from collections import defaultdict
from itertools import accumulate
N=int(input())
data=defaultdict(int)
result=0
for i in range(2,int(math.sqrt(N))+1):
    while N%i==0:
        N//=i
        data[i]+=1
cumsum=list(accumulate(range(1,10**6*2)))
for value in data.values():
    for i in range(10**6*2):
        if value<cumsum[i]:
            result+=i
            break
if result==0:
    if N!=1:
        result=1
print(result)

Submission status: Wrong Answer

Solution code:
import math
import numpy as np
n = int(input())

s = math.sqrt(n)
i = 2
f = {}
while i <= s:
    while n % i == 0:
        f[i] = f.get(i,0)+1
        n = n // i
    i += 1

if len(f) == 0 and n != 1:
    f[n] = 1

ans = 0
for x in f.values():
    e = 0
    cumsum = 0
    while e + cumsum + 1 <= x:
        e += 1
        cumsum += e
    ans += e
print(ans)

Submission status: Wrong Answer

Solution code:
import math
import numpy as np
n = int(input())

s = math.sqrt(n)
i = 2
f = {}
while i <= s:
    while n % i == 0:
        f[i] = f.get(i,0)+1
        n = n // i
    i += 1
if len(f) == 0:
    f[n] = 1

ans = 0
for x in f.values():
    e = 0
    cumsum = 0
    while True:
        e += 1
        cumsum += e
        if e + 1 + cumsum > x:
            break
    ans += e
print(ans)

Submission status: Wrong Answer

Solution code:
import math
import numpy as np
n = int(input())

s = math.sqrt(n)
i = 2
f = {}
while i <= s:
    while n % i == 0:
        f[i] = f.get(i,0)+1
        n = n // i
    i += 1

ans = 0
for x in f.values():
    e = 0
    cumsum = 0
    while True:
        e += 1
        cumsum += e
        if e + 1 + cumsum > x:
            break
    ans += e
print(ans)

Submission status: Wrong Answer

Solution code:
import math
import random

def is_prime3(q,k=50):
    q = abs(q)
    #計算するまでもなく判定できるものははじく
    if q == 2: return True
    if q < 2 or q&1 == 0: return False

    #n-1=2^s*dとし（但しaは整数、dは奇数)、dを求める
    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1

    #判定をk回繰り返す
    for i in range(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        #[0,s-1]の範囲すべてをチェック
        while t != q-1 and y != 1 and y != q-1:
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True

def get_prime(number):
    prime_list = []
    search_list = list(range(2,number + 1))
    while search_list[0] <= math.sqrt(number):
        head_num = search_list.pop(0)
        prime_list.append(head_num)
        search_list = [num for num in search_list if num % head_num != 0]
    prime_list.extend(search_list)
    return prime_list

l = get_prime(10**6+10)
N = int(input())
ans = 0
k = 1
i = 0
l2 = []
while(l[i]**2 <= N):
    if N % (l[i]**k) == 0:
        N //= (l[i]**k)
        l2.append(l[i]**k)
        k += 1
        ans += 1
    else:
        i += 1
        k = 1
if is_prime3(N) and N not in l2:
    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

N=int(input())
l=factorization(N)
ans=0
for i in l:
    n=i[1]
    c=1
    while True:
        if n<=0:break
        n-=c
        c+=1
        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

N=int(input())
l=factorization(N)
ans=0
for i in l:
    n=i[1]
    c=1
    while 0<=n-c:
        n-=c
        c+=1
        if 0<=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

N=int(input())
l=factorization(N)
ans=0
for i in l:
    n=i[1]
    c=1
    while 0<=n-c:
        n-=c
        c+=1
        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

N=int(input())
l=factorization(N)
ans=0
for i in l:
    n=i[1]
    c=1
    while 0<=n-c:
        n-=1
        c+=1
        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

N=int(input())
l=factorization(N)
ans=0
for i in l:
    n=i[1]
    c=1
    while 0<=n-c:
        n-=c
        ans+=1
        c+=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

N=int(input())
l=factorization(N)
ans=0
for i in l:
    n=i[1]
    c=0
    while 0<=n-c:
        c+=1
        n-=c
        ans+=1
print(ans)