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:
from collections import Counter
import math

def div(n):
    if n == 1:
        return []
    prime = []
    tmp = int(math.sqrt(n)) + 1
    
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            prime.append(num)
    
    if len(prime) == 0:
        return [1]
    else:
        return prime

n = int(input())
prime_div = dict(Counter(div(n)))
ans = 0
divs = list(prime_div.values())

for i in range(len(divs)):
    for j in range(1, 10):
        if j > divs[i]:
            break
        divs[i] -= j
        ans += 1

tmp = 1
flg = True
for i in range(2, sum(divs) + 1):
    if tmp >= sum(divs):
        break
    tmp += i
    flg = False

print(ans + tmp - int(flg))

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())
n_list = factorization(n)
ans = 0
for i in range(len(n_list)):
    a = n_list[i][1]
    b = True
    cnt = 0
    cnt2= 1
    while b:
        a = a-cnt2
        cnt += 1
        if a < cnt+1:
            b = False
    ans += cnt
    
if n == 1:
  print(0)
if len(n_list)==1:
  print(1)
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""
if n==1:
    print(0)
    exit(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

a = factorization(n)

n = len(a)

arr1=[1,2]
arr2=[3,4,5]
arr3=[6,7,8,9]
arr4=[10,11,12,13]
arr5=[14,15,16,17,18]
arr6=[19,20,21,22,23,24]
arr7=[25,26,27,28,29,30,31]
arr8=[32,33,34,35,36,37,38,39]
arr8=[40,41,42,43,44,45,46,47,48]
arr9=[49,50,51,52,53,54,55,56,57,58]


cnt =0
for i in range(n):
    if a[i][1] in arr1:
        cnt+=1
    elif a[i][1] in arr2:
        cnt+=2
    elif a[i][1] in arr3:
        cnt+=3
    elif a[i][1] in arr4:
        cnt+=4
    elif a[i][1] in arr5:
        cnt+=5
    elif a[i][1] in arr6:
        cnt+=6
    elif a[i][1] in arr7:
        cnt+=7
    elif a[i][1] in arr8:
        cnt+=8
    elif a[i][1] in arr9:
        cnt+=9

print(cnt)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math

N = int(input())

z = 2
z_end = math.floor( math.sqrt(N) )
if ( z_end < z ):
  z_end = z

count = 0
#print(N, z, z_end)

while ( N > 1 ):
  for i in range(z, z_end+1):
    
    if( N % i == 0 ):
      N = int( N/i )
      z = i+1
      z_end = math.floor( math.sqrt(N) )
      if ( z_end < z ):
        z_end = z
      count += 1
      #print("N/i",N,i)
      break
    
    elif ( i == z_end ):
      #print("N/N",1,N)
      N = 1
      count += 1
      break
    
  if ( z > N ):
    N = 1

print(count)

Submission status: Wrong Answer

Solution code:
import sys
import math


def is_prime(N):
    if N == 1:
        return False
    i = 2
    while i * i <= N:
        if N % i == 0:
            return False
        i += 1
    return True

def prime(N):
    prime = []
    is_prime = [True for i in range(N+1)]  # 全て素数であると初期化
    is_prime[0] = is_prime[1] = False # 0,1は素数ではない
    for i in range(2, N+1):
        if is_prime[i]:
            # iは素数である
            prime.append(i)
            for j in range(2 * i, N+1, i):
                # iの倍数は素数でない
                is_prime[j] = False
                prime.append(j)
    # N以下の素数を表示
    return prime

def main():
    N = int(input())
    if N == 1:
        print(0)
    else:
        if is_prime(N):
            print(1)
        else:
            n = math.ceil(math.sqrt(N))
            prime_list = prime(n)
            prime_list.sort()
            count = 0
            for i in range(len(prime_list)):
                now = prime_list[i]
                if N < now:
                    break
                if N % now == 0:
                    count += 1
                    N //= now
            print(count)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])


def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = []
    limit = math.sqrt(n)
    data = [(i + 1, i + 1) for i in range(1, n)]
    while True:
        p, _ = data[0]
        if limit <= p:
            return prime + data
        prime.append((p, p))
        data = [(e, e) for e, _ in data if e % p != 0]


n = inp()
if n == 1:
    print(0)
    exit()
