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 math
from collections import deque
from collections import defaultdict

import time

#自作関数群
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq


n = readInt()

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 ahaha(x):
	n = (-1+int((1+8*x)**0.5))//2
	return n

f = factorization(n)



ans=0

for i in f:
	ans+=ahaha(i[1])

print(ans)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
ruteN = math.ceil(math.sqrt(N))
prime=[1]*(ruteN+3)
prime[0]=0
primes=[]
count=0
for i in range(2,ruteN+3,1):
    if prime[i]==1:
        primes.append(i)
        count+=1
        for j in range(i*2,ruteN+3,i):
            prime[j]=0

ans =0
for i in range(0,count,1):
    tmp = primes[i]
    while tmp <= N:
        if N%tmp==0:
            ans += 1
            N = N//tmp
        else:
            break
        tmp = tmp*primes[i]
if N!=1 and ans==0:
    ans =1
print(ans)

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))+1)
print(P)
ans=0
ans+=isPrime(N)
for i in P:
  count=1
  print(i)
  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:
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
    cnt = 0
    for l in arr:
      i = l[1]
      div = 0
      while 1:
        div += 1
        i -= div
        if i >= 0:
          cnt += 1
        else:
          break
    
    return cnt

print(factorization(N))

Submission status: Wrong Answer

Solution code:
import math
import bisect

N = int(input())

num = N
primeDivisions = []

limit = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465, 496, 528, 561, 595, 630, 666, 703, 741, 780]

primeCounts = []
for factor in range(2, int(math.sqrt(N)) + 1):
    if num % factor != 0:
        continue
    count = 0
    while num % factor == 0:
        count += 1
        num //= factor
    primeCounts.append(count)

if len(primeCounts) == 0:
    print(1)
else:
    result = 0
    for count in primeCounts:
        index = bisect.bisect_right(limit, count)
        result += index
    print(result)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
num=2
count=0
num2=int(math.sqrt(n))
while n!=1:
    if n%num==0:
        count+=1
        n=n//num
        num+=1
    else:
        num+=1
    if num2<num:
        if count==0:
            count=1
            break
        num2=int(math.sqrt(n))
        if num2<num and n>=num:
            count+=1
            break
        elif num2<num:
            break
print(count)

Submission status: Wrong Answer

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


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


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


d = set()


for x in primes(int(n**0.5)+1):
    tmp = x
    while(tmp <= N):
        d.add(tmp)
        tmp *= x

d = list(d)
d.sort()
for i in d:
    if N % i == 0:
        N = N // i
        ans += 1

if N > n**(0.5) and is_prime(N):
    ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
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))

ans = 0
for num in c:
    cnt= 0
    total = 1
    while c[num] > cnt:
        cnt += total
        total += 1
        ans += 1


print(ans)

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

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

    return arr

arr = factorization(N)

count = 0
for p,e in arr:
  i = 1
  while True:
    if e < i:
      break
    e -= i
    i += 1
    count += 1      

print(count)

Submission status: Wrong Answer

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



N = int(input())
i = 2
count = 0
while(N>=i):
    if len(str(N))>9 and is_prime(N):
        i = N
    for j in range(1,N+1):
        if N%(i**j) != 0:
            break
        else:
            N = int(N /(i**j))
            count += 1
    i += 1
print(count)

Submission status: Wrong Answer

Solution code:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

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

    return arr

n=int(input())
S=0
l=factorization(n)
for k in l:
    x=k[1]
    n=1
    while n*(n+1)<2*x:
        n+=1
    S+=n
print(S)

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

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

    return arr

f = factorization(n)
result = 0
for each in f:
    shisu = each[1]
    counter = 1
    while shisu >= counter:
        shisu -= counter
        counter += 1
        result += 1
print(result)

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

a = collections.Counter(prime_factorize(n))

res = 0

if n != 1:
    for i in a.items():
        print(i)
        if i[1] > 3:
            res += int(i[1]/2)
        elif i[1] == 3:
            res += 2
        else:
            res += 1
else:
    res = 1

print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n == 1:
    print(0)
    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


count = 0
lists = factorization(n)

used = []
flag = True
i = 0
while flag:
    i = i + 1
    flag = False
    for pair in lists:
        if pair[1] >= i:
            pair[1] -= i
            used.append(pair[0]**i)
            count += 1
            flag = True
        else:
            continue

sumu = 1
for l in lists:
    if l[1] != 0:
        sumu = sumu * l[0] * l[1]
used = set(used)

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

divs = make_divisors(sumu)[1:]
for div in divs:
    if not div in used:
        if sumu % div == 0:
            count = count +1
            sumu = sumu / div

print(count)

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)
if a[0][0] == 1:
    print(0)
else:
    b = []
    c = [0,1, 3, 6, 10, 15, 21, 28, 36, 45]
    for i in range(len(a)):
        b.append(a[i][1])
    ans = 0
    for i in range(len(b)):
        for j in range(9):
            if b[i] == c[j]:
                ans +=j
                break
            elif b[i] < c[j]:
                ans += j-1
    print(ans)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

