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:
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
ans = 0
for i in range(2, int(math.sqrt(n)) + 1):
    if n % i == 0:
        cnt = 0
        tmp = 1
        while n % i == 0:
            cnt += 1
            n //= i
            if cnt == tmp:
                cnt = 0
                tmp += 1
                ans += 1
if ans == 0 and n != 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

a = factorization(int(input()))
b = [1, 3, 6, 10, 15, 21, 28, 36, 43]

ans = 0

if len(a) == 1 and a[0][0] == 1:
  print(0)
  exit()
  
for i in a:
  for j in range(len(b)):
    if i[1] < b[j]:
      ans+=j
      break
    
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
primeN = []
tmp = 2
for i in range(2, n):
    if primeN:
        for j in range(len(primeN)):
            if i % primeN[j] == 0:
                break
            else:
                if j == len(primeN) - 1:
                    primeN.append(i)
    else:
        if n > tmp:
            primeN.append(i)
print(primeN)

s = 0
for j in primeN:
  k = j
  while n%k==0:
    s+=1
    n = int(n/j)
    k = k*j
print(s)

Submission status: Wrong Answer

Solution code:
N = int(input())
s = 0
while N >1:
  for i in range(N):
    if N%(i+2) == 0:
      s += 1
      N = int(N/(i+2))
      break
print(s)

Submission status: Wrong Answer

Solution code:
def factorize(n):
    x = 2
    f = []
    while x**2 <= n:
        c = 0
        if n % x != 0:
            break
        else:
            while n % x == 0:
                n //= x
                c += 1
            f.append([x, c])

    if n > 1:
        f.append([n, 1])
    return f

n = int(input())
f = factorize(n)
ans = 0
for el in f:
    m = el[1]
    i = 1
    while True:
        if i*(i+1)//2 > m:
            ans += i-1
            break
        i += 1

print(ans)

Submission status: Wrong Answer

Solution code:
def factorize(n):
    x = 2
    f = []
    while x**2 <= n:
        c = 0
        if n % x != 0:
            break
        else:
            while n % x == 0:
                n //= x
                c += 1
            f.append([x, c])

    if n > 1:
        f.append([n, 1])
    return f

n = int(input())
f = factorize(n)
ans = 0
for el in f:
    m = el[1]
    i = 1
    while True:
        if i*(i+1)//2 > m:
            ans += i-1
            break
        i += 1

for el in f:
    print(el)
print(ans)

Submission status: Wrong Answer

Solution code:
import math
N_ = N = int(input())
div = {}
for i in range(2, int(math.sqrt(N))+1):
    while N % i == 0:
        N //= i
        if i in div:
            div[i] += 1
        else:
            div[i] = 1
    if N == 1:
        break
if len(div) == 0:
    div[N_] = 1
ans = 0
for v in div.values():
    i = 1
    while v >= i:
        v -= i
        i += 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 = input()

ar = factorization(int(n)) 
ar_len = len(ar)
ans = 0
for i in range(ar_len):
    jo = ar[i][1]
    ad = 0
    for j in range(1000):
        base = j*(j+1)/2
        if jo < base:
            ad = j-1
            break
    ans = ans + ad

print(ans)

Submission status: Wrong Answer

Solution code:
import math

# 素数リスト生成　eratosthenes
def makePrime(m):
    p = [i for i in range(m + 1)]
    for i in p[3:]:
        if p[i] % 2 == 0: p[i] = 0

    root_m = m ** 0.5
    for i in range(3,m):
        if i > root_m: break
        if p[i] != 0:
            for j in range(i, m + 1, 2):
                if i * j >= m + 1: break
                p[i * j] = 0
    #return p
    return sorted(list(set(p)))[2:]


# 素数かどうか判定
def isPrime(x):
    if x <= 1:
        return False
    
    for i in range(2,math.floor(math.sqrt(x))+1):
        if (x % i) == 0:
            return False
    return True