limit = int(math.sqrt(n)) + 1
prime = get_sieve_of_eratosthenes(limit)
heapq.heapify(prime)
ans = 0
while len(prime):
    i, j = heapq.heappop(prime)
    if i > math.sqrt(n):
        if i == n:
            ans += 1
            break
        break
    if n % i == 0:
        n //= i
        ans += 1
        heapq.heappush(prime, (i * j, j))

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

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
kazu  = []
ans = 0

def fact(n):
    a = []
    i = 1
    while n % 2 == 0:
        a.append(2 ** i)
        n //= 2
        i += 1
    f = 3
    j = 1
    while f <= math.sqrt(n) + 1:
        if n % f == 0:
            a.append(f ** j)
            n //= f
            j += 1
        else:
            f += 2
            j = 1
    if n != 1:
        a.append(n)
    return a 
"""
while a <= math.sqrt(n) + 1:
    if n % a == 0:
        kazu.append(a)
        j = 1
        while  n %   
    a += 1
"""
i = 0
kazu = fact(N)
kazu = sorted(kazu)
if len(kazu) == 0:
    ans = 0
else:
    while N > 1:
        
        N = N / kazu[i]
        i += 1
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0
for i in range(2, int(N**0.5)+1):
    cnt = 0
    while N%i == 0:
        N /= i
        cnt += 1
 
    a = 0
    b = 0
    for j in range(1, cnt+1):
        a += j
        if a > cnt:
            break
        b += 1
        
    ans += b

print(1 if ans==0 else ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0 
ans_list = list()
skip_list = list()

if N % 2 == 0:
    div = 2
    ans +=1
    n = 1
    while N % div == 0:
      ans += 1
      N = N/div
      n += 1
      div = div**n
import math as math
sqrt = math.sqrt(N)
wide = math.ceil(sqrt)
for i in range(3,wide,2):
  if N % i == 0:
    div = i
    n = 1
    while N % div == 0:
      ans += 1
      N = N/div
      n += 1
      div = div**n
if ans == 0 and N != 0:
  print(1)
else:
  print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = input()
jou = len(N)-1
L = int(N)
if L == 1:
    print(0)
else:
    num = 0
    if L > 100:
        limit = 10**int(jou/2)
    else:
        limit = L
    N = int(N)    
    for i in range(2, limit+1):
        if N % i == 0:
            N = N / i
            num = num + 1

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

Submission status: Wrong Answer

Solution code:
N = int(input())

prime = [True for _ in range((10**6) + 1)]
base = [False for _ in range((10**6) + 1)]
prime[0], prime[1] = False, False

for i in range(2, (10 ** 6) + 1):
    if prime[i]:
        now = i * 2
        while now <= 10 ** 6:
            prime[now] = False
            now += i
        now = i
        while now <= 10 ** 6:
            base[now] = True
            now = now * i

count = 0
for i, v in enumerate(base):
    if v and N % i == 0:
        N = N // i
        count += 1

if count == 0 and N > 10 ** 6:
    print(1)
    exit()
print(count)

Submission status: Wrong Answer

Solution code:
from collections import Counter

def Eratosthenes(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]]

n = int(input())
n2 = n

if n < 2:
    print(0)
    exit()

prime_factors = [] #素因数
for i in Eratosthenes(int(n ** 0.5)):
    if i**2 > n2:
        break
    while n2 % i == 0:
        prime_factors.append(i)
        n2 //= i
if n2 > 1:
    prime_factors.append(n2)

ans = []
list = []
for i in prime_factors:
    print(ans, list)
    for j in list:
        if j % i == 0:
            tmp = list.pop(list.index(j)) * i
            if tmp in ans:
                list.append(tmp)
                continue
            ans.append(tmp)
    if i in list:
        tmp = list.pop(list.index(i)) * i
        if tmp in ans:
            list.append(tmp)
            continue
        ans.append(tmp)
    elif i in ans:
        list.append(i)
    else:
        ans.append(i)

print(len(ans))

Submission status: Wrong Answer

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

def eratos(n):
    p = [2]
    l = list(range(3, 100, 2))
    while l[0] < int(100**0.5)+1:
        p.append(l.pop(0))
        l = [x for x in l if x % p[-1]]
    return p + l

def is_primenumber(n):
    if n == 1: return False
    for i in range(2, int(n**0.5)+1):
        if n % i == 0: return False
    return True 