factors = []

m2 = 0
while n > 1 and n % 2 == 0:
	m2 += 1
	n //= 2
if m2:
	factors.append((2,m2))

m3 = 0
while n > 1 and n % 3 == 0:
	m3 += 1
	n //= 2
if m3:
	factors.append((3,m3))

i = 5
l = int(math.sqrt(n)) + 2

while n > 1 and i < l:
	if n % i == 0:
		m = 0
		while n > 1 and n%i == 0:
			m += 1
			n //= i
		factors.append((i, m))
	i += 2

if n != 1:
	factors.append((n,1))

ans = 0

for _, m in factors:
	count = 0
	s = 0
	while s < m:
		count += 1
		s += count
	ans += count

print(ans)

Submission status: Wrong Answer

Solution code:
import collections
import itertools

def prime_factor(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())
if N == 1:
    print(0)
    exit()
PP = prime_factor(N)
#print(PP)
Pri = collections.Counter(PP)
values, counts = zip(*Pri.most_common())
#print("counts = ",counts)
#print("values = ",values)
L = max(counts)

num = range(L+1)
acu = list(itertools.accumulate(num))
#print(acu)

ans = 0
for i in counts:
    for k in range(L+1):
        if acu[k] > i:
            ans += k-1
            break
print(ans)

Submission status: Wrong Answer

Solution code:
K = int(input())

N = 10**6
dp = [1] * (N+1)
dp[0] =  dp[1] =  0

def pw(j,i):
    while(j%i==0):
        j //= i
        
    if j == 1:
        return True
    else:
        return False

for i in range(2,N+1):
    if dp[i]:
        for j in range(i*i, N+1, i):
            if not pw(j,i):
                dp[j] = 0
ans = 0
for n in range(N):
    if dp[n] == 1 and K%n==0:
        K //= n
        ans += 1

for n in range(N):
    while(dp[n] == 1 and K%n==0):
        K //= n

#print (K)
if K!=1:
    ans += 1
print (ans)

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
count = 0
while(N%3 == 0):
    count += 1
    N /= 3
sum += int(math.sqrt(8*count+1.00001)-1)//2
for i in range(5, 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+4) == 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:
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()
# print(c.items())
count =0
for i in a:
    k=1
    for j in range(n):
        if (i==1):
            count+=1
            break
        i-=k
        k +=j+1
        # print(i,j)
        count +=1
        if (i<=j):
            break
    
print(count)

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:
            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:
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()
    divisors=divisors[1:]
    number=N
    answer=0
    for a in divisors:
        if number % a==0:
            number/=a
            answer+=1
    return answer
print(make_divisors(N))

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)

if n == 1:
  count = 0

print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=[]
for i in range(2,int(n**0.5+1)):
  if n%i==0:
    A.append([i,0])
    while(n%i==0):
      n//=i
      A[-1][1]+=1
c=0
for a in A:
  i=1
  while a[1]-i>=0:
    a[1]-=i
    i+=1
  c+=i-1
print(c)

Submission status: Wrong Answer

Solution code:
pri = []
def SieveOfEratosthenes(n):
    prime = [True for i in range(n + 1)]
    p = 2
    while (p * p <= n):
        if (prime[p] == True):
            for i in range(p * p, n + 1, p):
                prime[i] = False
        p += 1
    for p in range(2, n + 1):
        if prime[p]:
            pri.append(p)
n = int(input())
if n==1:
    print(0)
    exit(0)
perm = n
SieveOfEratosthenes(int(n**0.5)+1)
per = []
for i in pri:
    tmp = i
    while tmp<=int(perm**0.5):
        per.append(tmp)
        tmp *= i
per.sort()
cnt = 0
for i in per:
    if n%i==0:
        cnt += 1
        n//=i
if cnt==0:
    print(cnt+1)
else:
    print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())


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


c = 0
for z in make_divisors(n)[1:]:
    if n % z == 0:
        n /= z
        c += 1
print(c)

Submission status: Wrong Answer

Solution code:
import os
import heapq
import sys
import math
import operator
from collections import defaultdict
from io import BytesIO, IOBase
# def gcd(a,b):
#     if b==0:

#         return a
#     else:
#         return gcd(b,a%b)
def main():
    # mod=10**9+7
    #for _ in range(int(input())):
    n=int(input())
    res=[]
    if n==1:
        print(0)
    else:
        for i in range(1,int(math.sqrt(n)+1)):
            if n%i==0:
                res.append(i)
                res.append(n//i)
        res.sort()
        #print(res)
        if len(res)==2:
            print(1)
        else:
            ans=0
            for i in range(1,len(res)):
                if n%res[i]==0:
                    n=n//res[i]
                    ans+=1
                    if n==1:
                        break
            print(ans)









BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
start=n
ans=0
for i in range(2,int((n+1)**0.5)):
    if(n%i==0):
        for j in range(1,100):
            if(n%(i**j)==0):
                ans+=1
                n/=i**j
            else:
                break
    if(n==1):
        break
if(n==start and start!=1):
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
def factoring(n):
    if n == 0:
        return {0: 1}
    if n == 1:
        return {1: 1}
    nOrigin = n
    n = n**0.5
    numlist = [0 for i in range(int(n) + 1)]
    numlist[0] = -1
    numlist[1] = -1

    t = 2
    while t < (n**0.5):
        if numlist[t] == 0:
            numlist[t] = t
            k = 2
            while t * k <= n:
                numlist[t * k] = -1
                k += 1
        t += 1
    while t <= n:
        if numlist[t] == 0:
            numlist[t] = t
        t += 1

    result = {}
    for i in numlist:
        if i == -1:
            continue
        j = 0
        while nOrigin % i == 0:
            j += 1
            nOrigin = nOrigin / i
        if j == 0:
            continue
        else:
            result[i] = j

    if int(nOrigin) != 1:
        result[int(nOrigin)] = 1
    return result

def help(e):
    i=0
    while i*(i+1)//2<=e:
        i+=1
    return i-1


N=int(input())
d=factoring(N)

retval=0
for key,value in d.items():
    retval+=help(value)


print(retval)

Submission status: Wrong Answer

Solution code:
import math
def main():

    N = int(input())
    primes = []
    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

    primes = []
    for i in range(1, int(math.sqrt(N))+1):
        if N % i == 0 and isprime(i):
            primes.append(i)
        if N // i != i and isprime(N // i):
            primes.append(N//i)
    print(len(primes))

    ans = 0
    for p in primes:
        q = p
        while N % q == 0:
            ans += 1
            N = N // q
            q *= p
    return ans


if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(100000)


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


elements = set()


def decomposition(used_set, last_used, rest):
    global elements

    if rest == 0:
        if len(used_set) > len(elements):
            elements = used_set
    i = last_used + 1
    while rest - i >= 0:
        if i in used_set:
            continue
        decomposition(used_set | {i}, i, rest - i)
        i += 1


N = int(input())
factors = factorization(N)
ans = 0
for p, e in factors:
    if e == 1:
        continue
    elif e == 2:
        ans += 1
    else:
        elements = set()
        decomposition({1}, 1, e - 1)
        ans += len(elements)
print(ans)

Submission status: Wrong Answer

Solution code:
from itertools import combinations

def solve():
    N = int(input())

    def getPrimeFactors(x):
        anss = []
        while x%2 == 0:
            anss.append(2)
            x //= 2
        for d in range(3, int(x**0.5)+1, 2):
            while x%d == 0:
                anss.append(d)
                x //= d
        if x != 1:
            anss.append(x)
        return anss

    PFs = getPrimeFactors(N)

    num = len(PFs)
    useds = [0] * num
    setAns = set()
    for k in range(1, 50):
        PFs = [PFs[i] for i in range(num) if not useds[i]]
        num = len(PFs)
        if num < k:
            break
        useds = [0] * num
        for poss in combinations(range(num), r=k):
            for pos in poss:
                if useds[pos]:
                    break
            else:
                ans = []
                for pos in poss:
                    ans.append(PFs[pos])
                ans = tuple(ans)
                if ans not in setAns:
                    for pos in poss:
                        useds[pos] = 1
                        setAns.add(ans)

    print(len(setAns))


solve()

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())
a=factorization(n)
ans=0
for i in range(len(a)):
  tmp=0
  for j in range(1,50):
    tmp+=j
    if a[i][1] >= tmp:
      ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
n = 0
for i in range(2, int(-(-N**0.5//1))+1):
  if N % i == 0:
    N = N / i
    n += 1
print(n)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import math
def yakusu(n):
    results = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            results.append(i)
            results.append(n // i)
    return results

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

N = int(input())
setA = set(yakusu(N))
A = list(setA)
is_prime = eratos(10**6)
if len(A) == 1:
    print(0)
elif len(A) == 2:
    print(1)
else:
    tmp = []
    ans = 0
    for i, b in enumerate(is_prime):
        if b:
            x = i
            while N % x == 0:
                ans += 1
                N = N//i
                x *= i

    print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
M=10**6+1
l=[]
p=[1]*M
p[0]=p[1]=0
for i in range(2,M):
  if p[i]:
    l.append(i)
    for j in range(2*i,M,i):
      p[j]=0
d={}
for k in l:
  c=0
  while n%k==0: n//=k; c+=1
  if c>0: d[k]=c
s=[1]
for i in range(2,9):
  s.append(s[-1]+i)
a=0
if d:
  for i in d.values():
    for j in s:
      if j>i: break
      a+=1
  print(a)
elif n==1:
  print(0)
else:
  print(1)

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, end='')

Submission status: Wrong Answer

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


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


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


d = set()


for x in primes(int(n**0.5)+1):
    tmp = x
    while(tmp <= N):
        d.add(tmp)
        tmp *= x

d = list(d)
for i in d:
    if N % i == 0:
        N = N // i
        ans += 1

if N > n**(0.5) and is_prime(N):
    ans += 1

print(ans)