# zの値を作成
def z_make(n,p):
    for prime in p:
        for i in range(1,100000000000):
            z = prime ** i
            
            if z >= n:
                break
            
            if not z in memo:
                memo.append(z)

def divGame2(n):
    for z in memo:
        global ans
        if n % z == 0:
            rem = n / z
            memo.remove(z)
            ans += 1
            #print("n=",n," z=",z,"rem=",rem," ans=",ans)
            return divGame2(rem)
        

memo = []  # memory
ans = 0    # answer
p = []     # Prime

n = int(input())
p = makePrime(87000)

if isPrime(n): # 素数だったら１が答え
    print(1)
else:
    z_make(n,p)  # zの値を生成。memoができる
    memo.sort()  # 念のため並び替え
    #print(memo)
    divGame2(n)  # メイン実行
    print(ans)   # 答えの出力

Submission status: Wrong Answer

Solution code:
import math

# 素数リスト生成　eratosthenes
def makePrime(m):
    p = [i for i in range(m + 1)]
    for i in p[3:]:
        if p[i] % 2 == 0: p[i] = 0

    root_m = m ** 0.5
    for i in range(3,m):
        if i > root_m: break
        if p[i] != 0:
            for j in range(i, m + 1, 2):
                if i * j >= m + 1: break
                p[i * j] = 0
    #return p
    return sorted(list(set(p)))[2:]


# 素数かどうか判定
def isPrime(x):
    if x <= 1:
        return False
    
    for i in range(2,math.floor(math.sqrt(x))+1):
        if (x % i) == 0:
            return False
    return True

# zの値を作成
def z_make(n,p):
    for prime in p:
        for i in range(1,100000000000):
            z = prime ** i
            
            if z >= n:
                break
            
            if not z in memo:
                memo.append(z)

def divGame2(n):
    for z in memo:
        global ans
        if n % z == 0:
            rem = n / z
            memo.remove(z)
            ans += 1
            #print("n=",n," z=",z,"rem=",rem," ans=",ans)
            return divGame2(rem)
        

memo = []  # memory
ans = 0    # answer
p = []     # Prime

n = int(input())
p = makePrime(64000)

if isPrime(n): # 素数だったら１が答え
    print(1)
else:
    z_make(n,p)  # zの値を生成。memoができる
    memo.sort()  # 念のため並び替え
    #print(memo)
    divGame2(n)  # メイン実行
    print(ans)   # 答えの出力

Submission status: Wrong Answer

Solution code:
import math

# 素数リスト生成　eratosthenes
def makePrime(m):
    p = [i for i in range(m + 1)]
    for i in p[3:]:
        if p[i] % 2 == 0: p[i] = 0

    root_m = m ** 0.5
    for i in range(3,m):
        if i > root_m: break
        if p[i] != 0:
            for j in range(i, m + 1, 2):
                if i * j >= m + 1: break
                p[i * j] = 0
    #return p
    return sorted(list(set(p)))[2:]


# 素数かどうか判定
def isPrime(x):
    if x <= 1:
        return False
    
    for i in range(2,math.floor(math.sqrt(x))+1):
        if (x % i) == 0:
            return False
    return True

# zの値を作成
def z_make(n,p):
    for prime in p:
        for i in range(1,100000000000):
            z = prime ** i
            
            if z >= n:
                break
            
            if not z in memo:
                memo.append(z)

def divGame2(n):
    for z in memo:
        global ans
        if n % z == 0:
            rem = n / z
            memo.remove(z)
            ans += 1
            #print("n=",n," z=",z,"rem=",rem," ans=",ans)
            return divGame2(rem)
        

memo = []  # memory
ans = 0    # answer
p = []     # Prime

n = int(input())
p = makePrime(60000)

if isPrime(n): # 素数だったら１が答え
    print(1)
else:
    z_make(n,p)  # zの値を生成。memoができる
    memo.sort()  # 念のため並び替え
    #print(memo)
    divGame2(n)  # メイン実行
    print(ans)   # 答えの出力