P = eratos(n)
X = []
while True:
    if n == 1:
        print(ans)
        break
    if is_primenumber(n):
        n /= n
        ans += 1
    else:
        for i in range(1, 100):
            for p in P:
                z = p**i
                if n%z==0 and z not in X:
                    X.append(z)
                    n /= z
                    ans += 1
                    break

Submission status: Wrong Answer

Solution code:


import sys
from collections import defaultdict

sys.setrecursionlimit(10 ** 7)
# ----------

INF = float("inf")
MOD = 10 ** 9 + 7
# ----------

def P(n):
    if n == 2:
        return 1
    rest = n
    s = {1}
    for i in range(1, n):
        if rest == 0:
            break
        if rest - i in s:
            pass
        else:
            s.add(i)
            rest -= i
    return len(s)

N = int(input())

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

e = defaultdict(int)
for i in range(2, int(N ** 0.5) + 1):
    while N % i == 0:
        e[i] += 1
        N //= i

if len(e) == 0:
    print(1)
    exit()

ans = 0
for k, v in e.items():
    ans += P(v)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

def get_primenumber(N):
    prime_list = [2]
    for num in range(3,N+1,2):
      if all( num % prime != 0 for prime in prime_list):
        prime_list.append(num)

    return prime_list

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

pri = get_primenumber(40000)
print(pri)
l = []
for z in make_divisors(n):
  if n == 1:
    break
  if n == z:
    l.append(z)
    break
  for i in reversed(pri):
    for e in range(1,100):
      if z < i**e:
        break
      if z == i**e:
        if n%z == 0:
          l.append(z)
          n = int(n/z)
          if n == 1:
            print(l)
            exit()
        
print(len(l))

Submission status: Wrong Answer

Solution code:
# 2020/05/31
# AtCoder Beginner Contest 169 - D

import math

# 素数列挙(エラトステネスの篩)
def eratosthenes(n):
    
    # 素数リストを作成（0なら素数)
    pnl = [0] * (n + 1)
    # 0は素数ではない
    pnl[0] = 1

    idx = 2
    pnl_r = list()
    while(idx <= n):
        
        if pnl[idx] == 0:
            pnl_r.append(idx)
            j = idx * 2
            while (j <= n):
                pnl[j] = 1
                j += idx

        idx += 1
        
    return pnl_r

# Input
n = int(input())
slist = eratosthenes(math.ceil(n**(1/2)))

# Calc
wkval = n
idx = 0
ans = 0
while(wkval > 1 and idx < len(slist)):
    wkidx = 1
    while(wkidx < 40):
        wkdiv = slist[idx] ** wkidx
        if wkval // wkdiv == wkval / wkdiv: 
            ans = ans + 1
            wkval = wkval // wkdiv
        if wkdiv > n:
            break
        
        wkidx = wkidx + 1

    idx = idx + 1

if ans == 0 and n > 1:
    ans = 1
    
if n == 1:
    ans = 0

# Output
print(ans)

Submission status: Wrong Answer

Solution code:
# Contest No.: ABC169
# Problem No.: D
# Solver:      JEMINI
# Date:        20200531

import sys
import heapq

def main():
    temp = [True] * (10 ** 6)
    temp[0] = False
    temp[1] = False
    for i in range(2, 10 ** 6):
        if temp[i]:
            cnt = 2 * i
            while cnt < 10 ** 6:
                temp[cnt] = False
                cnt += i
    prime = []
    for i in range(10 ** 6):
        if temp[i]:
            prime.append(i)

    n = int(input())
    if n == 1:
        print(0)
        return
    ans = 0
    tempN = n
    for i in prime:
        if i > tempN:
            break
        if tempN % i:
            continue
        div = 0
        while True:
            cnt = 1
            temp = 2
            while tempN % (i ** (div + 2 * temp)) == 0:
                cnt += 1
                temp *= 2
            if tempN % (i ** (div + cnt)):
                break
            div += cnt
        tempN = tempN // (i ** div)
        #print(div)
        if div > 2:
            div = int((div * 2) ** 0.5)
        else:
            div = 1
        #print(i, div, tempN)
        ans += div
    if tempN > 1:
        ans += 1
    print(max(ans, 1))
    return

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
# N = (2 ** 16) * (3 ** 16)
ans = 0
t = []
primeList = [2]
maxNumber = 10 ** 5
for x in range(3, maxNumber):
    for y in primeList:
        if x % y == 0:
            break
    else:
        primeList.append(x)  # 割り切れるものがなければリストに追加