Submission status: Wrong Answer

Solution code:
import math

# 素数リスト生成　eratosthenes
def makePrime(m):
    p = [i for i in range(m + 1)]
    for i in p[3:]:
        if p[i] % 2 == 0: p[i] = 0

    root_m = m ** 0.5
    for i in range(3,m):
        if i > root_m: break
        if p[i] != 0:
            for j in range(i, m + 1, 2):
                if i * j >= m + 1: break
                p[i * j] = 0
    #return p
    return sorted(list(set(p)))[2:]


# 素数かどうか判定
def isPrime(x):
    if x <= 1:
        return False
    
    for i in range(2,math.floor(math.sqrt(x))+1):
        if (x % i) == 0:
            return False
    return True

# zの値を作成
def z_make(n,p):
    for prime in p:
        for i in range(1,100000000000):
            z = prime ** i
            
            if z >= n:
                break
            
            if not z in memo:
                memo.append(z)

def divGame2(n):
    for z in memo:
        global ans
        if n % z == 0:
            rem = n / z
            memo.remove(z)
            ans += 1
            #print("n=",n," z=",z,"rem=",rem," ans=",ans)
            return divGame2(rem)
        

memo = []  # memory
ans = 0    # answer
p = []     # Prime

n = int(input())
p = makePrime(32000)

if isPrime(n): # 素数だったら１が答え
    print(1)
else:
    z_make(n,p)  # zの値を生成。memoができる
    memo.sort()  # 念のため並び替え
    #print(memo)
    divGame2(n)  # メイン実行
    print(ans)   # 答えの出力

Submission status: Wrong Answer

Solution code:
import math
def isPrime(n):
  if n == 2:
    return True
  if n % 2 == 0:
    return False
  m = math.floor(math.sqrt(n))
  for p in range(3,n+1):
      if n % p == 0:
        return False
      if p > m:
        # 素数がnの平方根を超えたら終了
        break
  return True
N=int(input())
if isPrime(N):
    print(1)
else:
    n=N
    count=0
    s=0
    S=0
    for i in range(2,N+1):
        if n<i:
            break
        s=0
        count=0
        while 1:
            if n%i!=0:
                break
            count+=1
            n=int(n/i)
        while 1:
            if count<int(s*(s+1)/2):
                S+=s-1
                break
            s+=1
    print(S)

Submission status: Wrong Answer

Solution code:
N = int(input())
n, p, score = N, 2, 0
while p ** 2 <= N:
  e = 1
  while n >= (p ** e) and n % (p ** e) == 0:
    n //= (p ** e)
    score += 1
    e += 1
  else:
    while n % p == 0:
      n //= p
    p = p + 1 if p == 2 else p + 2
else:
  if n != 1:
    score += 1

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys
#import copy


def xnxn(n=0):
    """
    args:
        int n: a number of lows to read
    example:
        input   1
        retrun  1

        input   1 2 3
        return  [1,2,3]
        input   1 2 3
                4
        return  [[1,2,3],
                [4]]
    """
    if n == 0:
        temp = list(map(int, input().split()))
        if len(temp) == 1:
            return temp[0]
        elif len(temp) > 1:
            return temp
    else:
        temp = [list(map(int, input().split())) for _ in range(n)]
        return temp


def sp_xnxn(n=0):
    """
    args:
        int n: a number of lows to read
    example
        input   1
        retrun  [1]

        input   123
        return  [1,2,3]

        input   123
                4
        return  [[1,2,3],
                [4]]
    """
    if n == 0:
        return [int(k) for k in xsxs()]
    else:
        return [[int(k) for k in xsxs()] for _ in range(n)]


def xsxs(n=0):
    """
    args:
        int n: a number of lows to read
    example:
        input   AA
        retrun  AA

        input   A BBB CC
        return  ["A","BBB","CC"]

        input   A BB CCC
                D
        return  [["A","BBB","CC"],
                ["D"]]
    """
    if n == 0:
        temp = list(input().split())
        if len(temp) == 1:
            return temp[0]
        elif len(temp) > 1:
            return temp
    else:
        return [list(input().split()) for _ in range(n)]


def sp_xsxs(n=0):
    """
    args:
        int n: a number of lows to read
        example:
            input   A
            retrun  ["A"]

            input   ABC
            return  ["A","B","C"]

            input   ABC
                    D
            return  [["A","B","C"],
                    ["D"]]
    """
    if n == 0:
        return [s for s in xsxs()]
    else:
        return [[s for s in xsxs()] for _ in range(n)]


def p_num(a):

    if a == 1:
        return [[a, 1]]
    else:
        tmp = 2
        ans = []
        while tmp < np.sqrt(a) + 1:
            n = 0
            p = [tmp]

            while a % tmp == 0:
                a = int(a / tmp)
                # p.append(tmp)
                n += 1
                c = 1
            if n != 0:
                p.append(n)
                ans.append(p)
            tmp += 1
            c = 0
        if c == 0:
            ans.append([a, 1])
        return ans


n = xnxn()

if n == 1:
    print(0)
    sys.exit()
else:
    a = p_num(n)
    c = 0
    for num in a:
        i = 1
        while num[1] - i > -1:
            num[1] -= i
            i += 1
            c += 1
    print(c)

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys
#import copy


def xnxn(n=0):
    """
    args:
        int n: a number of lows to read
    example:
        input   1
        retrun  1

        input   1 2 3
        return  [1,2,3]
        input   1 2 3
                4
        return  [[1,2,3],
                [4]]
    """
    if n == 0:
        temp = list(map(int, input().split()))
        if len(temp) == 1:
            return temp[0]
        elif len(temp) > 1:
            return temp
    else:
        temp = [list(map(int, input().split())) for _ in range(n)]
        return temp


def sp_xnxn(n=0):
    """
    args:
        int n: a number of lows to read
    example
        input   1
        retrun  [1]

        input   123
        return  [1,2,3]

        input   123
                4
        return  [[1,2,3],
                [4]]
    """
    if n == 0:
        return [int(k) for k in xsxs()]
    else:
        return [[int(k) for k in xsxs()] for _ in range(n)]


def xsxs(n=0):
    """
    args:
        int n: a number of lows to read
    example:
        input   AA
        retrun  AA

        input   A BBB CC
        return  ["A","BBB","CC"]

        input   A BB CCC
                D
        return  [["A","BBB","CC"],
                ["D"]]
    """
    if n == 0:
        temp = list(input().split())
        if len(temp) == 1:
            return temp[0]
        elif len(temp) > 1:
            return temp
    else:
        return [list(input().split()) for _ in range(n)]


def sp_xsxs(n=0):
    """
    args:
        int n: a number of lows to read
        example:
            input   A
            retrun  ["A"]

            input   ABC
            return  ["A","B","C"]

            input   ABC
                    D
            return  [["A","B","C"],
                    ["D"]]
    """
    if n == 0:
        return [s for s in xsxs()]
    else:
        return [[s for s in xsxs()] for _ in range(n)]


def p_num(a):

    if a == 1:
        return [[a, 1]]
    else:
        tmp = 2
        ans = []
        while tmp < np.sqrt(a) + 1:
            n = 0
            p = [tmp]
            while a % tmp == 0:
                a = int(a / tmp)
                # p.append(tmp)
                n += 1
            if n != 0:
                p.append(n)
                ans.append(p)
            tmp += 1
        if n == 0:
            ans.append([a, 1])
        return ans


n = xnxn()

if n == 1:
    print(0)
    sys.exit()
else:
    a = p_num(n)
    c = 0
    for num in a:
        i = 1
        while n % (num[0]**i) == 0:
            n = n/(num[0]**i)
            i += 1
            c += 1
    print(c)

Submission status: Wrong Answer