for i in primeList:
    for x in range(1, 40):
        y = i ** x
        if N // y == N / y:
            ans += 1
            N = N // y
        else:
            break

if N > 10 ** 5:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a = 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
    
li = factorization(a)

ct = 0
d = 0
ran = range(1,100)
for i,j in li:
    ctb = 0
    for k in ran:
        if ctb > j:
            d = k - 2
            break
        ctb += k
    ct += d

print(ct)

Submission status: Wrong Answer

Solution code:
import sys 
input = sys.stdin.readline
n = int(input())
m = int(-(-n**0.5//1))

def factorization(n):
    #arr = []
    temp = n
    total = 0
    i = 2
    while i <= m:
        if temp == 1:
            break
        if temp%i==0:
            cnt=1
            
            while temp%(i**(cnt))==0:
                
                temp //= i**(cnt)
                cnt+=1
                total += 1
                
                #print(temp)
        i += 1
            #arr.append([i, cnt])

    if temp!=1 and temp!=0 and total==0:
        total += 1

    return total

def main():
    ans = factorization(n)
    if n == 1:
        ans = 0
    print(ans)
    
main()

Submission status: Wrong Answer

Solution code:
plist = [2, 4, 8, 16, 32, 64, 128, 256, 3, 9, 5, 7]

for i in range(11, 1000000, 2):
    j = 0
    flag = False
    while plist[j] <= i ** 0.5:
        if i % plist[j] == 0:
            flag = True
            break
        j += 1
    if flag == False:
        plist.append(i)
        if i ** 3 < 1000000000000:
            plist.append(i**2)
        if i ** 6 < 1000000000000:
            plist.append(i**3)
        if i ** 10 < 1000000000000:
            plist.append(i**4)
plist.sort()
n = int(input())
count = 0

for i in plist:
    if n % i == 0:
        n /= i
        count += 1
        
if n > 1000000:
    count += 1

print(count)

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    cnt = 0
    while n % 2 == 0:
        cnt += 1
        n //= 2
    a.append(cnt)
    f = 3
    cnt = 0
    while f * f <= n:

        if n % f == 0:
            cnt += 1
            n //= f
        else:
            f += 2
            a.append(cnt)
            cnt = 0

    if n != 1:
        a.append(1)
    return a

n = int(input())
ans = 0
lis = prime_factorize(n)
#print(lis)
if len(lis) == 0:
    print(0)
# cnt = 1
# lis2 = []
# val = lis[0]
# for i in range(len(lis)):
#     if i+1< len(lis):
#         if val == lis[i]:
#             cnt += 1
#         elif val != lis[i]:
#             lis2.append(val)
#             cnt = 1
#             val = lis[i]
#     else:
#         if val == lis[i]:
#             cnt += 1
#             lis2.append(cnt)
#         else:
#             lis2.append(val)
#             cnt = 1
#             lis2.append(cnt)
# print(lis2)
for i in range(len(lis)):
    val = 1
    while val <= lis[i]:
        lis[i] -= val
        val += 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())
n_list = factorization(n)
ans = 0
for i in range(len(n_list)):
    a = n_list[i][1]
    b = True
    cnt = 0
    cnt2= 1
    while b:
        a = a-cnt2
        cnt += 1
        if a < cnt+1:
            b = False
    ans += cnt
    
if n == 1:
  print(0)
if len(n_list)==1:
  print(1)
print(ans)
print(n_list)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
kazu  = []
ans = 0

def fact(n):
    a = []
    i = 1
    while n % 2 == 0:
        a.append(2 ** i)
        n //= 2
        i += 1
    f = 3
    j = 1
    while f <= math.sqrt(n) + 1:
        if n % f == 0:
            a.append(f ** j)
            n //= f
            j += 1
        else:
            f += 2
            j = 1
    if n != 1:
        a.append(n)
    return a 
"""
while a <= math.sqrt(n) + 1:
    if n % a == 0:
        kazu.append(a)
        j = 1
        while  n %   
    a += 1
"""
i = 0
kazu = fact(N)
kazu = sorted(kazu)
if len(kazu) == 0:
    ans = 0
else:
    while N > 1:
        
        N = N / kazu[i]
        i += 1
        ans += 1
print(ans)
print(kazu)

Submission status: Wrong Answer

Solution code:
n = int(input())
def q(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
apple = q(n)
orange = set(apple)
bird = []

for i in orange:
    bird.append(apple.count(i))

cnt = 0
dog = 0
for i in bird:
    if i == 1:
        pass
    else:
        for j in range(1, 10**12):
            if dog == -100:
                break
            else:
                i -= j
                if i >= 0:
                    cnt += 1
                else:
                    dog = -100  



print(cnt + bird.count(1))

Submission status: Wrong Answer

Solution code:
import math as mp
N = int(input())
count=0
for i in range(2, int(mp.sqrt(N))+1):
    q, mod = divmod(N,i)
    if mod ==0:
        count = count+1
        N = q
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
pf = {}
for i in range(2, int(N**0.5) + 1):
    while N % i == 0:
        pf[i] = pf.get(i, 0) + 1
        N //= i
if N > 1:
    pf[N] = pf.get(N, 0) + 1

ans = 0
for i in pf.values():
    if i < 3:
        ans += 1
    elif i < 6:
        ans += 2
    elif i < 10:
        ans += 3
    elif i < 15:
        ans += 4
    elif i < 21:
        ans += 5
    elif i < 28:
        ans += 6
print(ans)

Submission status: Wrong Answer

Solution code:
sosuu = [2]
A = int(input())
for L in range(3, A+1, 2): # 2 以外の素数は奇数なので
    for L2 in sosuu:
        if L % L2 == 0:
            break # 素数でないことがわかったらそれ以上ループする必要はない
    else: # break で抜けることがなかったら L は素数（Python 特有の制御構文）
        sosuu.append(L)

ans=0
for i in sosuu:
    if A%i==0:
        ans+=1
        A/=i
print(ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

import sys
import math

def main():
    n = int(sys.stdin.readline())

    if n == 1:
        print("0")
        return

    m = n
    ans = 0
    for i in range(2, math.isqrt(n) + 1):
        e = 0
        while m % i == 0:
            m /= i
            e += 1
        if e > 0:
            ans += int((math.isqrt(8 * e + 1) - 1) / 2)

    if ans == 0:
        print("1")
    else:
        print(ans)

main()

Submission status: Wrong Answer

Solution code:
N = int(input())
ar =  set()

def is_prime(q):
    if q == 1:
        return True
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1

while N > 0:
    if is_prime(N):
        ar.add(N)
        break
    for i in range(2,(N//2)+2):
        if N%i == 0 and (not i in ar):
            ar.add(i)
            break
    N = N//i
print(len(ar))

Submission status: Wrong Answer

Solution code:
N = int(input())

import heapq 
from collections import defaultdict
import numpy as np
import math

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

def seachPrimeNum(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum




if is_prime(N):
    ans = 1
elif N == 1:
    ans = 0
else:
    if N > 10**6:
        heap = seachPrimeNum(int(math.sqrt(N))+1)
    else:
        heap = seachPrimeNum(N)
    # else:
        # heap = seachPrimeNum(N)
    # print(heap)
    # print(heap)
    heapq.heapify(heap)
    ans = 0
    dict_prime = defaultdict(int)

    while(1):

        # print(N)
        # cnt += 1
        # if cnt > 10:break
        # print(N)
        if not heap:
            if is_prime(N):
                ans += 1
                break

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

                




        sub = heapq.heappop(heap)
        cand = sub
        # 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])


print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
current_num = 2
count = 0

import math
S=int(math.sqrt(N))
list1=[N]
def p_judge1(num) :
  q=int(math.sqrt(num))-1
  if num==1 :
    return False
  for i in range(2,q) :
    if num%i==0 :
      return False
  return True
while (S >= current_num):
  if N%current_num==0 and p_judge1(current_num):

    N=int(N/current_num)
    if N!=current_num :
      list1.append(N)
    count+=1
  current_num += 1



list1=reversed(list1)
for item in list1 :
  if p_judge1(item) and N%item==0 :
    N=int(N/item)
    count+=1

print(count)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

z = []

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

def judge(n):
    if isprime(n):
        return True
    for i in range(2, int(math.sqrt(n)+1)):
        if n % i == 0:
            n = n // i
            while n != 1:
                if n % i != 0:
                    return False
                n //= i
            return True
    return False


ans = 0

i = 2
while N != 1:
    
    if isprime(N):
        ans += 1
        break
    if N % i == 0 and judge(i): 
        N //= i
        ans += 1
    i += 1
    



print(ans)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def SI(): return input().split()

def printlist(lst, k='\n'): print(k.join(list(map(str, lst))))
INF = float('inf')

from math import ceil, floor, log2
from collections import deque
from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product
from heapq import heapify, heappop, heappush

def prime_factorization(n):
    res = []
    for i in range(2, int(pow(n, 0.5))+1):
        if n % i: continue
        ex = 0
        while n % i == 0:
            n = n // i
            ex += 1
        res.append([i, ex])
    if n != 1:
        res.append([n, 1])
    return res

def solve():
    n = II()

    p = prime_factorization(n)
    ans = 0
    for (num, ex) in p:
        ans += ceil(ex / 2)
    print(ans)




if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
input()
print(1)

Submission status: Wrong Answer

Solution code:
N = int(input())
M=N
ans=0

for i in range(2,int(M**(1/3))+1):
    e=1
    while N%(i**e)==0:
        N=N//(i**e)
        ans+=1
        e+=1
    if N<i:
        break
if M==1:
    ans=0
elif ans==0:
#    x = int(N**(1/5))
#    y = int(N**(1/4))
    z = int(N**(1/3))
    a = int(N**(1/2))
#    if x**5==M:
#        ans = 2
#    if y**4==M:
#        ans = 2
    if z**3==M:
        ans = 2
    elif a**2==M:
        ans = 1
    else:
        ans=1
print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    sys.setrecursionlimit(10**9)
    input = sys.stdin.readline

    N = int(input())

    if N == 1:
        print(0)
        return

    def get_prime(n):
        import math
        p = []
        if n % 2 == 0:
            p.append(2)

        sq = math.ceil(math.sqrt(n))
        i = 3
        while i <= sq:
            if n % i == 0:
                isPrime = True
                for j in p:
                    if i % j == 0:
                        isPrime = False
                        break
                if isPrime:
                    p.append(i)
                if i*i != n:
                    isPrime = True
                    tmp = n // i
                    for j in p:
                        if tmp % j == 0:
                            isPrime = False
                            break
                    if isPrime:
                        p.append(tmp)

            i += 2
        if len(p) == 0:
            p.append(n)
        return p
    
    p = get_prime(N)

    def prime_factorization(n, p):
        from collections import Counter
        d = Counter()
        for i in p:
            while n % i == 0:
                d[i] += 1
                n //= i
        return d

    d = prime_factorization(N, p)

    ans = 0
    his = {}
    for i in d:
        tmp = 1
        for j in range(d[i]):
            tmp *= i
            if N % tmp == 0 and not tmp in his:
                ans += 1
                N //= tmp
                his[tmp] = 1
            else:
                break
            if N == 1:
                break
        if N == 1:
            break

    print(ans)

main()

Submission status: Wrong Answer

Solution code:
import numpy as np
import decimal
N = decimal.Decimal(input())
count = 0
def is_prime(p):
    dest = int(np.sqrt(p))
    for i in range(2, dest):
        if np.mod(p, i) == 0:
            return False
    return True

if is_prime(N):
    print(1)
else:
    for p in range(2, int(np.sqrt(N))):
        if np.mod(N, p) != 0:
            continue
        
        if not is_prime(p):
            continue

        e = 1
        while True:
            if p**e > N:
                break
            elif np.mod(N, p**e) == 0:
                N = N / decimal.Decimal(p**e)
                count += 1
                
            if np.mod(N, p) != 0:
                break

            e += 1
        if p > int(np.sqrt(N)):
            break
    
    print(count)

Submission status: Wrong Answer

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

sosu = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71]

def isPrime(n):
  if n == 2:
    return True
  if n % 2 == 0:
    return False
  
  # nの平方根まで計算する
  m = math.floor(math.sqrt(n)) + 1
  for p in range(3, m, 2):
      if n % p == 0:
        return False
  return True

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

ans = 0
for i in range(2,10**5):
    if n%i == 0:
        if n == 1:
            print(n)
            break
        if isPrime(n):
            ans += 1
        else:
            n = n/i
            ans += 1