Solution code:
N = int(input())
n, p, score = N, 2, 0
while p ** 2 <= N:
  e = 1
  # print(n, p, e)
  while n >= (p ** e) and n % (p ** e) == 0:
    n = n // (p ** e)
    score += 1
    e += 1
  else:
    p = p + 1 if p == 2 else p + 2
else:
  # print(p,n, [i for i in range(p, n + 1)])
  # print([n % i == 0 for i in range(p, n + 1)])
  if sum([n % i == 0 for i in range(p, n + 1)]) == 1:
    score += 1
print(score)

Submission status: Wrong Answer

Solution code:
N = int(input())
n, p, score = N, 2, 0
while p ** 2 <= N:
  e = 1
  print(n, p, e)
  while n >= (p ** e) and n % (p ** e) == 0:
    n = n // (p ** e)
    score += 1
    e += 1
  else:
    p = p + 1 if p == 2 else p + 2
else:
  # print(p,n, [i for i in range(p, n + 1)])
  # print([n % i == 0 for i in range(p, n + 1)])
  if sum([n % i == 0 for i in range(p, n + 1)]) == 1:
    score += 1
print(score)

Submission status: Wrong Answer

Solution code:
N = int(input())
n, p, score = N, 2, 0
while p ** 2 <= N:
  e = 1
  while n >= (p ** e) and n % (p ** e) == 0:
    n = n // (p ** e)
    score += 1
    e += 1
  else:
    p = p + 1 if p == 2 else p + 2
else:
  if sum([n % (i + 1) == 0 for i in range(p+1, n)]) == 1:
    score += 1
print(score)

Submission status: Wrong Answer

Solution code:
N = int(input())
n, p, score = N, 2, 0
while p ** 2 <= N:
  e = 1
  while n >= (p ** e) and n % (p ** e) == 0:
    n = n // (p ** e)
    score += 1
    e += 1
  else:
    p = p + 1 if p == 2 else p + 2
else:
  if sum([n % (i + 1) == 0 for i in range(n)]) == 2:
    score += 1
print(score)

Submission status: Wrong Answer

Solution code:
import numpy as np
import sys
#import copy


def xnxn(n=0):
    """
    args:
        int n: a number of lows to read
    example:
        input   1
        retrun  1

        input   1 2 3
        return  [1,2,3]
        input   1 2 3
                4
        return  [[1,2,3],
                [4]]
    """
    if n == 0:
        temp = list(map(int, input().split()))
        if len(temp) == 1:
            return temp[0]
        elif len(temp) > 1:
            return temp
    else:
        temp = [list(map(int, input().split())) for _ in range(n)]
        return temp


def sp_xnxn(n=0):
    """
    args:
        int n: a number of lows to read
    example
        input   1
        retrun  [1]

        input   123
        return  [1,2,3]

        input   123
                4
        return  [[1,2,3],
                [4]]
    """
    if n == 0:
        return [int(k) for k in xsxs()]
    else:
        return [[int(k) for k in xsxs()] for _ in range(n)]


def xsxs(n=0):
    """
    args:
        int n: a number of lows to read
    example:
        input   AA
        retrun  AA

        input   A BBB CC
        return  ["A","BBB","CC"]

        input   A BB CCC
                D
        return  [["A","BBB","CC"],
                ["D"]]
    """
    if n == 0:
        temp = list(input().split())
        if len(temp) == 1:
            return temp[0]
        elif len(temp) > 1:
            return temp
    else:
        return [list(input().split()) for _ in range(n)]


def sp_xsxs(n=0):
    """
    args:
        int n: a number of lows to read
        example:
            input   A
            retrun  ["A"]

            input   ABC
            return  ["A","B","C"]

            input   ABC
                    D
            return  [["A","B","C"],
                    ["D"]]
    """
    if n == 0:
        return [s for s in xsxs()]
    else:
        return [[s for s in xsxs()] for _ in range(n)]


def p_num(a):

    if a == 1:
        return [[a, 1]]
    else:
        tmp = 2
        ans = []
        while tmp < a + 1:
            n = 0
            p = [tmp]
            while a % tmp == 0:
                a = int(a / tmp)
                # p.append(tmp)
                n += 1
            if n != 0:
                p.append(n)
                ans.append(p)
            tmp += 1
            if n == 0 and tmp > np.sqrt(a) - 1:
                ans.append([a, 1])
                break
        return ans


n = xnxn()

if n == 1:
    print(0)
    sys.exit()
else:
    a = p_num(n)
    c = 0
    for num in a:
        i = 1
        while num[1] - i > -1:
            num[1] -= i
            i += 1
            c += 1

    print(c)

Submission status: Wrong Answer

Solution code:
N = int(input())
p, score = 2, 0
while p ** 2 <= N:
  e = 1
  while N >= (p ** e) and N % (p ** e) == 0:
    N = N // (p ** e)
    score += 1
    e += 1
  else:
    p = p + 1 if p == 2 else p + 2
else:
  n = 2
  while n ** 2 <= N:
    if N % n == 0:
      break
    else:
      n += 1
  else:
    if N != 1:
      score +=1
print(score)

Submission status: Wrong Answer

Solution code:
N = int(input())
p, score = 2, 0
while p ** 2 <= N:
  e = 1
  while N >= (p ** e) and N % (p ** e) == 0:
    N = N // (p ** e)
    score += 1
    e += 1
  else:
    p = p + 1 if p == 2 else p + 2
else:
  if N != 1 and sum([N % (n + 1) == 0 for n in range(N)]) == 2:
    score += 1
print(score)

Submission status: Wrong Answer

Solution code:
def solve(n):
    for i in range(n+2):
        if (i+1)*i//2 > n:
            return i-1

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())
li = factorization(N)
ans = 0
for [a,b] in li:
    ans += solve(b)
    
    
if ans == 0:
    if N != 1:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
p, score = 2, 0
while p ** 2 <= N:
  e = 1
  while N >= (p ** e) and N % (p ** e) == 0:
    N = N // (p ** e)
    score += 1
    e += 1
  else:
    p = p + 1 if p == 2 else p + 2
else:
  if N != 1 and score == 0:
    score += 1
print(score)

Submission status: Wrong Answer

Solution code:
N = int(input())
p, score = 2, 0
while p <= N:
  e = 1
  while N % (p ** e) == 0:
    N = N // (p ** e)
    score += 1
    e += 1
  else:
    p += 1
print(score)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# @oj: atcoder
# @id: hitwanyang
# @email: 296866643@qq.com
# @date: 2020-06-05 15:25
# @url:https://atcoder.jp/contests/abc169/tasks/abc169_d
import sys,os
from io import BytesIO, IOBase
import collections,itertools,bisect,heapq,math,string
from decimal import *
# region fastio

BUFSIZE = 8192

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")
# ------------------------------
def main():
    n=int(input())
    #判断n是否为素数
    def isprime(n):
        if n <= 1:
            return 0
        for x in range(2,int(math.sqrt(n))+1):
            if n%x == 0:
                return 0
        return 1
    #利用递归分解n并打印质因数
    ans=[]
    def bprime(n):
        if isprime(n):
            ans.append(n)
        else:
            x = 2
            while x <= int(n/2):
                if n%x == 0:
                    ans.append(x)
                    return bprime(n//x)
                x = x + 1
    bprime(n)

    d=collections.Counter(ans)
    mx=0
    for k in d.keys():
        i=1
        v=d[k]
        cnt=0
        while v>0:
            v=v-i
            i=i+1
            cnt+=1
        if v==0:
            mx+=cnt
        else:
            mx+=1
    print (mx)
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
score = 0
for p in range(2, N):
  e = 1
  while p ** e <= N:
    if N % (p ** e):
      break
    else:
      N = N // (p ** e)
      score += 1
      e += 1
print(score)

Submission status: Wrong Answer

Solution code:
N = 48
count = 0
ans = 0
# for p in range(2, N):
for p in range(2, 4):
  count = 0
  while N % p == 0:
    count += 1
    N = N // p
  n = 0
  while n * (n+1) // 2 < count:
    if (n + 1) * (n + 2) // 2 <= count:
      n += 1
    else:
      break
  ans += n
print(ans)

Submission status: Wrong Answer

Solution code:
def factorization(y):
    arr = []
    temp = y
    for i in range(2, int(-(-y**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([y, 1])
    return arr
n=int(input())
if n==1:
  print(0)
  exit()
ans=0
l=factorization(n)
for i,j in l:
    if j<=2:
      ans+=1
    else:
      t=1
      while j:
        print(j,t)
        if j<t:
          break
        ans+=1
        j-=t
        t+=1           
print(ans)

Submission status: Wrong Answer

Solution code:
def factorization(y):
    arr = []
    temp = y
    for i in range(2, int(-(-y**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([y, 1])
    return arr
n=int(input())
if n==1:
  print(0)
  exit()
ans=0
l=factorization(n)
for i,j in l:
    if j<=2:
      ans+=1
    else:
      c=1
      t=1
      while j:
        if j<t:
          break
        ans+=1
        j-=c
        c+=t
        t+=1           
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
def prime_dict(n):
    a = {}
    if n%2 == 0:
        a[2] = 1
        n//=2
    while n%2 == 0:
        a[2] += 1
        n //= 2
    f = 3
    while f*f <= n:
        if n%f == 0:
            if f not in a:
                a[f] = 1
            else:
                a[f] += 1
        else:
            f += 2
    if n!= 1:
        a[n] = 1
    return a
primes = prime_dict(N)
ans = 0

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import math
def primelist(n):
    '''
    return list of prime numbers from 0 to n
    '''
    res = []
    if n >= 2:
        p = [1]*(n+1)
        p[0] = 0
        p[1] = 0
        p[2] = 1
        res = [2]
        for i in range(4, n+1, 2):
            p[i] = 0
        m = math.ceil(math.sqrt(n))
        for i in range(3, m+1, 2):
            if p[i] == 1:
                for j in range(2*i, n+1, i):
                    p[j] = 0
        for i, f in enumerate(p):
            if f:
                res.append(i)
    return res
def primefac(n):
    '''
    prime factorization
    '''
    pl = primelist(int(math.sqrt(n)+1))
    res = []
    for p in pl:
        c, d = 0, 1
        while n % (d * p) == 0:
            c, d = c + 1, d * p
        if c > 0:
            res.append((p, c))
            n = n//d
        if n < 2:
            break
    return res
def main():
    n=int(sys.stdin.readline())
    pl=primefac(n)
    r=0
    for p,k in pl:
        i=1
        while k-i>i:
            k-=i
            i+=1
        r+=i
    print(r)
if __name__=='__main__':main()

Submission status: Wrong Answer

Solution code:
import sys
import math
def primelist(n):
    '''
    return list of prime numbers from 0 to n
    '''
    res = []
    if n >= 2:
        p = [1]*(n+1)
        p[0] = 0
        p[1] = 0
        p[2] = 1
        res = [2]
        for i in range(4, n+1, 2):
            p[i] = 0
        m = math.ceil(math.sqrt(n))
        for i in range(3, m+1, 2):
            if p[i] == 1:
                for j in range(2*i, n+1, i):
                    p[j] = 0
        for i, f in enumerate(p):
            if f:
                res.append(i)
    return res
def primefac(n):
    '''
    prime factorization
    '''
    pl = primelist(int(math.sqrt(n)+1))
    res = []
    for p in pl:
        c, d = 0, 1
        while n % (d * p) == 0:
            c, d = c + 1, d * p
        if c > 0:
            res.append((p, c))
            n = n//d
        if n < 2:
            break
    return res
def main():
    n=int(sys.stdin.readline())
    pl=primefac(n)
    r=0
    for p,k in pl:
        i=1
        while k-i>i:
            i+=1
        r+=i
    print(r)
if __name__=='__main__':main()