problem_id
stringlengths
6
6
user_id
stringlengths
10
10
time_limit
float64
1k
8k
memory_limit
float64
262k
1.05M
problem_description
stringlengths
48
1.55k
codes
stringlengths
35
98.9k
status
stringlengths
28
1.7k
submission_ids
stringlengths
28
1.41k
memories
stringlengths
13
808
cpu_times
stringlengths
11
610
code_sizes
stringlengths
7
505
p02660
u060736237
2,000
1,048,576
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.
['def main():\n n = int(input())\n if n == 1:\n print(0)\n return\n def eratos(n):\n flag = [True] * (n + 1)\n for i in range(2, int(n**0.5) + 1):\n if flag[i]:\n for j in range(2*i, n + 1, i):\n flag[j] = False\n return [i for i, x in enumerate(flag) if x and i >= 2]\n p = eratos(10**6)\n work = []\n for i in p:\n piyo = 0\n while n % i == 0:\n n //= i\n piyo += 1\n if piyo > 0:\n work.append(piyo)\n if n == 1:\n break\n if len(work) == 0:\n print(1)\n break\n else:\n result = 0\n for i in work:\n for j in range(1, 10**6):\n i -= j\n if i <0:\n break\n result += 1\n if n != 1:\n result += 1\n print(result)\nmain()', 'def main():\n n = int(input())\n if n == 1:\n print(0)\n return\n def eratos(n):\n flag = [True] * (n + 1)\n for i in range(2, int(n**0.5) + 1):\n if flag[i]:\n for j in range(2*i, n + 1, i):\n flag[j] = False\n return [i for i, x in enumerate(flag) if x and i >= 2]\n p = eratos(10**6)\n work = []\n for i in p:\n piyo = 0\n while n % i == 0:\n n //= i\n piyo += 1\n if piyo > 0:\n work.append(piyo)\n if n == 1:\n break\n if len(work) == 0:\n print(1)\n return\n else:\n result = 0\n for i in work:\n for j in range(1, 10**6):\n i -= j\n if i <0:\n break\n result += 1\n if n != 1:\n result += 1\n print(result)\nmain()']
['Runtime Error', 'Accepted']
['s956218328', 's411138989']
[9112.0, 20344.0]
[22.0, 166.0]
[875, 876]
p02660
u067694718
2,000
1,048,576
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.
['n = int(input())\npf = []\ni = 2\nif n == 1:\n print(0)\n exit()\n\nwhile i ** 2 <= n:\n j = 0\n while n % i == 0:\n n = n // i\n j += 1\n if j > 0:\n pf.append(j)\n i += 1\nif len(pf) == 0: pf.append(1)\n\nans = 0\nfor i in pf:\n tmp = i\n j = 1\n while j <= tmp:\n tmp -= j\n ans += 1\n j += 1\nprint(ans)', 'n = int(input())\npf = []\ni = 2\nwhile n > 1 and i ** 2 < n:\n j = 0\n while n % i == 0:\n n = n // i\n j += 1\n if j > 0:\n pf.append(j)\n i += 1\n\nans = 0\nfor i in pf:\n tmp = i\n j = 1\n while j <= tmp:\n tmp -= j\n ans += 1\n j += 1\nprint(ans)', 'n = int(input())\npf = []\ni = 2\nwhile i ** 2 < n:\n j = 0\n while n % i == 0:\n n = n // i\n j += 1\n if j > 0:\n pf.append(j)\n i += 1\nif len(pf) == 0: pf.append(1)\n\nans = 0\nfor i in pf:\n tmp = i\n j = 1\n while j <= tmp:\n tmp -= j\n ans += 1\n j += 1\nprint(ans)', 'from math import ceil\nn = int(input())\npf = []\nt = n\nif n == 1:\n print(0)\n exit()\nfor i in range(2, ceil(n ** 0.5) + 1):\n c = 0\n while t % i == 0:\n c += 1\n t //= i\n if c > 0: pf.append(c)\nif t != 1: pf.append(1)\n\nans = 0\nfor i in pf:\n tmp = i\n j = 1\n while j <= tmp:\n tmp -= j\n ans += 1\n j += 1\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s612879988', 's671870984', 's875203722', 's192068353']
[9216.0, 9204.0, 9228.0, 9472.0]
[422.0, 447.0, 424.0, 181.0]
[351, 294, 314, 364]
p02660
u072717685
2,000
1,048,576
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.
["def main():\n n = int(input())\n on = n\n def is_prime(n):\n for i in range(2, n + 1):\n if i * i > n:\n break\n if n % i == 0:\n return False\n return n != 1\n if is_prime(n):\n print(1)\n sys.exit()\n\n nn = ceil(n**0.5)\n nn = max(6, nn)\n p = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(nn + 1)]\n p[0] = p[1] = False\n p[2] = p[3] = p[5] = True\n for i1 in range(3, floor(nn ** 0.5) + 1, 2):\n if p[i1]:\n for i2 in range(i1 ** 2, nn + 1, i1):\n p[i2] = False\n else:\n continue\n pl = [i for i, b in enumerate(p) if b == True]\n\n nums = deepcopy(pl)\n for pe in pl:\n cnt = 2\n while True:\n tnum = pow(pe, cnt)\n if tnum > n:\n break\n elif tnum != 0:\n if n % tnum == 0:\n nums.append(tnum)\n cnt += 1\n\n nums.sort()\n numsd = deque(nums)\n ok = set()\n r = 0\n while True:\n if not numsd:\n break\n if n == 1:\n break\n nextn = numsd.popleft()\n if nextn > on or nextn > n:\n break\n elif n % nextn == 0:\n if nextn in ok:\n continue\n else:\n n = int(n // nextn)\n ok.add(nextn)\n r += 1\n if n == 1:\n break\n\n\n print(r)\n\nif __name__ == '__main__':\n main()", "import sys\nread = sys.stdin.read\nreadlines = sys.stdin.readlines\n#import numpy as np\nfrom math import sqrt, floor\ndef main():\n def factorization(n):\n l = []\n t = n\n for i in range(2, int(-(-n ** 0.5 // 1)) + 1):\n if t % i == 0:\n cnt = 0\n while t % i == 0:\n cnt += 1\n t = t // i\n l.append([i, cnt])\n if t != 1:\n l.append([t, 1])\n if not l:\n l.append([n, 1])\n return l\n n = int(input())\n if n == 1:\n print(0)\n sys.exit()\n p = factorization(n)\n r = 0\n for pe in p:\n pe1 = pe[1]\n cnt = 1\n while pe1 >= cnt:\n pe1 -= cnt\n cnt = cnt + 1\n r += 1\n print(r)\n\nif __name__ == '__main__':\n main()\n"]
['Runtime Error', 'Accepted']
['s423402375', 's880201983']
[9164.0, 9476.0]
[155.0, 119.0]
[1505, 834]
p02660
u075303794
2,000
1,048,576
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.
['import math\nimport collections\n\nN = int(input())\nprime_number = False\nans = 0\n\ndef trial_division(n):\n \n factor = []\n \n tmp = int(math.sqrt(n)) + 1\n for num in range(2,tmp):\n while n % num == 0:\n n //= num\n factor.append(num)\n \n if not factor:\n global prime_number\n prime_number = True\n return\n else:\n factor.append(n)\n return factor\n\nlist_num = trial_division(N)\n\nif prime_number:\n ans = 1\nelse:\n if 1 in list_num:\n prime_list = list_num[:-1]\n counter = collections.Counter(prime_list)\n for key,val in counter.items():\n temp = val\n for i in range(1,val+1):\n if temp-i > 0:\n temp -= i\n ans += 1\n elif temp-i == 0:\n temp -= i\n ans += 1\n break\n elsea\n break\n \nprint(ans)', 'import math\nimport collections\n \nN = int(input())\nprime_number = False\nans = 0\n \ndef trial_division(n):\n \n factor = []\n \n tmp = int(math.sqrt(n)) + 1\n for num in range(2,tmp):\n while n % num == 0:\n n //= num\n factor.append(num)\n \n if not factor:\n global prime_number\n prime_number = True\n return\n else:\n factor.append(n)\n return factor\n \nlist_num = trial_division(N)\n \nif prime_number:\n ans = 1\nelse:\n if 1 in list_num:\n prime_list = list_num[:-1]\n counter = collections.Counter(prime_list)\n for key,val in counter.items():\n temp = val\n for i in range(1,val+1):\n if temp-i > 0:\n temp -= i\n ans += 1\n elif temp-i == 0:\n temp -= i\n ans += 1\n break\n else\n break\n \nprint(ans)', 'import math\nimport collections\n \nN = int(input())\nprime_number = False\nans = 0\n \ndef trial_division(n):\n \n factor = []\n \n tmp = int(math.sqrt(n)) + 1\n for num in range(2,tmp):\n while n % num == 0:\n n //= num\n factor.append(num)\n \n if not factor:\n global prime_number\n prime_number = True\n return\n else:\n factor.append(n)\n return factor\n\nlist_num = trial_division(N)\n\nif N == 1:\n ans = 0\nelif prime_number:\n ans = 1\nelse:\n if 1 in list_num:\n prime_list = list_num[:-1]\n else:\n prime_list = list_num\n counter = collections.Counter(prime_list)\n for key,val in counter.items():\n temp = val\n for i in range(1,val+1):\n if temp-i > 0:\n temp -= i\n ans += 1\n elif temp-i == 0:\n temp -= i\n ans += 1\n break\n else:\n break\n \nprint(ans)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s422749592', 's691530071', 's385520631']
[9088.0, 9088.0, 9516.0]
[24.0, 23.0, 112.0]
[965, 968, 998]
p02660
u082945913
2,000
1,048,576
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.
['import math\n\nn = int(input())\nN = n\n\nif(n == 1):\n print(0)\n exit()\n\nyakusu = []\nmulti = []\n\ni = 2\nwhile(i <= math.ceil(math.sqrt(n))):\n \n if(n % i == 0):\n if(i in yakusu):\n multi[yakusu.index(i)] += 1\n else:\n yakusu.append(i)\n multi.append(1)\n n = int(n / i)\n continue\n \n if(n == 1):\n break\n \n i += 1\n\nif(len(yakusu) == 0):\n print(1)\n exit()\n \nans = 0\n\nfor j in range(len(multi)):\n h = (-1 + int(math.sqrt(1 + 8 * multi[j]))) / 2\n ans += int(h)\n\nprint(ans)', 'import math\n\nn = int(input())\nN = n\n\nif(n == 1):\n print(0)\n exit()\n\nyakusu = []\nmulti = []\n\ni = 2\nwhile(i <= math.ceil(math.sqrt(n))):\n \n if(n % i == 0):\n if(i in yakusu):\n multi[yakusu.index(i)] += 1\n else:\n yakusu.append(i)\n multi.append(1)\n n = int(n / i)\n continue\n \n if(n == 1):\n break\n \n i += 1\n\nif(len(yakusu) == 0):\n print(1)\n exit()\n \nans = 0\n\nfor j in range(len(multi)):\n h = int(math.sqrt(1 + 8 * multi[j]))\n h = (h - 1) if h % 2 == 0 else h\n h = (-1 + h) / 2\n ans += int(h)\n\nprint(ans)', 'import math\n\nn = int(input())\nN = n\n\nif(n == 1):\n print(0)\n exit()\n\nyakusu = []\nmulti = []\n\ni = 2\n\nwhile(i <= math.ceil(math.sqrt(N))):\n \n if(n % i == 0):\n if(i in yakusu):\n multi[yakusu.index(i)] += 1\n else:\n yakusu.append(i)\n multi.append(1)\n n = int(n / i)\n continue\n \n if(n == 1):\n break\n \n i += 1\n \nelse:\n yakusu.append(n)\n multi.append(1)\n\nif(len(yakusu) == 0):\n print(1)\n exit()\n \n# print(yakusu)\n# print(multi)\n\nans = 0\n\nfor j in range(len(multi)):\n h = (-1 + int(math.sqrt(1 + 8 * multi[j]))) / 2\n ans += int(h)\n\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s068309001', 's235434803', 's911154958']
[9244.0, 9248.0, 9276.0]
[411.0, 410.0, 403.0]
[563, 610, 648]
p02660
u084491185
2,000
1,048,576
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.
['def prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nN = int(input())\nl = prime_factorize(N)\nm = set(l)\nl2 = list(m)\nans = 0\nfor i in range(len(l2)):\n x = l.count(l2[i]))\n while x >= 2:\n x = x/2\n ans += 1\nprint(ans)', 'def prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nN = int(input())\nl = prime_factorize(N)\nm = set(l)\nl2 = list(m)\nans = 0\nfor i in range(len(l2)):\n x = l.count(l2[i])\n while x >= 2:\n x = x/2\n ans += 1\nprint(ans)', 'def prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nN = int(input())\nl = prime_factorize(N)\nm = set(l)\nl2 = list(m)\nans = 0\n\nfor i in range(len(l2)):\n x = l.count(l2[i])\n y = 1\n while x >= y:\n x = x - y\n y += 1\n ans += 1\nprint(ans)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s560831301', 's593705359', 's402685470']
[8932.0, 9212.0, 9224.0]
[24.0, 91.0, 88.0]
[458, 457, 484]
p02660
u090068671
2,000
1,048,576
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.
['ef D(argN = None):\n\tanswer = 0\n\tN = argN or int(input())\n\tif N==1:\n\t\tprint(answer)\n\telse:\n\t\t\n\t\tfor p in range(2, int(N**0.5)+2):\n\t\t\te = 0\n\t\t\twhile (N % p == 0):\n\t\t\t\tN /= p\n\t\t\t\te += 1\n\t\t\t\n\t\t\tif e>0:\n\t\t\t\t\n\t\t\t\tfor i in range(1, e+1):\n\t\t\t\t\tif e >= 1:\n\t\t\t\t\t\te -= i\n\t\t\t\t\t\tanswer += 1\n\t\t\n\t\tif answer==0:\n\t\t\tanswer = 1\n\t\tprint(answer)\n \nD()', 'def resolve():\n\tanswer = 0\n\tN = int(input())\n\tif N==1:\n\t\tprint(answer)\n\telse:\n\t\t\n\t\tfor p in range(2, int(N**0.5)+2):\n\t\t\te = 0\n\t\t\twhile (N % p == 0):\n\t\t\t\tN /= p\n\t\t\t\te += 1\n\t\t\t\n\t\t\tif e>0:\n\t\t\t\t\n\t\t\t\tfor i in range(1, e+1):\n\t\t\t\t\tif e >= i:\n\t\t\t\t\t\te -= i\n\t\t\t\t\t\tanswer += 1\n\t\t\n\t\tif N!=1:\n\t\t\tanswer += 1\n\t\tprint(answer)\n \nresolve()']
['Runtime Error', 'Accepted']
['s751128943', 's728530886']
[8972.0, 9388.0]
[24.0, 128.0]
[588, 542]
p02660
u094102716
2,000
1,048,576
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.
['n=int(input())\nd={}\nfor k in range(2,10**6):\n while n%k<1: n//k; d[k]=d.get(k,0)+1\na=0\nfor i in d.values():\n t=c=0\n while t+c<i: c+=1; t+=c\n a+=c\nprint(a+(n>1))', 'n=int(input())\nd={}\nfor k in range(2, 10**6):\n while n%k<1: n//k; d[k]=d.get(k, 0)+1\na=0\nfor i in d.values():\n t=c=0\n while t+c<i: c+=1; t+=c\n a+=c\nprint(a+(n>1))\n', 'n=int(input())\nd={}\nfor k in range(2,10**6):\n while n%k<1: n//=k; d[k]=d.get(k,0)+1\na=0\nfor i in d.values():\n t=c=0\n while t+c<i: c+=1; t+=c\n a+=c\nprint(a+(n>1))']
['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s395884489', 's640680541', 's491623116']
[9184.0, 9184.0, 9120.0]
[2206.0, 2206.0, 150.0]
[164, 167, 165]
p02660
u094425865
2,000
1,048,576
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.
['def fc(n):\n wk =0\n h=0\n for i in range(2,int(n**0.5)+1):\n if n%i==0:\n wk+=1\n n//=i\n h=i\n if n!=1 and h < n:\n wk+=1\n return wk\n \nn =int(input()', 'def fc(n):\n wk =0\n h=0\n for i in range(2,int(n**0.5)+1):\n if n%i==0:\n wk+=1\n n//=i\n h=i\n if n!=1 and h <\n n:\n wk+=1\n return wk\n\nn =int(input())\n\nprint(fc(n))', 'def fc(n):\n wk =0\n for i in range(2,int(n**0.5)):\n j=i\n while n%j == 0:\n wk+=1\n n//=j \n j*=i\n while n%i==0:\n n//=i\n continue\n if n!=1:\n wk+=1\n return wk\n\nn =int(input())\nprint(fc(n))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s144396216', 's233088087', 's339958758']
[9048.0, 9008.0, 9448.0]
[22.0, 23.0, 211.0]
[204, 223, 277]
p02660
u101371735
2,000
1,048,576
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.
['\nfrom collections import Counter\nN = int(input())\nfactors = []\ni = 2\n\nwhile N > 1:\n if N < i * i:\n factors.append(N)\n break\n while N % i == 0:\n factors.append(i)\n N //= i\n i += 1\n# N == 1\nans = 0\nprint(factors)\nfor count in Counter(factors).values():\n i = 1\n while count >= i:\n count -= i\n i += 1\n ans += 1\nprint(ans)', '\nfrom collections import Counter\nN = int(input())\nfactors = []\ni = 2\n\nwhile N > 1:\n if N < i * i:\n factors.append(N)\n break\n while N % i == 0:\n factors.append(i)\n N //= i\n i += 1\n# N == 1\nans = 0\n# print(factors)\nfor count in Counter(factors).values():\n i = 1\n while count >= i:\n count -= i\n i += 1\n ans += 1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s479728995', 's412908672']
[9400.0, 9448.0]
[250.0, 270.0]
[418, 420]
p02660
u111473084
2,000
1,048,576
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.
['def main():\n import sys\n sys.setrecursionlimit(10**9)\n input = sys.stdin.readline\n\n N = int(input())\n N = 2*5+3*5\n\n if N == 1:\n print(0)\n return\n\n def get_prime(n):\n import math\n p = []\n if n % 2 == 0:\n p.append(2)\n\n sq = math.ceil(math.sqrt(n))\n i = 3\n while i <= sq:\n if n % i == 0:\n p.append(i)\n if i*i != n:\n p.append(n//i)\n i += 2\n p.append(n)\n return p\n \n p = get_prime(N)\n\n def prime_factorization(n, p):\n from collections import Counter\n d = Counter()\n for i in p:\n while n % i == 0:\n d[i] += 1\n n //= i\n return d\n\n d = prime_factorization(N, p)\n\n ans = 0\n for i in d:\n tmp = 1\n for j in range(d[i]):\n tmp *= i\n if N % tmp == 0:\n ans += 1\n N //= tmp\n else:\n break\n\n print(ans)\n\nmain()', 'def main():\n import sys\n sys.setrecursionlimit(10**9)\n input = sys.stdin.readline\n\n N = int(input())\n\n if N == 1:\n print(0)\n return\n\n def prime_factorization(n):\n from collections import Counter\n p = Counter()\n while n % 2 == 0:\n p[2] += 1\n n //= 2\n\n i = 3\n while i*i <= n:\n if n % i == 0:\n p[i] += 1\n n //= i\n else:\n i += 2\n\n if n != 1:\n p[n] += 1\n\n return p\n\n d = prime_factorization(N)\n\n ans = 0\n for i in d:\n tmp = 1\n for j in range(d[i]):\n tmp *= i\n if N % tmp == 0:\n ans += 1\n N //= tmp\n else:\n break\n if N == 1:\n break\n if N == 1:\n break\n\n print(ans)\n\nmain()']
['Wrong Answer', 'Accepted']
['s644856491', 's444204464']
[9520.0, 9472.0]
[26.0, 96.0]
[1047, 894]
p02660
u111652094
2,000
1,048,576
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.
['def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n\nN=int(input())\n\nA=factorization(N)\n\nnumlist=range(2,50)\n\nans=0\nsinsa=1\nfor i in range(len(A)):\n N=N/A[i][0]\n ans+=1\n beki=A[i][1]\n sinsa=sinsa+numlist[i]\n if sinsa>beki:\n continue\nprint(ans)', '\nimport sys\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n\n\nN=int(input())\n\nif N==1:\n print(0)\n sys.exit()\n\nA=factorization(N)\n\nnumlist=range(2,50)\nsinsa=1\nans=0\nfor i in range(len(A)):\n beki=A[i][1]\n sosu=A[i][0]\n sinsa=1\n for j in range(1,beki+1):\n N=N/(sosu**j)\n ans+=1\n sinsa=sinsa+j+1\n if sinsa>beki:\n sinsa=1\n break\nprint(ans)']
['Wrong Answer', 'Accepted']
['s681772016', 's021757346']
[9512.0, 9528.0]
[112.0, 111.0]
[565, 707]
p02660
u112114596
2,000
1,048,576
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.
['import math\n\nN=int(input())\n\nans=0\narr=[]\n\ntmp=1\n\n#print(int(math.sqrt(N))+5)\n\nfor i in range(int(math.sqrt(N))+5):\n tmp=1\n\n while N % ((i+2)**tmp) == 0:\n N=N / ((i+2)**tmp)\n print((i+2)**tmp)\n ans+=1\n tmp+=1\n\n while N % (i+2) == 0:\n N = N // (i+2)\n\nif N > 1 :\n ans+1\n\nprint(ans)\n', 'import math\n\nN=int(input())\n\nans=0\narr=[]\n\ntmp=1\n\nprint(int(math.sqrt(N))+5)\n\nfor i in range(int(math.sqrt(N))+5):\n tmp=1\n\n while N % ((i+2)**tmp) == 0:\n N=N // ((i+2)**tmp)\n print((i+2)**tmp)\n ans+=1\n tmp+=1\n\n while N % (i+2) == 0:\n N = N // (i+2)\n\nif N > 1 :\n ans+1\n\nprint(ans)\n', 'import math\n\nN=int(input())\n\nans=0\narr=[]\n\ntmp=1\n\n#print(int(math.sqrt(N))+5)\n\nfor i in range(int(math.sqrt(N))+5):\n tmp=1\n\n while N % ((i+2)**tmp) == 0:\n N=N / ((i+2)**tmp)\n #print((i+2)**tmp)\n ans+=1\n tmp+=1\n\n while N % (i+2) == 0:\n N = N // (i+2)\n\nif N > 1 :\n ans+=1\n\nprint(ans)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s225999342', 's356951908', 's105553152']
[9264.0, 9204.0, 9264.0]
[499.0, 495.0, 490.0]
[327, 327, 329]
p02660
u114641312
2,000
1,048,576
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.
['# from math import factorial,sqrt,ceil #,gcd\n# from itertools import permutations,combinations,combinations_with_replacement\n# from collections import deque,Counter\n# from bisect import bisect_left\nfrom heapq import heapify,heappush,heappop\n# from numba import njit\n\n# from fractions import gcd\n\n# from decimal import Decimal, getcontext\n\n# # eps = Decimal(10) ** (-100)\n\n# import numpy as np # numpy.lcm()\n# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson\n# from scipy.sparse import csr_matrix\n\n# import networkx as nx\n# G = Graph()\n\n\nN = int(input())\n\ndef primes(n):\n ass = []\n is_prime = [True] * (n + 1)\n is_prime[0] = False\n is_prime[1] = False\n for i in range(2, int(n**0.5) + 1):\n if not is_prime[i]:\n continue\n for j in range(i * 2, n + 1, i):\n is_prime[j] = False\n for i in range(len(is_prime)):\n if is_prime[i]:\n ass.append(i)\n return ass\n\nif N == 1:\n print(0)\n exit()\n\nans = 0\n_ , Zque = primes(N)\nZset = set(Zque)\nZ = heappop(Zque)\nif N in Zque:\n print(1)\n exit()\n\nwhile N >= Z:\n # print(N,Z)\n if N%Z == 0:\n ans += 1\n N = N//Z\n i = Z\n num = Z\n j = 2\n while num <= N:\n # print("num=",num,"N=",N,"j=",j)\n if not num in Zset:\n heappush(Zque,num)\n Zset.add(num)\n num = i**j\n j += 1\n Z = heappop(Zque)\n\nprint(ans)\n# for row in board:\n\n# print("{:.10f}".format(ans))\n# print("{:0=10d}".format(ans))\n', '# from math import factorial,sqrt,ceil #,gcd\n# from itertools import permutations,combinations,combinations_with_replacement\nfrom collections import deque,Counter\n# from bisect import bisect_left\nfrom heapq import heapify,heappush,heappop\n# from numba import njit\n\n# from fractions import gcd\n\n# from decimal import Decimal, getcontext\n\n# # eps = Decimal(10) ** (-100)\n\n# import numpy as np # numpy.lcm()\n# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson\n# from scipy.sparse import csr_matrix\n\n# import networkx as nx\n# G = Graph()\n\n\nN = int(input())\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\nif N == 1:\n print(0)\n exit()\n\nans = 0\ncnt_primes = Counter(prime_factorize(N))\n\nfor i in cnt_primes:\n j = 1\n while cnt_primes[i]>=0:\n cnt_primes[i] -= j\n if cnt_primes[i]>=0:\n ans += 1\n else:\n break\n j += 1\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s561533868', 's140925430']
[2106264.0, 9468.0]
[2265.0, 92.0]
[1802, 1348]
p02660
u115110170
2,000
1,048,576
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.
['def f(i,n):\n ans =0\n cnt = i\n while n%cnt == 0:\n n//=cnt\n cnt*=i\n ans +=1\n while n%i ==0:\n n//=i\n return n,ans\n\nn = int(input())\nnn = n\ni = 2\nans = 0\nwhile i <= int(n**0.5)+1:\n if n%i ==0:\n n,a = f(i,n)\n ans += a\n i += 1\n \nif n == nn:\n ans += 1\nprint(ans)', 'def f(i,n):\n ans =0\n cnt = i\n while n%cnt == 0:\n n//=cnt\n cnt*=i\n ans +=1\n while n%i ==0:\n n//=i\n return n,ans\n\nn = int(input())\ni = 2\nans = 0\nwhile i <= int(n**0.5)+1:\n if n%i ==0:\n n,a = f(i,n)\n ans += a\n i += 1\n \nif n >1:\n ans += 1\nprint(ans)\n\n']
['Wrong Answer', 'Accepted']
['s199849330', 's266259079']
[9488.0, 9456.0]
[451.0, 435.0]
[282, 274]
p02660
u116038906
2,000
1,048,576
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.
['\ndef make_divisors(n): をリストで返す\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n\n \n return divisors\n\n\ndef soinsu_bunkai(m):\n pf={}\n\n for i in range(2,int(m**0.5)+1):\n while m%i==0:\n pf[i]=pf.get(i,0)+1\n m//=i\n if m>1:\n pf[m]=1\n return pf\n\n\nN = int(input())\ndiv =make_divisors(N) \ndiv.sort()\ndiv_1_except=div[1:]\ncount =0\nfor i in div_1_except:\n N //= i\n if N <1:\n break\n ii =soinsu_bunkai(i) を素因数分解\n if len(ii) ==1 :\n count +=1\nprint(count)', '\ndef make_divisors(n): をリストで返す\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n\n \n return divisors\n\n\ndef soinsu_bunkai(m):\n pf={}\n\n for i in range(2,int(m**0.5)+1):\n while m%i==0:\n pf[i]=pf.get(i,0)+1\n m//=i\n if m>1:\n pf[m]=1\n return pf\n\n\nN = int(input())\ndiv =make_divisors(N) \ndiv.sort()\ndiv_1_except=div[1:]\ncount =0\nfor i in div_1_except:\n q,mod= divmod(N,i)\n if mod ==0:\n N =q \n ii =soinsu_bunkai(i) を素因数分解\n if len(ii) ==1 :\n count +=1\n #if N <1:\n # break\nprint(count)', '\ndef make_divisors(n): をリストで返す\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n\n \n return divisors\n\n\nimport sys\ninput = sys.stdin.readline\nN = int(input())\ndiv =make_divisors(N)\ndiv.sort()\ndiv_2 =div[1:]\n\ncount =0\nfor i in div_2:\n q,mod =divmod(N,i)\n if mod ==0:\n count +=1\n N =q\nprint(count)', '\ndef make_divisors(n): をリストで返す\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n\n \n return divisors\n\n\ndef soinsu_bunkai(m):\n pf={}\n\n for i in range(2,int(m**0.5)+1):\n while m%i==0:\n pf[i]=pf.get(i,0)+1\n m//=i\n if m>1:\n pf[m]=1\n return pf\n\n\nimport sys\ninput = sys.stdin.readline\nN = int(input())\ndiv =make_divisors(N)\ndiv.sort()\ndiv_2 =div[1:]\n\ncount =0\nfor i in div_2:\n i2 = soinsu_bunkai(i)\n if len(i2) ==1:\n q,mod =divmod(N,i)\n if mod ==0:\n count +=1\n N =q\nprint(count)', '\n\n\ndef soinsu_bunkai(m):\n pf={}\n\n for i in range(2,int(m**0.5)+1):\n while m%i==0:\n pf[i]=pf.get(i,0)+1\n m//=i\n if m>1:\n pf[m]=1\n return pf\n\n\nN = int(input())\nxx =[]\nprime_factorization =soinsu_bunkai(N)\ncount =0\nfor i in prime_factorization.keys():\n x=1\n while x <= prime_factorization[i]:\n if N % i**x ==0:\n xx.append(i**x)\n count +=1\n N //= i**x\n x +=1\nprint(count)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s075288036', 's376819144', 's563216927', 's885102053', 's792331764']
[9440.0, 9408.0, 9488.0, 9508.0, 9380.0]
[197.0, 202.0, 109.0, 875.0, 113.0]
[755, 813, 505, 757, 540]
p02660
u119982001
2,000
1,048,576
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.
['def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n if temp!=1:\n arr.append([temp, 1])\n return arr\n\nz = factorization(int(input()))\nprint(z)\ni = 1\nans = 0\nflag = True\nwhile flag:\n flag2 = False\n for j in range(len(z)):\n if z[j][1] >= i:\n z[j][1] -= i\n ans += 1\n flag2 = True\n\n i += 1\n if flag2 == False: flag = False\nprint(ans)\n', 'def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n if temp!=1:\n arr.append([temp, 1])\n return arr\n\nz = factorization(int(input()))\ni = 1\nans = 0\nflag = True\nwhile flag:\n flag2 = False\n for j in range(len(z)):\n if z[j][1] >= i:\n z[j][1] -= i\n ans += 1\n flag2 = True\n\n i += 1\n if flag2 == False: flag = False\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s429728762', 's959133874']
[9520.0, 9476.0]
[110.0, 118.0]
[587, 575]
p02660
u125348436
2,000
1,048,576
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.
['import collections\ndef factorization(n):\n if n<2:\n return []\n \n prime_factor=[]\n \n for i in range(2,int(n**0.5)+1):\n while n%i==0:\n prime_factor.append(i)\n n//=i\n \n if n>1:\n prime_factor.append(n)\n\n \n return prime_factor\n\nn=int(input())\n\nc=collections.Counter(factorization(n))\nd=list(c.values())\n\nfor v in c.values():\n for i in range(1,n):\n v-=i\n if v>=0:\n count+=1\n else:\n break\nprint(count)', 'import collections\ndef factorization(n):\n if n<2:\n return []\n \n prime_factor=[]\n \n for i in range(2,int(n**0.5)+1):\n while n%i==0:\n prime_factor.append(i)\n n//=i\n \n if n>1:\n prime_factor.append(n)\n return prime_factor\n\ncount=0\nn=int(input())\n \nc=collections.Counter(factorization(n))\nd=list(c.values())\n \nfor v in c.values():\n for i in range(1,n):\n v-=i\n if v>=0:\n count+=1\n else:\n break\nprint(count)']
['Runtime Error', 'Accepted']
['s407391086', 's294497921']
[9724.0, 9744.0]
[110.0, 111.0]
[521, 521]
p02660
u133936772
2,000
1,048,576
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.
['n=int(input())\nd={2:0}\nwhile n%2<1: n//=2; d[2]+=1\nfor i in range(3,int(n**0.5)+1,2):\n while n%i<1: n//=i; d[i]=d.get(i,0)+1\n if n<2: break\nif n>1: d[x]=1\na=0\nfor i in d.values():\n t=c=0\n while t+c<i: c+=1; t+=c\n a+=c\nprint(a)', 'n=int(input())\n\ndef sieve(x):\n p=[2]\n b=[1]*x\n for i in range(2,x,2): b[i]=0\n for i in range(3,x,2):\n if b[i]:\n p+=[i]\n for j in range(2*i,x,i): b[j]=0\n return p\ndef prime_factor(x):\n d={}\n for i in sieve(int(x**0.5)+1):\n while x%i<1: x//=i; d[i]=d.get(i,0)+1\n if x<2: break\n if x>1: d[x]=1\n return d\n\nd=prime_factor(n)\na=0\nfor i in d.values():\n t=c=0\n while t+c<i: c+=1; t+=c\n a+=c\nprint(a)']
['Runtime Error', 'Accepted']
['s346446869', 's737117044']
[9360.0, 20272.0]
[94.0, 212.0]
[235, 425]
p02660
u153556810
2,000
1,048,576
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.
['import math\n\nn = int(input())\nlist = {}\nflag = True\nwhile flag:\n flag = False\n for i in range(2,int(math.sqrt(n)+1)):\n if n%i==0:\n if i in list:\n list[i] = list[i]+1\n else:\n list[i] = 1\n n /= i\n flag = True\n break\nif n in list:\n list[n] = list[n]+1\nelse:\n list[n] = 1\nans = 0\nfor i in list.keys():\n m = list[i]\n for j in range(1,m):\n if not j>m:\n ans += 1\n m -= j\n else:\n break\nprint(ans)\n', 'import math\n\nn = int(input())\nlist = {}\nwhile n>1:\n for i in range(math.sqrt(n)):\n if n%i==0:\n if i in list:\n list[i] = list[i]+1\n else:\n list[i] = 1\n break\nif n%i==0:\n if i in list:\n list[i] = list[i]+1\n else:\n list[i] = 1\nans = 0\nfor i in list.keys():\n m = list[i]\n for j in range(m):\n if not j>m:\n ans += j\n m -= j\n else:\n break\nprint(ans)\n', 'import math\n\nn = int(input())\nlist = {}\nflag = True\nwhile flag:\n flag = False\n for i in range(2,int(math.sqrt(n)+2)):\n if n%i==0:\n if i in list:\n list[i] = list[i]+1\n else:\n list[i] = 1\n n /= i\n flag = True\n break\nif n>1:\n if n in list:\n list[n] = list[n]+1\n else:\n list[n] = 1\nans = 0\nfor i in list.keys():\n m = list[i]\n for j in range(1,m+1):\n if not j>m:\n ans += 1\n m -= j\n else:\n break\nprint(ans)\n']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s092058336', 's676772859', 's867634735']
[9240.0, 9156.0, 9256.0]
[139.0, 23.0, 144.0]
[546, 489, 572]
p02660
u156931988
2,000
1,048,576
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.
['from decimal import *\nimport math\nA,B = input().split()\nA = Decimal(float(A))\nB = Decimal(float(B))\nprint(math.floor(A*B))', 'from collections import defaultdict\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n\ndef Fib(n):\n a, b = 0, 1\n if n == 1:\n return a\n elif n == 2:\n return b\n else:\n for i in range(n-2):\n a, b = b, a + b\n return b\n\nN = int(input())\nif(N == 1):\n print(0)\nelse:\n fact = factorization(N)\n l = [i for i in range(1,1000)]\n count = 0\n d = {}\n for n in fact:\n num = n[1]\n for f in l:\n num -= f\n if(num < 0):\n break\n count += 1\n print(count)']
['Runtime Error', 'Accepted']
['s899062204', 's937977460']
[9776.0, 9616.0]
[30.0, 112.0]
[122, 870]
p02660
u157232135
2,000
1,048,576
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.
["def main():\n n = int(input())\n f = set(prime_factorize(n))\n s = set()\n for p in f:\n e = 1\n z = p ** e\n while z <= n:\n if n % z == 0:\n if z not in s:\n n //= z\n s.add(z)\n e += 1\n z = p ** e\n print(len(s))\n \nif __name__ == '__main__':\n main()", "def prime_factorize(n):\n \n arr = []\n while n % 2 == 0:\n arr.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n arr.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n arr.append(n)\n return arr\n\ndef main():\n n = int(input())\n f = set(prime_factorize(n))\n s = set()\n for p in f:\n e = 1\n z = p ** e\n while z <= n:\n if n % z == 0:\n if z not in s:\n n //= z\n s.add(z)\n e += 1\n z = p ** e\n print(len(s))\n \nif __name__ == '__main__':\n main()"]
['Runtime Error', 'Accepted']
['s697795250', 's408084258']
[9196.0, 9220.0]
[26.0, 95.0]
[371, 713]
p02660
u171255092
2,000
1,048,576
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.
['def make_divisors(n):\n lower_divisors, upper_divisors = [], []\n i = 1\n while i*i <= n:\n if n % i == 0:\n lower_divisors.append(i)\n if i != n // i:\n upper_divisors.append(n//i)\n i += 1\n return lower_divisors + upper_divisors[::-1]\n\n\ndef prime_len(n):\n a = set()\n while n % 2 == 0:\n a.add(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.add(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.add(n)\n return len(a)\n\n\nn = int(input())\nc = 0\nfor z in make_divisors(n):\n if prime_len(z) == 1:\n tmp = n / z\n if tmp.is_integer():\n n = tmp\n c += 1\n print(z, n)\n else:\n continue\n\nprint(c)\n', 'def make_divisors(n):\n lower_divisors, upper_divisors = [], []\n i = 1\n while i*i <= n:\n if n % i == 0:\n lower_divisors.append(i)\n if i != n // i:\n upper_divisors.append(n//i)\n i += 1\n return lower_divisors + upper_divisors[::-1]\n\n\ndef prime_len(n):\n a = set()\n while n % 2 == 0:\n a.add(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.add(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.add(n)\n return len(a)\n\n\nn = int(input())\nc = 0\nfor z in make_divisors(n):\n if prime_len(z) == 1:\n tmp = n / z\n if tmp.is_integer():\n n = tmp\n c += 1\n else:\n continue\n\nprint(c)\n']
['Wrong Answer', 'Accepted']
['s392760470', 's375138631']
[9260.0, 9216.0]
[232.0, 234.0]
[795, 771]
p02660
u174203233
2,000
1,048,576
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.
['N = int(input())\n\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp % i == 0:\n cnt = 0\n while temp % i == 0:\n cnt += 1\n temp //= i\n arr.append([i, cnt])\n\n if temp != 1:\n arr.append([temp, 1])\n\n if arr == []:\n arr.append([n, 1])\n\n # return arr\n cnt = 0\n for l in arr:\n i = l[1]\n if i != 1:\n div = 0\n while 1:\n div += 1\n i -= div\n if i >= 0:\n cnt += 1\n else:\n break\n\n return cnt\n\n\nprint(factorization(N))', 'N = int(input())\n\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(n)):\n if temp % i == 0:\n cnt = 0\n while temp % i == 0:\n cnt += 1\n temp //= i\n arr.append([i, cnt])\n\n if temp != 1:\n arr.append([temp, 1])\n\n if arr == []:\n arr.append([n, 1])\n\n # return arr\n cnt = 0\n for l in arr:\n i = l[1]\n if i != 1:\n div = 0\n while 1:\n div += 1\n i -= div\n if i >= 0:\n cnt += 1\n else:\n break\n\n return cnt\n\n\nprint(factorization(N))\n', 'N = int(input())\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(n)):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n #return arr\n cnt = 0\n for l in arr:\n i = l[1]\n div = 0\n while 1:\n div += 1\n i -= div\n print(div)\n if i >= 0:\n cnt += 1\n else:\n break\n \n return cnt\n\nprint(factorization(N))', 'N = int(input())\n\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp % i == 0:\n cnt = 0\n while temp % i == 0:\n cnt += 1\n temp //= i\n arr.append([i, cnt])\n\n if temp != 1:\n arr.append([temp, 1])\n\n if arr == []:\n arr.append([n, 1])\n\n # return arr\n cnt = 0\n for l in arr:\n factor = l[0]\n i = l[1]\n if factor != 1:\n div = 0\n while 1:\n div += 1\n i -= div\n if i >= 0:\n cnt += 1\n else:\n break\n\n return cnt\n\n\nprint(factorization(N))']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s027051627', 's185665582', 's915811959', 's721601012']
[9376.0, 9200.0, 9140.0, 9464.0]
[111.0, 2206.0, 2205.0, 108.0]
[691, 678, 596, 718]
p02660
u177388368
2,000
1,048,576
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.
['n=int(input())\n\nfrom math import sqrt\n\ndiv = int(sqrt(n))\nans=0\nfor i in range(2,div+1):\n if n%i==0:\n ans+=1\n n=int(n//i)\n\nif ans==0:ans=1\n\nif n==1:ans=0\nprint(ans)', 'n=int(input())\n\nimport math\n\ndef make_prime_list_2(num):\n if num < 2:\n return []\n\n \n prime_list = [i for i in range(num + 1)]\n prime_list[1] = 0 \n num_sqrt = math.sqrt(num)\n\n for prime in prime_list:\n if prime == 0:\n continue\n if prime > num_sqrt:\n break\n\n for non_prime in range(2 * prime, num, prime):\n prime_list[non_prime] = 0\n\n return [prime for prime in prime_list if prime != 0]\n\ndef prime_factorization_2(num):\n if num <= 1:\n return False\n else:\n num_sqrt = math.floor(math.sqrt(num))\n prime_list = make_prime_list_2(num_sqrt)\n\n dict_counter = {}\n for prime in prime_list:\n while num % prime == 0:\n if prime in dict_counter:\n dict_counter[prime] += 1\n else:\n dict_counter[prime] = 1\n num //= prime\n if num != 1:\n if num in dict_counter:\n dict_counter[num] += 1\n else:\n dict_counter[num] = 1\n\n return dict_counter\n\nl=prime_factorization_2(n)\nans=0\n\nif l==False:pass\nelse:\n\n for div,nums in l.items():\n num=nums\n num-=1\n i=2\n while num>=0:\n ans+=1\n num-=i\n i+=1\n\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s227523852', 's904115089']
[9188.0, 49336.0]
[143.0, 281.0]
[181, 1393]
p02660
u179376941
2,000
1,048,576
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.
["n = int(input())\n\ncount = 0\ni = 1\nnum = n\nwhile num % (2 ** i) == 0:\n num //= 2 ** i\n count += 1\n #print('{}: {}'.format(2**i, count))\n i += 1\n #print(n)\nf = 3\ni = 1\nwhile f * f <= num:\n if num % (f ** i) == 0:\n num //= f ** i\n count += 1\n #print('{}: {}'.format(f ** i, count))\n i += 1\n #print(n)\n else:\n f += 2\n i = 1\nif num == n:\n if num != 1:\n count += 1\nprint(count)", 'n = int(input())\n\nlst = []\nwhile n % 2 == 0:\n lst.append(2)\n n //= 2\nf = 3\nwhile f * f <= n:\n if n % f == 0:\n lst.append(f)\n n //= f\n else:\n f += 2\nif n != 1:\n lst.append(n)\n#print(lst)\ncount = 0\nwhile lst:\n s = 0\n i = 1\n num = lst[0]\n for ele in lst:\n if ele == num:\n s += 1\n for j in range(s):\n lst.remove(num)\n while s > 0:\n s -= i\n i += 1\n if s >= 0:\n count += 1\n #print(lst)\nprint(count)']
['Wrong Answer', 'Accepted']
['s424161559', 's344234811']
[9216.0, 9216.0]
[225.0, 126.0]
[403, 438]
p02660
u183840468
2,000
1,048,576
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.
['def prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n \n \n return a\n\nfrom collections import Counter\n\nn = int(input())\nif n == 1:\n print(0)\nelse:\n a = prime_factorize(n)\n c = Counter(a)\n ans = 0\n for v in c.values():\n for i in range(1,100):\n if v == 2:\n ans += 1\n break\n elif (i-1) * i < 2 * v <= i*(i+1):\n print(i,ans)\n ans += i\n break\n else:\n continue\n print(ans)', 'def prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n \n \n return a\n\nfrom collections import Counter\n\nn = int(input())\nif n == 1:\n print(0)\nelse:\n a = prime_factorize(n)\n c = Counter(a)\n ans = 0\n for v in c.values():\n temp = 1\n while True:\n v -= temp\n if v >= 0:\n ans +=1\n temp += 1\n else:\n break\n print(ans)']
['Wrong Answer', 'Accepted']
['s507005889', 's587392522']
[9404.0, 9444.0]
[92.0, 93.0]
[732, 637]
p02660
u188745744
2,000
1,048,576
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.
['a=int(input())\nimport math\ndef div(N):\n ans=0\n for i in range(2,int(N**0.5)+1):\n B=0\n sw=0\n if N%i==0:\n if N//i != i:\n sw=1\n c=N//i\n while N%i==0:\n N//=i\n B+=1\n for j in range(1,10000):\n B-=j\n if B >= 0:\n ans+=1\n else:\n break\n if sw==1:\n B=0\n while N%c==0:\n N//=i\n B+=1\n for j in range(1,10000):\n B-=j\n if B >= 0:\n ans+=1\n else:\n break\n return ans\nans=div(a)\nif a != 1 and ans == 0:\n print(1)\nelse:\n print(ans)', 'N=int(input())\ndef divisor_enu(N):\n l=[]\n for i in range(2,int(N**0.5)+1):\n cnt=0\n if N%i==0:\n while N%i==0:\n cnt+=1\n N//=i\n l.append(cnt)\n if N != 1:\n l.append(1)\n return l\nl=divisor_enu(N)\nans=0\nfor i in l:\n for j in range(1,11):\n if i >= (1+j)*j//2:\n ans+=1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s934101051', 's906338360']
[9500.0, 9456.0]
[2205.0, 115.0]
[709, 347]
p02660
u193582576
2,000
1,048,576
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.
['n = int(input())\n\ndef factorization(n):\n d = {}\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n d[i] = cnt\n\n if temp!=1:\n d[temp] = 1\n\n if d.keys()==[]:\n d[n] = 1\n\n return d\n\ndef get_a(n):\n N = n\n if n == 1:\n return [1]\n elif n==2:\n return [2]\n else:\n a = [1]\n\n while 1:\n n_temp = n - a[-1]\n #print(n_temp, a)\n if n_temp<=0:\n a.pop()\n a[-1] = N - sum(a[:-1])\n break\n else:\n n = n_temp\n a.append(a[-1]+1)\n #print(n_temp, a)\n return a\n\nans = 0\nfact_dict = factorization(n)\n#print(fact_dict)\n\nfor key, val in fact_dict.items():\n \n ans += len(get_a(val))\n\nif ans>0:\n print(ans)\nelse:\n print(0)\n', 'n = int(input())\n\ndef factorization(n):\n d = {}\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n d[i] = cnt\n\n if temp!=1:\n d[temp] = 1\n\n if d.keys()==[]:\n d[n] = 1\n\n return d\n\ndef get_a(n):\n N = n\n if n == 1:\n return [1]\n elif n==2:\n return [2]\n else:\n a = [1]\n\n while 1:\n n_temp = n - a[-1]\n #print(n_temp, a)\n if n_temp<0:\n a.pop()\n a[-1] = N - sum(a[:-1])\n break\n elif n_temp == 0:\n break\n else:\n n = n_temp\n a.append(a[-1]+1)\n #print(n_temp, a)\n return a\n\nans = 0\nfact_dict = factorization(n)\n#print(fact_dict)\n\nfor key, val in fact_dict.items():\n \n ans += len(get_a(val))\n\nif ans>0:\n print(ans)\nelse:\n print(0)\n']
['Wrong Answer', 'Accepted']
['s843621351', 's308884549']
[9500.0, 9508.0]
[109.0, 112.0]
[918, 961]
p02660
u195177386
2,000
1,048,576
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.
['from collections import Counter\n\ndef factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nN = int(input())\narr = dict(Counter(factorize(N)))\nprint(arr)\nans = 0\nfor v, c in arr.items():\n ans += 1\n z = 1\n for _ in range(2, c):\n z += z\n if c - z < 0:\n break\n ans += 1\nprint(ans)', 'from collections import Counter\n\ndef factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nN = int(input())\narr = dict(Counter(factorize(N)))\nans = 0\n\nfor v, c in arr.items():\n z = 0\n for i in range(1, c+1):\n z += i\n if c - z < 0:\n break\n ans += 1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s391887649', 's194300486']
[9264.0, 9468.0]
[94.0, 95.0]
[528, 507]
p02660
u202560873
2,000
1,048,576
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.
['import math\n\nN = int(input())\n\nans = 0\ncheck = [True for _ in range(10 ** 6)]\n\nfor p in range(2, 10 ** 6):\n if check[p] == True:\n for j in range(2, (10 ** 6) // p + 1):\n check[p * j] = False\n\n e = 1\n while N % (p ** e) == 0:\n N = N // (p ** e)\n e += 1\n ans += 1\n\nif ans == 0:\n if N == 1:\n print(0)\n else:\n print(1)\nelse:\n print(ans)', "import math\n\nN = int(input())\n\nM = int(math.sqrt(N))\n\nans = 0\ncheck = [True for _ in range(M + 1)]\n\nfor p in range(2, M + 1):\n if check[p] == True:\n for j in range(2, M // p + 1):\n check[p * j] = False\n\n e = 1\n while N % (p ** e) == 0:\n print(N, end=' ')\n print(p ** e)\n N = N // (p ** e)\n e += 1\n ans += 1\n\nif ans == 0:\n if N == 1:\n print(0)\n else:\n print(1)\nelse:\n print(ans)", 'import math\n \nN = int(input())\n \nM = int(math.sqrt(N))\n\nans = 0 \ncheck = [True for _ in range(M + 1)]\ne = [0 for _ in range(M + 1)]\n\nfor p in range(2, M + 1):\n if check[p] == True:\n for j in range(2, M // p + 1):\n check[p * j] = False\n\n while N % p == 0:\n N = N // p\n e[p] += 1\n \n ans += int((math.sqrt(1 + 8 * e[p]) - 1)/2)\n\nif N > 1:\n ans += 1\n\nprint(ans)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s236736618', 's575939163', 's154489841']
[16684.0, 16928.0, 24800.0]
[108.0, 480.0, 513.0]
[423, 490, 424]
p02660
u217836256
2,000
1,048,576
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.
['def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n\na = int(input())\nb = factorization(a)\ncountation = 0\nfor i in range(len(b)):\n t = b[i][1]\n k = 1\n n = 1\n while t >= n:\n countation += 1\n k = k + 1\n n = k*(k+1)/2\nif a != 1\n print(countation)\nelse:\n print(0)', 'def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n\na = int(input())\nb = factorization(a)\ncountation = 0\nfor i in range(len(b)):\n t = b[i][1]\n k = 1\n n = 1\n while t >= n:\n countation += 1\n k = k + 1\n n = k*(k+1)/2\nif a != 1:\n print(countation)\nelse:\n print(0)']
['Runtime Error', 'Accepted']
['s934870773', 's599702219']
[9120.0, 9500.0]
[19.0, 112.0]
[598, 599]
p02660
u221272125
2,000
1,048,576
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.
['N = int(input())\nans = 0\nn = int(N**0.5)\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\nfor i in range(2,n):\n A = factorization(i)\n if len(A) == 1:\n ans = 1\n N = N // i\n if N == 1:\n break\nif N != 1:\n ans += 1\nprint(ans)', 'N = int(input())\nif N == 1:\n print(0)\n quit()\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\ndef sousa(n):\n x = [1,3,6,10,15,21,28,36,45,55]\n for i in range(10):\n a = x[i]\n if n < a:\n return i\n break\nbunkai = factorization(N)\nans = 0\nfor i in range(len(bunkai)):\n c = bunkai[i][1]\n ans += sousa(c)\nprint(ans)']
['Wrong Answer', 'Accepted']
['s596356053', 's935406984']
[9684.0, 9512.0]
[2205.0, 114.0]
[557, 667]
p02660
u221998589
2,000
1,048,576
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.
["import numpy as np\nimport math\nfrom decimal import *\n#from numba import njit\n\ndef getVar():\n return map(int, input().split())\ndef getArray():\n return list(map(int, input().split()))\ndef getNumpy():\n return np.array(list(map(int, input().split())), dtype='int64')\n\ndef factorization(n):\n d = {}\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n d.append({i, cnt})\n\n if temp!=1:\n d.append({temp, 1})\n\n if d==[]:\n d.append({n, 1})\n\n return d\n\ndef main():\n N = int(input())\n d = factorization(N)\n count = 0\n\n for v in d.values():\n i = 1\n while(v >= i):\n v -= i\n i += 1\n count += 1\n \n print(count)\n\n\nmain()", "import numpy as np\nimport math\nfrom decimal import *\n#from numba import njit\n\ndef getVar():\n return map(int, input().split())\ndef getArray():\n return list(map(int, input().split()))\ndef getNumpy():\n return np.array(list(map(int, input().split())), dtype='int64')\n\ndef factorization(n):\n d = {}\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n d.update({i: cnt})\n\n if temp!=1:\n d.update({temp: 1})\n\n if d==[]:\n d.update({n:1})\n\n return d\n\ndef main():\n N = int(input())\n d = factorization(N)\n count = 0\n\n for v in d.values():\n i = 1\n while(v >= i):\n v -= i\n i += 1\n count += 1\n \n print(count)\n\n\nmain()"]
['Runtime Error', 'Accepted']
['s842691004', 's437138110']
[27068.0, 27136.0]
[195.0, 200.0]
[844, 843]
p02660
u225845681
2,000
1,048,576
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.
['import math\nN = int(input())\nif N == 1:\n print(0)\n exit()\n\n\nM = int(math.sqrt(N))+1\nsosu = [2]\na = 0\nfor i in range(3,M,2):\n if sosu[a] <= math.sqrt(i):\n a += 1\n hantei = (i%x for x in sosu[:a+1])\n if 0 not in hantei:\n sosu.append(i)\n\nsoin = []\nfor p in sosu:\n for j in range(1,N+1):\n pe = p**j\n if N % pe != 0:\n if pe != p:\n soin.append(j-1)\n break\n\nAns = 0\nfor k in soin:\n for n in range(1,k+1):\n if (n*(n+1))//2 > k:\n Ans += n-1\n break\nprint(max(Ans,1))', 'import math\nN = int(input())\nif N == 1:\n print(0)\n exit()\n \n\nM = int(math.sqrt(N))+1\nsosu = [2]\na = 0\nfor i in range(3,M,2):\n if sosu[a] <= math.sqrt(i):\n a += 1\n hantei = (i%x for x in sosu[:a+1])\n if 0 not in hantei:\n sosu.append(i)\n \nsoin = []\nfor p in sosu:\n for j in range(1,N+1):\n pe = p**j\n if N % pe != 0:\n if pe != p:\n soin.append(j-1)\n N //= p**(j-1)\n break\n\nAns = 0\nif N != 1:\n Ans += 1\n\nfor k in soin:\n if k == 1:\n Ans += 1\n continue\n for n in range(1,k+1):\n if (n*(n+1))//2 > k:\n Ans += n-1\n break\nprint(max(Ans,1))']
['Wrong Answer', 'Accepted']
['s157701712', 's944667716']
[12364.0, 12360.0]
[1292.0, 1287.0]
[573, 680]
p02660
u228303592
2,000
1,048,576
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.
['def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(n**0.5)+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n \n if temp!=1:\n arr.append([temp, 1])\n \n if arr==[]:\n arr.append([n, 1])\n \n return arr\n\na = factorization(int(input()))\nb = [1, 3, 6, 10, 15, 21, 28, 36, 43]\n\nans = 0\n\nif len(a) == 1 and a[0][0] == 1:\n print(0)\n exit()\n \nfor i in a:\n for j in range(len(b)):\n if 2 < b[j]:\n ans+=j\n break\n \nprint(ans)\n', 'def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(n**0.5)+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n \n if temp!=1:\n arr.append([temp, 1])\n \n if arr==[]:\n arr.append([n, 1])\n \n return arr\n\na = factorization(int(input()))\nb = [1, 3, 6, 10, 15, 21, 28, 36, 43]\n\nans = 0\n\nif len(a) == 1 and a[0][0] == 1:\n print(0)\n exit()\n \nfor i in a:\n for j in range(len(b)):\n if i[1] < b[j]:\n ans+=j\n break\n \nprint(ans)\n', 'def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n \n if temp!=1:\n arr.append([temp, 1])\n \n if arr==[]:\n arr.append([n, 1])\n \n return arr\n\na = factorization(int(input()))\nb = [1, 3, 6, 10, 15, 21, 28, 36, 43]\n\nans = 0\n\nif len(a) == 1 and a[0][0] == 1:\n print(0)\n exit()\n \nfor i in a:\n for j in range(len(b)):\n if i[1] < b[j]:\n ans+=j\n break\n \nprint(ans)', 'def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(n**0.5)+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp /= i\n arr.append([i, cnt])\n \n if temp!=1:\n arr.append([temp, 1])\n \n if arr==[]:\n arr.append([n, 1])\n \n return arr\n\na = factorization(int(input()))\nb = [1, 3, 6, 10, 15, 21, 28, 36, 45]\n\nans = 0\n\nif len(a) == 1 and a[0][0] == 1:\n print(0)\n exit()\n \nfor i in a:\n for j in range(len(b)):\n if i[1] < b[j]:\n ans+=j\n break\n \nprint(ans)\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s262347935', 's416967045', 's980838562', 's303328159']
[9500.0, 96472.0, 9508.0, 9432.0]
[110.0, 1206.0, 21.0, 109.0]
[534, 545, 542, 536]
p02660
u232903302
2,000
1,048,576
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.
['def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n\n\ndef calcN(num):\n if num >= 45:\n return 9\n elif num >= 36:\n return 8\n elif num >= 28:\n return 7\n elif num >= 21:\n return 6\n elif num >= 15:\n return 5\n elif num >= 10:\n return 4\n elif num >= 6:\n return 3\n elif num >= 3:\n return 2\n elif num >= 1:\n return 1\n \n\nA = int(input().split())\ninsuu = factorization(A)\nret = 0\nfor i in insuu:\n ret += calcN(i[1])\nprint(ret)', 'def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n\n\ndef calcN(num):\n if num >= 45:\n return 9\n elif num >= 36:\n return 8\n elif num >= 28:\n return 7\n elif num >= 21:\n return 6\n elif num >= 15:\n return 5\n elif num >= 10:\n return 4\n elif num >= 6:\n return 3\n elif num >= 3:\n return 2\n elif num >= 1:\n return 1\n \n\nA = int(input())\nif A == 1:\n print(0)\nelse:\n insuu = factorization(A)\n ret = 0\n for i in insuu:\n ret += calcN(i[1])\n print(ret)']
['Runtime Error', 'Accepted']
['s188485742', 's928787304']
[9192.0, 9516.0]
[23.0, 110.0]
[812, 854]
p02660
u242580186
2,000
1,048,576
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.
['import math\n\ndef primelist(num):\n if num < 2:\n return []\n ls = [2]\n n = int(math.sqrt(num))\n for i in range(3, n+1, 2):\n prime = True\n for j in ls:\n if i % j ==0:\n prime = False\n break\n if prime:\n ls += [i]\n prime = True\n for j in ls:\n if num % j ==0:\n prime = False\n break\n if prime:\n ls += [num]\n return ls\n\nn = int(input())\nls = primelist(n)\n\nans = 0\nfor i in ls:\n j = i\n while n % j == 0:\n ans += 1\n j *= i\nprint(ans)', '\ndef prime_decomposition(n):\n i = 2\n table = []\n while i * i <= n:\n while n % i == 0:\n n //= i\n table.append(i)\n i += 1\n if n > 1:\n table.append(n)\n return table\n\nfrom itertools import groupby\nN = int(input())\nP = prime_decomposition(N)\nans = 0\nfor k, g in groupby(P):\n n = len(g)\n for i in range(1, 10000000):\n n -= i\n if n >=0:\n ans += 1\n else:\n break\nprint(ans)\n\n ', "import sys\nimport time\nst = time.perf_counter()\n# ------------------------------\n\n\ndef prime_decomposition(n):\n i = 2\n table = []\n while i * i <= n:\n while n % i == 0:\n n //= i\n table.append(i)\n i += 1\n if n > 1:\n table.append(n)\n return table\n\nfrom itertools import groupby\nN = int(input())\nP = prime_decomposition(N)\nans = 0\nfor k, g in groupby(P):\n n = len(list(g))\n for i in range(1, 10000000):\n n -= i\n if n >=0:\n ans += 1\n else:\n break\nprint(ans)\n\n \n \n\n\n\n# ------------------------------\ned = time.perf_counter()\nprint('time:', ed-st, file=sys.stderr)\n"]
['Wrong Answer', 'Runtime Error', 'Accepted']
['s210771950', 's467866111', 's993733416']
[24096.0, 9108.0, 9116.0]
[2206.0, 160.0, 164.0]
[581, 481, 679]
p02660
u248670337
2,000
1,048,576
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.
['a,n=0,int(input())\nfor i in range(2,10**6):\n x=j=0\n while n%i<1:n/=i;x+=1\n while x>=j:a+=1;j+=1;x-=j\nprint(a+(n>1))', 'a,n=0,int(input())\nfor i in range(2,int(n**0.5+1)):x=0\n while(n%i==0):n//=i;x+=1\n j=1\n while(x>=j):a+=1;x-=j;j+=1\nprint(1 if n-1 else a)', 'a,n=0,int(input())\nfor i in range(2,10**6):\n x=j=0\n while n%i<1:n//=i;x+=1\n while x>j:a+=1;j+=1;x-=j\nprint(a+(n>1))']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s771731940', 's840652769', 's785752967']
[9244.0, 9012.0, 9184.0]
[376.0, 27.0, 211.0]
[118, 139, 118]
p02660
u254221913
2,000
1,048,576
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.
['import collections\n\ndef primes(n): \n cnt=collections.defaultdict(int)\n for i in range(2,int(n**0.5)+1):\n if n%i==0:\n while n%i==0:\n cnt[i]+=1\n n//=i\n if n!=1:\n cnt[n]+=1\n return cnt\n\nn=int(input())\ncnt=primes(n)\nans=0\nfor key in cnt.keys():\n val=cnt[key]\n print(key,val)\n for i in range(100): \n if (i*(i+1))//2>val:\n ans+=i-1\n break\nprint(ans)', 'import collections\n \ndef primes(n): \n cnt=collections.defaultdict(int)\n for i in range(2,int(n**0.5)+1):\n if n%i==0:\n while n%i==0:\n cnt[i]+=1\n n//=i\n if n!=1:\n cnt[n]+=1\n return cnt\n \nn=int(input())\ncnt=primes(n)\nans=0\nfor key in cnt.keys():\n val=cnt[key]\n for i in range(100): \n if (i*(i+1))//2>val:\n ans+=i-1\n break\nprint(ans)']
['Wrong Answer', 'Accepted']
['s953352176', 's170170636']
[9700.0, 9720.0]
[113.0, 112.0]
[549, 532]
p02660
u256027816
2,000
1,048,576
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.
["import math\nimport collections\n\n\ndef trial_division(n):\n factor = []\n tmp = int(math.sqrt(n)) + 1\n for num in range(2, tmp):\n while n % num == 0:\n n //= num\n if num != 1:\n factor.append(num)\n if not factor:\n return -1\n else:\n factor.append(n)\n return factor\n\n\nn = int(input())\nl = trial_division(n)\nif n == 1:\n print(0)\n exit(0)\nif l == -1:\n print(1)\n exit(0)\nif l[len(l) - 1] == 1:\n l = l[:-1]\nc = collections.Counter(l)\n\nprint('debug')\nans = 0\nfor k, v in c.items():\n s = 1\n for i in range(1, v):\n if i * (i + 1) <= v * 2:\n s = max(s, i)\n ans += s\nprint(ans)\n", 'import math\nimport collections\n\n\ndef trial_division(n):\n factor = []\n tmp = int(math.sqrt(n)) + 1\n for num in range(2, tmp):\n while n % num == 0:\n n //= num\n if num != 1:\n factor.append(num)\n if not factor:\n return -1\n else:\n factor.append(n)\n return factor\n\n\nn = int(input())\nl = trial_division(n)\nif n == 1:\n print(0)\n exit(0)\nif l == -1:\n print(1)\n exit(0)\nif l[len(l) - 1] == 1:\n l = l[:-1]\nc = collections.Counter(l)\n\nans = 0\nfor k, v in c.items():\n s = 1\n for i in range(1, v):\n if i * (i + 1) <= v * 2:\n s = max(s, i)\n ans += s\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s790092581', 's911866995']
[9492.0, 9488.0]
[112.0, 114.0]
[683, 668]
p02660
u259190728
2,000
1,048,576
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.
['def primefact(n):\n l=[]\n if n%2==0:\n while n%2==0:\n n=n//2\n l.append(2)\n for i in range(3,int(n**0.5)+1,2):\n if n%i==0:\n while n%i==0:\n n=n//i\n l.append(i)\n if n>2:\n l.append(n)\n print(len(l))\nn=int(input())\nprimefact(n)\n', '\ndef primefact(n):\n l=[]\n if n%2==0:\n while n%2==0:\n n=n//2\n l.append(2)\n for i in range(3,int(n**0.5)+1,2):\n if n%i==0:\n while n%i==0:\n n=n//i\n l.append(i)\n if n>2:\n l.append(n)\n return l\n\nn=int(input())\nc=0\na=(primefact(n))\nfor i in a:\n x=i\n while n%x==0:\n n=n//x\n c+=1\n x=x*i\nprint(c)\n \n']
['Wrong Answer', 'Accepted']
['s713526941', 's659645675']
[9360.0, 9464.0]
[67.0, 67.0]
[312, 415]
p02660
u263753244
2,000
1,048,576
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.
['def prime(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return list(set(a))\nx=int(input())\np=prime(x)\ns=0\n\nfor j in p:\n i=1\n while x%(j**i)==0:\n x=x//(j**i)\n s+=1\n i+=1\nprint(p)\nprint(s)', 'def prime(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return list(set(a))\nx=int(input())\np=prime(x)\ns=0\n\nfor j in p:\n i=1\n while x%(j**i)==0:\n x=x//(j**i)\n s+=1\n i+=1\nprint(s)']
['Wrong Answer', 'Accepted']
['s754611418', 's912575663']
[9208.0, 9212.0]
[92.0, 93.0]
[411, 402]
p02660
u268183312
2,000
1,048,576
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.
['import numpy as np\nn = int(input())\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(n**0.5)+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n \nfact = factorization(n)\nvals = []\nfor f in fact:\n for e in range(1, f[1]):\n vals.append(f[0]**e)\nvals.sort()\nif n==1:\n print(0)\nelse:\n ans = 0\n for d in vals:\n if n%d == 0:\n ans += 1\n n /= d\n print(ans)', 'import numpy as np\nn = int(input())\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(n**0.5)+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n \nfact = factorization(n)\nvals = []\nfor f in fact:\n for e in range(1, f[1]+1):\n vals.append(f[0]**e)\nvals.sort()\nif n==1:\n print(0)\nelse:\n ans = 0\n for d in vals:\n if n%d == 0:\n ans += 1\n n /= d\n print(ans)']
['Wrong Answer', 'Accepted']
['s534175310', 's820590657']
[27148.0, 27164.0]
[196.0, 200.0]
[608, 610]
p02660
u268822556
2,000
1,048,576
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.
['def factorization(n):\n arr = []\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n return arr\nN = int(input())\nans = 0\nif N != 1:\n fact_list = factorization(N)\n for _, i in fact_list:\n j = 1\n while i >= j:\n ans += 1\n i = i - j\n j += 1\n \nprint(ans)\n', 'def factorization(n):\n arr = []\n for i in range(2, int(-(-n**0.5//1))+1):\n if n%i == 0:\n cnt=0\n while n%i == 0:\n cnt += 1\n n //= i\n arr.append([i, cnt])\n\n if n != 1:\n arr.append([n, 1])\n\n return arr\nN = int(input())\nans = 0\nif N != 1:\n fact_list = factorization(N)\n for _, i in fact_list:\n j = 1\n while i >= j:\n ans += 1\n i = i - j\n j += 1\n \nprint(ans)']
['Runtime Error', 'Accepted']
['s797329015', 's499786406']
[9476.0, 9412.0]
[25.0, 111.0]
[513, 505]
p02660
u277641173
2,000
1,048,576
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.
['n=int(input())\nk=n\ndic={}\nimport math\nfor i in range(2,math.floor(math.sqrt(n))+1):\n for j in range(10**10):\n if n%i==0:\n if i in dic:\n dic[i]+=1\n else:\n dic[i]=1\n n=n//i\n else:\n break\n\ncount=0\nif k!=1:\n if not dic:\n count+=1\n if n!=1:\n count+=1\nprint(dic)\nwhile dic:\n keep=1\n x=dic.popitem()\n num=x[1]\n for i in range(1000):\n if num>=keep:\n num-=keep\n count+=1\n keep+=1\n else:\n break\nprint(count)\n', 'n=int(input())\nk=n\ndic={}\nimport math\nfor i in range(2,math.floor(math.sqrt(n))):\n for j in range(10**10):\n if n%i==0:\n if i in dic:\n dic[i]+=1\n else:\n dic[i]=1\n n=n//i\n else:\n break\n\ncount=0\nif k!=1:\n if not dic or n!=1:\n count+=1\n\nwhile dic:\n keep=1\n x=dic.popitem()\n num=x[1]\n for i in range(1000):\n if num>=keep:\n num-=keep\n count+=1\n keep+=1\n else:\n break\nprint(count)\n']
['Wrong Answer', 'Accepted']
['s585075330', 's954650716']
[9204.0, 9216.0]
[426.0, 427.0]
[477, 449]
p02660
u284363684
2,000
1,048,576
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.
['def get_prime_fact(n):\n primes = []\n append = primes.append\n while n % 2 == 0:\n append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n append(n)\n return primes\n\n\ndef get_knu(a):\n n = 2\n while True:\n knum = (n * (n + 1)) // 2\n if a >= knum:\n n += 1\n else:\n return n - 1\n\n\nD = int(input())\np = get_prime_fact(D)\n\nif len(p) != len(set(p)):\n res = 0\n for n in set(p):\n count = p.count(n)\n if count == 1:\n res += 1\n else:\n add = get_knu(count)\n res += add\n\n print(n, add)\n\n print(res)\nelse:\n print(len(p))', 'def get_prime_fact(n):\n primes = []\n append = primes.append\n while n % 2 == 0:\n append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n append(n)\n return primes\n\n\ndef get_knu(a):\n before = 1\n n = 2\n while True:\n knum = (n * (n + 1)) // 2\n if a == knum:\n return n\n elif knum > a > before:\n return n - 1\n else:\n n += 1\n before = knum\n\n\nD = int(input())\np = get_prime_fact(D)\n\nif len(p) != len(set(p)):\n res = 0\n for n in set(p):\n count = p.count(n)\n if count == 1:\n res += 1\n else:\n add = get_knu(count)\n res += add\n\n print(res)\nelse:\n print(len(p))']
['Wrong Answer', 'Accepted']
['s782070371', 's212367255']
[9240.0, 9144.0]
[92.0, 93.0]
[769, 836]
p02660
u285022453
2,000
1,048,576
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.
['\n# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=NTL_1_A&lang=ja\n\nimport math\nfrom collections import Counter\nn = int(input())\norigin = n\nans = []\n\ni = 2\nwhile i <= math.sqrt(n):\n if n % i == 0:\n n //= i\n ans.append(str(i))\n else:\n i += 1\n\nif n != 1:\n ans.append(str(n))\n# print(Counter(ans))\nf_ans = 0\nfor x, y in Counter(ans).items():\n cnt = 0\n for i in range(1, y):\n cnt += i\n if cnt == y:\n f_ans += i\n break\n if cnt > y:\n f_ans += (i - 1)\n break\n\n\nprint(f_ans)\n\n', '\n# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=NTL_1_A&lang=ja\n\nimport math\nfrom collections import Counter\nn = int(input())\norigin = n\nans = []\n\ni = 2\nwhile i <= math.sqrt(n):\n if n % i == 0:\n n //= i\n ans.append(str(i))\n else:\n i += 1\n\nif n != 1:\n ans.append(str(n))\n# print(Counter(ans))\nf_ans = 0\nfor x, y in Counter(ans).items():\n cnt = 0\n for i in range(1, y):\n cnt += i\n if cnt == y:\n f_ans += i\n break\n if cnt > y:\n f_ans += (i - 1)\n \n\nprint(f_ans)\n\n', '\n# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=NTL_1_A&lang=ja\n\nimport math\nfrom collections import Counter\nn = int(input())\norigin = n\nans = []\n\ni = 2\nwhile i <= math.sqrt(n):\n if n % i == 0:\n n //= i\n ans.append(str(i))\n else:\n i += 1\n\nif n != 1:\n ans.append(str(n))\n# print(Counter(ans))\nf_ans = 0\nfor x, y in Counter(ans).items():\n cnt = 0\n for i in range(1, y+1):\n cnt += i\n if cnt == y:\n f_ans += i\n break\n if cnt > y:\n f_ans += (i - 1)\n break\n\n\nprint(f_ans)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s003363317', 's551389437', 's255856273']
[9492.0, 9456.0, 9352.0]
[306.0, 313.0, 295.0]
[595, 585, 596]
p02660
u285257696
2,000
1,048,576
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.
['\n\n\nimport math\nN = int(input())\ns = {}\n\nfor i in range(2, math.ceil(math.sqrt(N))):\n mod = N % i\n while mod == 0:\n s[i] = s.get(i, 0) + 1\n N = N // i\n\n if N == 0:\n break\n\n mod = N % i\nif not N == 1:\n s[N] = s.get(N, 0) + 1\n\ncount = 0\nfor prime in s:\n pow = s[prime]\n\n n = 1\n while pow >= n:\n if pow == n*(n+1)/2:\n count += n\n break\n if pow < n*(n+1)/2:\n count += n-1\n break\n n += 1\n\nprint(s)\nprint(count)\n', '\n\n\nimport math\nN = int(input())\ns = {}\n\nfor i in range(2, math.ceil(math.sqrt(N))):\n mod = N % i\n while mod == 0:\n s[i] = s.get(i, 0) + 1\n N = N // i\n\n if N == 0:\n break\n\n mod = N % i\nif not N == 1:\n s[N] = s.get(N, 0) + 1\n\ncount = 0\n\nfor prime in s:\n pow = s[prime]\n\n if pow == 1:\n count += 1\n continue\n\n for i in range(1, pow+1):\n pow -= i\n if pow < 0:\n count += i - 1\n break\n\n if pow == 0:\n count += i\n break\n\nprint(count)\n']
['Wrong Answer', 'Accepted']
['s196843289', 's712211356']
[9176.0, 9228.0]
[184.0, 174.0]
[606, 641]
p02660
u285372827
2,000
1,048,576
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.
['import sys\nsys.setrecursionlimit(10 ** 9)\na = int(input())\ncount = 0\n#used = []\n\n# if a%first == 0:\n# #used.append(first)\n# a /= first\n# count += 1\n# if a==1:\n# return count\n# else:\n# div_battle(a,first+1)\ncount = 0\nfirst = a\nwhile a!=1:\n if a % first == 0:\n a /= first\n count += 1\n first -= 1\nprint(count)', 'from collections import Counter\n\ndef prime_factor(num):\n factor_list = []\n while num % 2 == 0:\n factor_list.append(2)\n num /= 2\n f = 3\n while f * f <= num:\n if num % f == 0:\n factor_list.append(f)\n num /= f\n else:\n f += 2\n if num!=1:\n factor_list.append(num)\n return factor_list\n\ndef get_count(c):\n ans = 0\n _max = c\n for i in range(1,c+1):\n if i <= _max:\n ans += 1\n _max -= i\n else:\n break\n return ans\na = int(input())\ncounter = Counter(prime_factor(a))\nans = 0\nfor i in counter:\n ans += get_count(counter[i])\nprint(ans)']
['Wrong Answer', 'Accepted']
['s726905478', 's353385971']
[9172.0, 9532.0]
[23.0, 92.0]
[360, 583]
p02660
u285436211
2,000
1,048,576
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.
['def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n if temp!=1:\n arr.append([temp, 1])\n if arr==[]:\n arr.append([n, 1])\n return arr\n\nn=int(input())\nx=factorization(n)\nif n=1:\n print(0)\n exit()\n \nans=0\nfor i in range(len(x)):\n p=x[i][1]\n j=1\n while True:\n if p>=j:\n p-=j\n ans+=1\n j+=1\n if p<j:\n break\nprint(ans) \n \n\n\n', 'def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n if temp!=1:\n arr.append([temp, 1])\n if arr==[]:\n arr.append([n, 1])\n return arr\n\nn=int(input())\nx=factorization(n)\nans=0\n\nif n==1:\n print(0)\n exit()\nfor i in range(len(x)):\n p=x[i][1]\n j=1\n while True:\n if p>=j:\n p-=j\n ans+=1\n j+=1\n if p<j:\n break\nprint(ans) \n \n\n\n']
['Runtime Error', 'Accepted']
['s651454068', 's694512929']
[9028.0, 9284.0]
[28.0, 118.0]
[571, 570]
p02660
u291028869
2,000
1,048,576
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.
['def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n\np = [1,1,2,2,2,3,3,3,3,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]\n\nn = int(input())\nif n == 0:\n print(0)\nelse:\n ans = 0\n print(factorization(n))\n for j in factorization(n):\n ans += p[j[1]-1]\n\n print(ans)', 'def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n\np = [1,1,2,2,2,3,3,3,3,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15]\n\nn = int(input())\nif n == 1:\n print(0)\nelse:\n ans = 0\n for j in factorization(n):\n ans += p[j[1]-1]\n\n print(ans)']
['Wrong Answer', 'Accepted']
['s172234012', 's751454094']
[9652.0, 9620.0]
[202.0, 109.0]
[869, 841]
p02660
u299645128
2,000
1,048,576
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.
['N = int(input())\npri_cnt = {}\nn = N\ni = 2\n\nwhile i ** 2 <= N\n while n % i == 0:\n if i not in div_cnt:\n pri_cnt[i] = 1\n else:\n pri_cnt[i] += 1\n \n n = n / i\n\nif n > 1:\n pri_cnt[N] = 1\n\nans = 0\nfor pri, cnt in pri_knt:\n count = 1\n remain = cnt\n while remain > count:\n ans += 1\n remain -= count\n count += 1\nprint(ans)', 'N = int(input())\npri_cnt = {}\nn = N\ni = 2\n\nwhile i ** 2 <= N:\n while n % i == 0:\n if i not in pri_cnt:\n pri_cnt[i] = 1\n else:\n pri_cnt[i] += 1\n n = n / i\n if (i == 2):\n i += 1\n else:\n i += 2\n\nif n > 1:\n pri_cnt[int(n)] = 1\n\nans = 0\nfor pri, cnt in pri_cnt.items():\n count = 1\n remain = cnt\n while remain >= count:\n ans += 1\n remain -= count\n count += 1\nprint(ans)']
['Runtime Error', 'Accepted']
['s178422377', 's745648052']
[9032.0, 9176.0]
[29.0, 223.0]
[349, 404]
p02660
u303058371
2,000
1,048,576
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.
['import math\n\nn = int(input())\nd = n\nm = {}\n\nfor i in range(2, int(math.sqrt(n)) + 1):\n m[i] = 0\n while (d % i == 0):\n d //= i\n m[i]+=1\nres = 0\nprint(m)\nfor i in m.values():\n res+=int(math.sqrt(i*2))\nif d > 1:\n res += 1\nprint(res)\n', 'import math\n\nn = int(input())\nd = n\nm = {}\n\nfor i in range(2, int(math.sqrt(n)) + 1):\n m[i] = 0\n while (d % i == 0):\n d //= i\n m[i]+=1\nres = 0\nfor i in m.values():\n res+=int(math.sqrt(i*2+0.25)-0.5)\n\nif d > 1:\n res += 1\nprint(res)\n']
['Wrong Answer', 'Accepted']
['s992681365', 's634893359']
[108020.0, 92768.0]
[708.0, 514.0]
[256, 257]
p02660
u307622233
2,000
1,048,576
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.
["def prime_list(lst, limit):\n for num in range(3, limit, 2):\n if num ** 2 > limit:\n break\n # is_prime(num, lst)\n flag = True\n for p_num in lst:\n if (p_num * p_num > num):\n break\n else:\n if (num % p_num == 0):\n flag = False\n break\n if flag:\n lst.append(num)\n\n\ndef main():\n n = int(input())\n lst = [2]\n prime_list(lst, n)\n # print(lst)\n\n lst2 = []\n for i in lst:\n mul_sum = i\n \n tmp = i\n while mul_sum < n:\n tmp *= i\n lst2.append(tmp)\n mul_sum *= tmp\n\n # print(lst2)\n lst.extend(lst2)\n lst.sort()\n lst.append(n)\n\n if n == 1:\n print(0)\n exit()\n\n cnt = 0\n for i in lst:\n n, m = divmod(n, i)\n\n if m == 0:\n cnt += 1\n else:\n n = n * i + m\n break\n if i < n:\n break\n else:\n if n != 0:\n cnt += 1\n\n print(cnt)\n\n\nif __name__ == '__main__':\n main()\n", "from collections import defaultdict\nimport decimal\nimport sys\ninput = sys.stdin.readline\n\n\ndef prime_factor_count(n):\n def count(n, i):\n cnt = 0\n while n % i == 0:\n cnt += 1\n n //= i\n return n, cnt\n\n d = {}\n if n == 1:\n return d\n\n n, cnt = count(n, 2)\n d[2] = cnt\n print(d, n)\n\n lst = [2]\n for num in range(3, int(n ** 0.5) + 1, 2):\n if n == 1:\n break\n for p_num in lst:\n if num % p_num == 0:\n break\n elif p_num * p_num > num:\n lst.append(num)\n n, cnt = count(n, num)\n d[num] = cnt\n break\n else:\n if n != 1:\n d[n] = 1\n return d\n\n\n\ndef main():\n n = int(input())\n d = prime_factor_count(n)\n\n cnt = 0\n tmp_n = 0\n for k, v in d.items():\n exp_cnt = 1\n while 1:\n if exp_cnt > v:\n break\n else:\n if tmp_n % (tmp_exp := k ** exp_cnt) == 0:\n tmp_n //= tmp_exp\n cnt += 1\n v -= exp_cnt\n exp_cnt += 1\n else:\n if n == tmp_n:\n cnt += 1\n print(cnt)\n\n\nif __name__ == '__main__':\n main()\n", "import sys\ninput = sys.stdin.readline\n\n\ndef prime_factor_count(n):\n def count(n, p):\n cnt = 0\n while n % p == 0:\n n //= p\n cnt += 1\n np_cnt = 1\n while (cnt := cnt - np_cnt) >= 0:\n np_cnt += 1\n return n, np_cnt - 1\n\n n, cnt = count(n, 2)\n\n if n == 1:\n return cnt\n\n for i in range(3, int(n ** 0.5) * 1, 2):\n n, tmp_cnt = count(n, i)\n cnt += tmp_cnt\n if n == 1:\n break\n else:\n cnt += 1\n\n return cnt\n\n\ndef main():\n n = int(input())\n ans = prime_factor_count(n)\n print(ans)\n\n\nif __name__ == '__main__':\n main()\n"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s068856982', 's202971362', 's316174926']
[16004.0, 15564.0, 9468.0]
[1247.0, 1156.0, 152.0]
[1112, 1274, 650]
p02660
u312158169
2,000
1,048,576
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.
['import math\nn = int(input())\n\ncount = 0\n\ndef sosu(n,z):\n for i in range(z, int(math.sqrt(n))+1):\n if n%i == 0:\n return i\n break\n return -1\n\nif sosu(n,2) == -1 and n != 1:\n print(1)\n exit()\n\nans = 0\nz = 2\n\ndef hantei(n):\n i = sosu(n,2)\n s = 0\n if sosu(n,2) == -1:\n return True\n if sosu(n,2) > 0:\n s = n ** (1/i)\n if int(s) == math.floor(s):\n print(n,s)\n return True\n else:\n return False\n\nmemo = []\n\nwhile(n != 1) :\n ans = sosu(n,z)\n print(n,ans,z)\n if ans == -1:\n if memo.count(n) == 0 and hantei(n):\n count +=1\n break\n else:\n break\n\n if hantei(ans) :\n memo.append(ans)\n z = ans+1\n n = n//ans\n count += 1\n else:\n z = ans +1\n #print(count)\n\n\n\nprint(count)\n', 'import math\nn = int(input())\n\ncount = 0\n\ndef sosu(n,z):\n for i in range(z, int(math.sqrt(n))+1):\n if n%i == 0:\n return i\n break\n return -1\n\nif sosu(n,2) == -1 and n != 1:\n print(1)\n exit()\n\nans = 0\nz = 2\n\ndef hantei(n):\n i = sosu(n,2)\n s = 0\n if sosu(n,2) == -1:\n return True\n if sosu(n,2) > 0:\n s = n ** (1/i)\n if int(s) == math.floor(s):\n #print(n,s)\n return True\n else:\n return False\n\nmemo = []\n\nwhile(n != 1) :\n ans = sosu(n,z)\n print(n,ans,z)\n if ans == -1:\n if memo.count(n) == 0 and hantei(n):\n count +=1\n break\n else:\n break\n\n if hantei(ans) :\n memo.append(ans)\n z = ans+1\n n = n//ans\n count += 1\n else:\n z = ans +1\n #print(count)\n\n\n\nprint(count)\n', 'import math\nn = int(input())\n\ncount = 0\n\ndef sosu(n,z):\n for i in range(z, int(math.sqrt(n))+1):\n if n%i == 0:\n return i\n break\n return -1\n\nif sosu(n,2) == -1 and n != 1:\n print(1)\n exit()\n\nans = 0\nz = 2\n\ndef hantei(n):\n i = sosu(n,2)\n s = 0\n if sosu(n,2) == -1:\n return True\n if sosu(n,2) > 0:\n s = n ** (1/i)\n if int(s) == math.floor(s):\n print(n,s)\n return True\n else:\n return False\n\nmemo = []\n\nwhile(n != 1) :\n ans = sosu(n,z)\n print(n,ans,z)\n if ans == -1:\n if memo.count(n) == 0 and hantei(n) and n != 1:\n count +=1\n break\n else:\n break\n\n if hantei(ans) :\n memo.append(ans)\n z = ans+1\n n = n//ans\n count += 1\n else:\n z = ans +1\n #print(count)\n\n\n\nprint(count)\n', 'n = int(input())\n\nif n == 1:\n print(0)\n exit()\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n\nst = factorization(n)\n\n\ncount = 0\ntemp = 1\n\n\nfor a,b in st:\n\n while 1/2*(temp)*(temp +1) <= b:\n temp += 1\n count += temp-1\n temp = 1\n\nprint(count)\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s030837372', 's205431624', 's778769726', 's023032161']
[9444.0, 9468.0, 9520.0, 9488.0]
[196.0, 197.0, 194.0, 112.0]
[869, 870, 880, 570]
p02660
u313890617
2,000
1,048,576
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.
['import numpy as np\nimport sys\nsys.setrecursionlimit(10**6)\n\nn=int(input())\n\nm=int(np.sqrt(n))+1\n\nif n==1 or n==0:\n print(0)\n exit()\n\nans=0\nfor i in range(2,m):\n cnt=0\n for j in range(44):\n if n%i==0:\n n=n/i\n print("i=",i,"n=",n)\n cnt+=1\n else:\n break\n if 1<=cnt<3:\n ans+=1\n if 3<=cnt<6:\n ans+=2\n if 6<=cnt<10:\n ans+=3\n if 10<=cnt<15:\n ans+=4\n if 15<=cnt<21:\n ans+=5\n if 21<=cnt<28:\n ans+=6\n if 28<=cnt<36:\n ans+=7\n if 36<=cnt<45:\n ans+=8\n\nif int(n)!=1:\n ans+=1\n\nif ans==0:\n print(1)\n exit()\n\nprint(ans) \n', 'import numpy as np\nimport sys\nsys.setrecursionlimit(10**6)\n\nn=int(input())\n\nm=int(np.sqrt(n))+1\n\nif n==1 or n==0:\n print(0)\n exit()\n\nans=0\nfor i in range(2,m):\n cnt=0\n for j in range(44):\n if n%i==0:\n n=n/i\n print("i=",i,"n=",n)\n cnt+=1\n else:\n break\n if 1<=cnt<3:\n ans+=1\n if 3<=cnt<6:\n ans+=2\n if 6<=cnt<10:\n ans+=3\n if 10<=cnt<15:\n ans+=4\n if 15<=cnt<21:\n ans+=5\n if 21<=cnt<28:\n ans+=6\n if 28<=cnt<36:\n ans+=7\n if 36<=cnt<45:\n ans+=8\n\nif n!=1:\n ans+=1\n\nif ans==0:\n print(1)\n exit()\n\nprint(ans) \n', 'import numpy as np\nimport sys\nsys.setrecursionlimit(10**6)\n\nn=int(input())\n\nm=int(np.sqrt(n))+1\n\nif n==1 or n==0:\n print(0)\n exit()\n\nans=0\nfor i in range(2,m):\n cnt=0\n for j in range(44):\n if n%i==0:\n n=n/i\n# print("i=",i,"n=",n)\n cnt+=1\n else:\n break\n if 1<=cnt<3:\n ans+=1\n if 3<=cnt<6:\n ans+=2\n if 6<=cnt<10:\n ans+=3\n if 10<=cnt<15:\n ans+=4\n if 15<=cnt<21:\n ans+=5\n if 21<=cnt<28:\n ans+=6\n if 28<=cnt<36:\n ans+=7\n if 36<=cnt<45:\n ans+=8\n\nif int(n)!=1:\n ans+=1\n\nif ans==0:\n print(1)\n exit()\n\nprint(ans) \n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s150677608', 's782574313', 's124284149']
[27120.0, 27180.0, 27172.0]
[728.0, 718.0, 745.0]
[670, 665, 671]
p02660
u314089899
2,000
1,048,576
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.
['N = int(input())\n\n\ndef factorize_dict(n):\n b = 2\n fct = dict()\n while b * b <= n:\n while n % b == 0:\n n //= b\n #fct.append(b)\n if b not in fct:\n fct[b] = 1\n else:\n fct[b] += 1\n b = b + 1\n if n > 1:\n #fct.append(n)\n if b not in fct:\n fct[n] = 1\n else:\n fct[n] += 1\n \n return fct\n\nfactorized_N = factorize_dict(N)\nprint(factorized_N)\n\nz_list = []\n\nfor f_dict in factorized_N.items():\n prime_number = f_dict[0]\n how_many = f_dict[1]\n z_list += [prime_number**i for i in range(1,how_many+1)]\n \nz_list.sort(reverse=False)\nprint(z_list)\n\nans = 0\nfor z in z_list:\n if N%z == 0:\n ans += 1\n N /= z\n if N == 1:\n break\n \nprint(ans) ', 'N = int(input())\n\n\ndef factorize_dict(n):\n b = 2\n fct = dict()\n while b * b <= n:\n while n % b == 0:\n n //= b\n #fct.append(b)\n if b not in fct:\n fct[b] = 1\n else:\n fct[b] += 1\n b = b + 1\n if n > 1:\n #fct.append(n)\n if n not in fct:\n fct[n] = 1\n else:\n fct[n] += 1\n \n return fct\n\nfactorized_N = factorize_dict(N)\nprint(factorized_N)\n\nz_list = []\n\nfor f_dict in factorized_N.items():\n prime_number = f_dict[0]\n how_many = f_dict[1]\n z_list += [prime_number**i for i in range(1,how_many+1)]\n \nz_list.sort(reverse=False)\nprint(z_list)\n\nans = 0\nfor z in z_list:\n if N%z == 0:\n ans += 1\n N /= z\n if N == 1:\n break\n \nprint(ans) ', 'N = int(input())\n\n\ndef factorize_dict(n):\n b = 2\n fct = dict()\n while b * b <= n:\n while n % b == 0:\n n //= b\n #fct.append(b)\n if b not in fct:\n fct[b] = 1\n else:\n fct[b] += 1\n b = b + 1\n if n > 1:\n #fct.append(n)\n if n not in fct:\n fct[n] = 1\n else:\n fct[n] += 1\n \n return fct\n\nfactorized_N = factorize_dict(N)\n#print(factorized_N)\n\nz_list = []\n\nfor f_dict in factorized_N.items():\n prime_number = f_dict[0]\n how_many = f_dict[1]\n z_list += [prime_number**i for i in range(1,how_many+1)]\n \nz_list.sort(reverse=False)\n#print(z_list)\n\nans = 0\nfor z in z_list:\n if N%z == 0:\n ans += 1\n N /= z\n if N == 1:\n break\n \nprint(ans) ']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s115310152', 's225402462', 's830588946']
[9272.0, 9284.0, 9288.0]
[163.0, 161.0, 160.0]
[851, 851, 853]
p02660
u315354220
2,000
1,048,576
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.
['N = int(input())\nif N == 1:\n print("0")\n exit()\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\nimport collections\n\nc = collections.Counter(prime_factorize(N))\n\nans = 0\nfor i in c.keys():\n num = c[i]\n m = 1\n while num > 1:\n num = num - m\n m += 1\n ans += 1\n\nprint(ans)', 'N = int(input())\nif N == 1:\n print("0")\n exit()\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\nimport collections\n\nc = collections.Counter(prime_factorize(N))\n\nans = 0\nfor i in c.keys():\n num = c[i]\n m = 2\n while num > 0:\n num = num - m\n m += 1\n ans += 1\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s548486173', 's226731478']
[9464.0, 9364.0]
[98.0, 95.0]
[530, 530]
p02660
u323045245
2,000
1,048,576
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.
['n=int(input())\nif n == 1:\n print(0)\n exit()\n\ndef make_divisors(n):\n divisors = []\n for i in range(1, int(n**0.5)+1):\n if n % i == 0:\n divisors.append(i)\n if i != n // i:\n divisors.append(n//i)\n divisors.sort()\n return divisors\ndivisors = make_divisors(n)\nif divisors == [1]:\n print(1)\n exit()\nans = 0\nfor i in divisors:\n if i == 1:\n continue\n j = i\n c = 0\n while n%j == 0:\n n = n //j\n j += i\n c += 1\n d = 0\n for count in range(1,1000):\n if c >= d+count:\n ans += 1\n d+=count\n else:\n break\nprint(ans)', 'n = int(input())\nif n == 1:\n print(0)\n exit()\n\ndef primes_factraizar(n):\n rn = int(n**0.5)\n is_prime = [True]*(rn+1)\n is_prime[0] = False\n is_prime[1] = False\n for i in range(2,rn+1):\n if not is_prime[i]:\n continue\n for j in range(i*2,rn+1,i):\n is_prime[j] = False\n return [i for i in range(rn+1) if is_prime[i]]\nprimes = primes_factraizar(n)\n\ndivisors = []\nfor i in primes:\n if n % i == 0:\n divisors.append(i)\n\ndivisors.sort()\n\nif divisors == []:\n print(1)\n exit()\nans = 0\n\nfor i in divisors:\n if i == 1:\n continue\n\n c = 0\n\n while n%i == 0:\n n = n // i\n c += 1\n \n d=0\n\n for count in range(1,1000):\n if c >= d+count:\n ans += 1\n d+=count\n else:\n break\nif not n == 1:\n ans += 1\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s244957104', 's418835254']
[9452.0, 36824.0]
[122.0, 159.0]
[663, 856]
p02660
u327465093
2,000
1,048,576
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.
['import math\nN = int(input())\n\ndef furui(n):\n if n < 2:\n return []\n plist = [1 for i in range(n)]\n plist[0] = plist[1] = 0\n for i in range(2, n):\n if plist[i]:\n for j in range(i*2, n, i):\n plist[j] = 0\n ret = []\n for i in range(n):\n if plist[i] != 0:\n ret.append(i)\n return ret\n\n\ndef isprime(n):\n if n == 1:\n return False\n if n % 2 == 0 and n > 2:\n return False\n for i in range(3, int(math.sqrt(n)) + 1, 2):\n if n % i == 0:\n return False\n return True\n\n\nprimes = furui(1000000)\ncount = 0\n\nif N == 1:\n print(0)\nelse:\n for p in primes:\n used = set([])\n e = 1\n z = p ** e\n while N >= z:\n if e not in used and N % z == 0:\n N //= z\n count += 1\n used.add(e)\n e = 1\n # print(z, N)\n else:\n e += 1\n z = p ** e\n if N not in primes:\n count += 1\n print(count)\n', 'def furui(n):\n if n < 2:\n return []\n plist = [1 for i in range(n)]\n plist[0] = plist[1] = 0\n for i in range(2, n):\n if plist[i]:\n for j in range(i*2, n, i):\n plist[j] = 0\n ret = []\n for i in range(n):\n if plist[i] != 0:\n ret.append(i)\n return ret\n\n\nprimes = furui(1000000)\ncount = 0\nN = int(input())\n\n\nif N == 1:\n print(0)\nelse:\n \n factors = []\n for p in primes:\n if N % p == 0:\n e = 1\n while N % (p ** (e+1)) == 0:\n e += 1\n factors.append((p, e))\n N /= p ** e\n if N != 1:\n \n factors.append((N, 1))\n # print(factors)\n\n \n count = 0\n for p, e in factors:\n s = 0\n for i in range(1, e+1):\n s += i\n if s <= e:\n # print(p ** i)\n count += 1\n else:\n break\n print(count)\n']
['Wrong Answer', 'Accepted']
['s709192572', 's813879026']
[20096.0, 19968.0]
[406.0, 326.0]
[1039, 1004]
p02660
u328179275
2,000
1,048,576
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.
['n = int(input())\n\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\na = prime_factorize(n)\nb = list(set(a))\ntotal = 0\nfor j in range(len(b)):\n c = len([i for i, x in enumerate(a) if x == list(set(a))[j]])\n y = 1\n while c>0:\n c -= y\n y += 1\n if c>=0:\n total +=1\n ', 'n = int(input())\n\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\na = prime_factorize(n)\nb = list(set(a))\ntotal = 0\nfor j in range(len(b)):\n c = len([i for i, x in enumerate(a) if x == list(set(a))[j]])\n y = 1\n while c>0:\n c -= y\n y += 1\n if c>=0:\n total +=1\nprint(total)']
['Wrong Answer', 'Accepted']
['s132837920', 's190608169']
[9224.0, 9236.0]
[92.0, 94.0]
[528, 539]
p02660
u329049771
2,000
1,048,576
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.
['def factorize(n):\n \n res = {}\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp % i == 0:\n res[i] = 0\n while temp % i ==0:\n res[i] += 1\n temp //= i\n\n if temp != 1:\n res[temp] = 1\n\n if len(res) == 0:\n res[n] = 1\n\n return res\n\ndef factorize_exp(n):\n """\n Return only exponents of factorization.\n :return: e.g. factorize(24) -> [3, 1] (24 = 2**3 * 3**1)\n """\n res = []\n temp = n\n\n if n == 1:\n \n return res\n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp % i == 0:\n cnt = 0\n while temp % i ==0:\n cnt += 1\n temp //= i\n res.append(cnt)\n if temp != 1:\n res.append(1)\n\n if len(res) == 0:\n res.append(1)\n\n return res\n\n\nn = int(input())\nfactors = factorize_exp(n)\ncnt = 0\nprint(factors)\n\nfor i in factors:\n rem = i\n j = 1\n while rem >= j:\n rem -= j\n cnt += 1\n j += 1\n\nprint(cnt)', 'def factorize(n):\n \n res = {}\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp % i == 0:\n res[i] = 0\n while temp % i ==0:\n res[i] += 1\n temp //= i\n\n if temp != 1:\n res[temp] = 1\n\n if len(res) == 0:\n res[n] = 1\n\n return res\n\ndef factorize_exp(n):\n """\n Return only exponents of factorization.\n :return: e.g. factorize(24) -> [3, 1] (24 = 2**3 * 3**1)\n """\n res = []\n temp = n\n\n if n == 1:\n \n return res\n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp % i == 0:\n cnt = 0\n while temp % i ==0:\n cnt += 1\n temp //= i\n res.append(cnt)\n if temp != 1:\n res.append(1)\n\n if len(res) == 0:\n res.append(1)\n\n return res\n\n\nn = int(input())\nfactors = factorize_exp(n)\ncnt = 0\n\nfor i in factors:\n rem = i\n j = 1\n while rem >= j:\n rem -= j\n cnt += 1\n j += 1\n\nprint(cnt)']
['Wrong Answer', 'Accepted']
['s322389322', 's507179295']
[9544.0, 9540.0]
[110.0, 112.0]
[1184, 1169]
p02660
u335950809
2,000
1,048,576
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.
['import math\n\np = "2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641"\np = map(int,p.split())\nmemo = []\nans = 0\n\ndef isprime(x):\n if x <= 1:\n return False\n \n for i in range(2,math.floor(math.sqrt(x))+1):\n if (x % i) == 0:\n return False\n return True\n\ndef z_make(n):\n for prime in p:\n for i in range(400):\n z = prime ** i\n \n if z > n:\n break\n \n if not z in memo:\n memo.append(z)\n\ndef divGame2(n):\n for z in memo:\n global ans\n if n % z == 0:\n rem = n / z\n memo.remove(z)\n ans += 1\n \n return divGame2(rem)\n \nn = int(input())\n\nif isprime(n):\n print(1)\nelse:\n z_make(n)\n memo.sort()\n divGame2(n)\n print(ans)\n ', 'import math\n\n\ndef makePrime(m):\n p = [i for i in range(m + 1)]\n for i in p[3:]:\n if p[i] % 2 == 0: p[i] = 0\n\n root_m = m ** 0.5\n for i in range(3,m):\n if i > root_m: break\n if p[i] != 0:\n for j in range(i, m + 1, 2):\n if i * j >= m + 1: break\n p[i * j] = 0\n #return p\n return sorted(list(set(p)))[2:]\n\n\n\ndef isPrime(x):\n if x <= 1:\n return False\n \n for i in range(2,math.floor(math.sqrt(x))+1):\n if (x % i) == 0:\n return False\n return True\n\n\ndef z_make(n,p):\n for prime in p:\n for i in range(1,100000000000):\n z = prime ** i\n \n if z >= n:\n break\n \n if not z in memo:\n memo.append(z)\n\ndef divGame2(n):\n for z in memo:\n global ans\n if n % z == 0:\n rem = n / z\n memo.remove(z)\n ans += 1\n \n return divGame2(rem)\n if n < z:\n break\n\nmemo = [] # memory\nans = 0 # answer\np = [] \n\nn = int(input())\n\nif isPrime(n): \n print(1)\nelse:\n \u3000p = makePrime(64000) \n z_make(n,p) \n memo.sort() \n\n divGame2(n) \n print(ans) ', 'import math\n\np = "2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641"\np = map(int,p.split())\nmemo = []\nans = 0\n\ndef isprime(x):\n if x <= 1:\n return False\n \n for i in range(2,math.floor(math.sqrt(x))+1):\n if (x % i) == 0:\n return False\n return True\n\ndef z_make(n):\n for prime in p:\n for i in range(50):\n z = prime ** i\n \n if z > n:\n break\n \n if not z in memo:\n memo.append(z)\n\ndef divGame2(n):\n for z in memo:\n global ans\n if n % z == 0:\n rem = n / z\n memo.remove(z)\n ans += 1\n \n return divGame2(rem)\n \nn = int(input())\n\nif isprime(n):\n print(1)\nelse:\n z_make(n)\n memo.sort()\n divGame2(n)\n print(ans)\n ', 'import itertools\n\ns = "2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101"\ns = list(map(int,s.split()))\n\nn = int(input())\nans = 0\ntmp = 0\n\nfor i in s:\n \n for j in range(1,37):\n if (n % (i ** j)) == 0:\n tmp = (n / (i ** j))\n ans = ans + 1\n if tmp == 1:\n itertools.product()\n\nprint(ans)', 'import itertools\n\ns = "2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491"\ns = list(map(int,s.split()))\n\nn = int(input())\nans = 0\ntmp = 0\n\nfor i in s:\n \n for j in range(1,37):\n if (n % (i ** j)) == 0:\n tmp = (n / (i ** j))\n ans = ans + 1\n if tmp == 1:\n itertools.product()\n\nprint(ans)', 'import math\n\np = "2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641"\np = map(int,p.split())\nmemo = []\nans = 0\n\ndef isprime(x):\n if x <= 1:\n return False\n \n for i in range(2,math.floor(math.sqrt(x))+1):\n if (x % i) == 0:\n return False\n return True\n\ndef z_make(n):\n for prime in p:\n for i in range(50):\n z = prime ** i\n \n if z > n:\n break\n \n if not z in memo:\n memo.append(z)\n\ndef divGame2(n):\n for z in memo:\n global ans\n if n % z == 0:\n rem = n / z\n memo.remove(z)\n ans += 1\n print("n=",n," z=",z,"rem=",rem," ans=",ans)\n return divGame2(rem)\n \nn = int(input())\n\nif isprime(n):\n print(1)\nelse:\n z_make(n)\n memo.sort()\n divGame2(n)\n print(ans)\n ', 'import itertools\n\ns = "2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491"\ns = list(map(int,s.split()))\n\nn = int(input())\nans = 0\ntmp = 0\n\nfor i in s:\n \n for j in range(1,37):\n if (n % (i ** j)) == 0:\n tmp = (n / (i ** j))\n ans = ans + 1\n if tmp == 1:\n itertools.product()\n break\n\nprint(ans)', 'n = int(input())\n\ni = 2\nmemo = []\nwhile( i*i <= n ):\n x = 0\n while(n % i == 0):\n \n n = int(n / i);\n x = x + 1\n memo.append([i,x])\n i = i + 1\n\nif not (n == 1):\n memo.append([n,1])\n\nans = 0\nfor i in memo:\n x = i[1]\n b = 1\n while b <= x:\n x = x - b\n b = b + 1\n ans = ans + 1\n\nprint(ans)\n']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s176321008', 's231038227', 's239070202', 's293351417', 's753401267', 's953470261', 's968835968', 's225666961']
[9172.0, 9092.0, 9220.0, 9172.0, 9196.0, 9316.0, 9184.0, 127844.0]
[111.0, 23.0, 109.0, 23.0, 26.0, 112.0, 23.0, 947.0]
[1260, 1582, 1259, 370, 642, 1258, 660, 391]
p02660
u338597441
2,000
1,048,576
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.
['def func(N):\n tmp=N\n arr=[]\n for i in range(2,(N**0.5//1+1)):\n if tmp%i==0:\n cnt=0\n while tmp%i==0:\n cnt+=1\n tmp//=i\n arr.append([i,cnt])\n \n if tmp!=1:\n arr.append([tmp, 1])\n if arr==[]:\n arr.append([tmp,1])\n \n return arr\n\nN=int(input())\na=func(N)\nans=0\nif a[0][0]==1:\n print(0)\n exit()\n \nb=[1,3,6,10,15,21,28,36,45]\nfor i in a:\n for j in range(len(b)):\n if i[1]<b[j]:\n ans+=j\n break\nprint(ans)\n \n ', 'a=int(input())\ndef f(a):\n count=0\n t=2\n for z in range(t,a+1):\n if(a%z==0):\n for p in range(2,z+1):\n so=0\n if(p==2 or p==3 or (p%2>0 and p%3>0)):\n e=1\n while True:\n if(z==p**e):\n a=a/z\n count+=1\n so+=1\n break\n elif(z<p**e):\n break\n e+=1\n if(so!=0): break\n t+=1 \n return count\nf(a) ', 'def func(N):\n tmp=N\n arr=[]\n for i in range(2,int(-(-N**0.5//1))+1):\n if tmp%i==0:\n cnt=0\n while tmp%i==0:\n cnt+=1\n tmp//=i\n arr.append([i,cnt])\n if arr==[] or temp!=1:\n arr.append([tmp,1])\n \n return arr\n\nN=int(input())\na=func(N)\nans=0\nif a[0][0]==1:\n print(0)\n exit()\n \nb=[1,3,6,10,15,21,28,36,45]\nfor i in a:\n for j in range(len(b)):\n if i[1]<b[j]:\n ans+=j\n break\nprint(ans)\n ', 'def func(N):\n tmp=N\n arr=[]\n for i in range(2,int(-(-N**0.5//1))+1):\n if tmp%i==0:\n cnt=0\n while tmp%i==0:\n cnt+=1\n tmp//=i\n arr.append([i,cnt])\n \n if temp!=1:\n arr.append([tmp, 1])\n if arr==[]:\n arr.append([tmp,1])\n \n return arr\n\nN=int(input())\na=func(N)\nans=0\nif a[0][0]==1:\n print(0)\n exit()\n \nb=[1,3,6,10,15,21,28,36,45]\nfor i in a:\n for j in range(len(b)):\n if i[1]<b[j]:\n ans+=j\n break\nprint(ans)\n \n ', 'def func(N):\n tmp=N\n arr=[]\n for i in range(2,int(-(-N**0.5//1))+1):\n if tmp%i==0:\n cnt=0\n while tmp%i==0:\n cnt+=1\n tmp//=i\n arr.append([i,cnt])\n \n if temp!=1:\n arr.append([tmp, 1])\n if arr==[]:\n arr.append([n,1])\n \n return arr\n\nN=int(input())\na=func(N)\nans=0\nif a[0][0]==1:\n print(0)\n exit()\n \nb=[1,3,6,10,15,21,28,36,45]\nfor i in a:\n for j in range(len(b)):\n if i[1]<b[j]:\n ans+=j\n break\nprint(ans)\n \n ', 'def func(N):\n tmp=N\n arr=[]\n for i in range(2,int((N**0.5//1))+1):\n if tmp%i==0:\n cnt=0\n while tmp%i==0:\n cnt+=1\n tmp//=i\n arr.append([i,cnt])\n \n if tmp!=1 or arr==[]:\n arr.append([tmp, 1])\n return arr\n\nN=int(input())\na=func(N)\nans=0\nif a[0][0]==1:\n print(0)\n exit()\n \nb=[1,3,6,10,15,21,28,36,45]\nfor i in a:\n for j in range(len(b)):\n if i[1]<b[j]:\n ans+=j\n break\nprint(ans)\n \n ']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s027162286', 's096227667', 's270720579', 's341192793', 's922470838', 's557623408']
[9504.0, 9284.0, 9488.0, 9488.0, 9404.0, 9480.0]
[24.0, 2205.0, 110.0, 111.0, 112.0, 108.0]
[576, 628, 524, 584, 582, 544]
p02660
u338904752
2,000
1,048,576
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.
['import math\n\nN = int(input())\n\nfact = set()\ncounter = 0\n\nfor i in range(2, int(math.sqrt(N))+1):\n if N % i != 0:\n continue\n powt = 0\n while N % i == 0:\n powt += 1\n N /= i\n fact.add((i, powt))\n\nif N != 1:\n fact.add((N, 1))\n\nfor base, e in fact:\n for t in range(1, e+1):\n if t <= e:\n e -= t\n counter += 1\nprint(fact)\nprint(counter)\n', 'import math\n\nN = int(input())\n\nfact = set()\ncounter = 0\n\nfor i in range(2, int(math.sqrt(N))+1):\n if N % i != 0:\n continue\n powt = 0\n while N % i == 0:\n powt += 1\n N /= i\n fact.add((i, powt))\n\nif N != 1:\n fact.add((N, 1))\n\nfor base, e in fact:\n for t in range(1, e+1):\n if t <= e:\n e -= t\n counter += 1\nprint(counter)\n']
['Wrong Answer', 'Accepted']
['s762451081', 's348370458']
[9244.0, 9248.0]
[140.0, 143.0]
[398, 386]
p02660
u339199690
2,000
1,048,576
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.
['import math\n\ndef f(n):\n arr = list()\n temp = n\n for i in range(2, int(math.sqrt(n)) + 1):\n if temp % i == 0:\n cnt = 0\n while temp % i == 0:\n cnt += 1\n temp //= i\n arr.append(tuple(i, cnt))\n\n if temp != 1:\n tup = tuple(temp, 1)\n arr.append(tup)\n\n if len(arr) == 0:\n tup = tuple(n, 1)\n arr.append(tup)\n\n return arr\n\nN = int(input())\nif N == 1:\n print(0)\n exit()\n\nt = f(N)\nres = 0\nA = [0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6]\nfor a in t:\n res += int(A[a[1]])\nprint(res)\n', 'import math\n\ndef f(n):\n arr = list()\n temp = n\n for i in range(2, int(math.sqrt(n)) + 1):\n if temp % i == 0:\n cnt = 0\n while temp % i == 0:\n cnt += 1\n temp //= i\n arr.append(tuple([i, cnt]))\n\n if temp != 1:\n tup = tuple([temp, 1])\n arr.append(tup)\n\n if len(arr) == 0:\n tup = tuple([n, 1])\n arr.append(tup)\n\n return arr\n\nN = int(input())\nif N == 1:\n print(0)\n exit()\n\nt = f(N)\nres = 0\n\nfor a in t:\n cnt = 0\n c = 0\n while cnt <= a[1]:\n c += 1\n cnt += c\n res += c - 1\n \nprint(res)\n']
['Runtime Error', 'Accepted']
['s287581447', 's642229497']
[9124.0, 9244.0]
[109.0, 110.0]
[636, 629]
p02660
u346308892
2,000
1,048,576
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.
['\nimport numpy as np\nfrom functools import *\nimport sys\nsys.setrecursionlimit(100000)\ninput = sys.stdin.readline\n\n\nimport numpy as np\n\ndef acinput():\n return list(map(int, input().split(" ")))\n\n \ndef factorize(n):\n fct = [] \n b, e = 2, 0 \n while b * b <= n:\n while n % b == 0:\n n = n // b\n e = e + 1\n if e > 0:\n fct.append((b, e))\n b, e = b + 1, 0\n if n > 1:\n fct.append((n, 1))\n return fct\n\n\n\ns=factorize(float(input()))\n\nres=0\n\nfor ss,n in s:\n tmp=np.floor((np.sqrt(8*n+1)-1)/2)\n print(tmp)\n res+=tmp\n\nprint(int(np.floor(res)))', '\nimport numpy as np\nfrom functools import *\nimport sys\nsys.setrecursionlimit(100000)\ninput = sys.stdin.readline\n\n\nimport numpy as np\n\ndef acinput():\n return list(map(int, input().split(" ")))\n\n \ndef factorize(n):\n fct = [] \n b, e = 2, 0 \n while b * b <= n:\n while n % b == 0:\n n = n // b\n e = e + 1\n if e > 0:\n fct.append((b, e))\n b, e = b + 1, 0\n if n > 1:\n fct.append((n, 1))\n return fct\n\n\n\ns=factorize(float(input()))\n\nres=0\n\nfor ss,n in s:\n tmp=np.floor((np.sqrt(8*n+1)-1)/2)\n #print(tmp)\n res+=tmp\n\nprint(int(np.floor(res)))\n\n#print(s)']
['Wrong Answer', 'Accepted']
['s136110019', 's203388331']
[27100.0, 27164.0]
[342.0, 333.0]
[651, 663]
p02660
u347452770
2,000
1,048,576
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.
["import math\n\n\ndef trial_division(n):\n \n factor = []\n \n tmp = int(math.sqrt(n)) + 1\n for num in range(2,tmp):\n while n % num == 0:\n n //= num\n factor.append(num)\n \n if not factor:\n return 'prime number'\n else:\n factor.append(n)\n return factor\n \nn = int(input())\nn_list = trial_division(n)\nans = 0\nz = []\nfor i in range(len(n_list)):\n if n_list[i] == 1:\n break\n else:\n if n % n_list[i] == 0:\n z.append(n_list[i])\n n = n / n_list[i]\n ans += 1\nprint(ans)", 'def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n \nn = int(input())\nn_list = factorization(n)\noh = []\nfor i in range(len(n_list)):\n num = n_list[i][0] \n kata = n_list[i][1] \n for i in range(1, kata+1):\n oh.append(num ** i)\noh.sort()\nans = 0\nz = []\nfor i in range(len(oh)):\n if oh[i] == 1:\n break\n else:\n if n % oh[i] == 0 and oh[i] not in z:\n z.append(oh[i])\n n = n / oh[i]\n ans += 1\nprint(ans)']
['Runtime Error', 'Accepted']
['s307763922', 's831167152']
[9288.0, 9528.0]
[111.0, 113.0]
[681, 741]
p02660
u354804355
2,000
1,048,576
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.
['def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n\nA = factorization(N) \n\ncount = 0\nfor i in A:\n judge = 1\n temp = i[1]\n while temp >= judge:\n count += 1\n temp -=judge\n judge += 1\n\nif N == 1:\n count = 0\n\nprint(count)', 'def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n\nN = int(input())\nA = factorization(N) \n\ncount = 0\nfor i in A:\n judge = 1\n temp = i[1]\n while temp >= judge:\n count += 1\n temp -=judge\n judge += 1\n\nif N == 1:\n count = 0\n\nprint(count)']
['Runtime Error', 'Accepted']
['s797255219', 's635482895']
[9160.0, 9492.0]
[23.0, 110.0]
[532, 549]
p02660
u362127784
2,000
1,048,576
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.
['a =int(input())\nlist= []\nn = 0\nfor i in range(2,1000000):\n if (a % i == 0):\n warikaisi = True\n while(warikaisi):\n if a % i == 0:\n list.append(i)\n a = a / i\n else:\n n = n + 1\n warikaisi = False\nprint(n)', 'a =int(input())\nlist = []\nb = 1\nfor i in range(2,44):\n list.append(b)\n b = b + i\nn = 0\ne = 0\nk = 0\nfor i in range(2,1000000):\n if (a % i == 0):\n warikaisi = True\n while(warikaisi):\n if a % i == 0:\n list.append(i)\n a = a / i\n e = e + 1\n if (e == list[k]):\n n = n + 1\n k = k + 1\n else:\n e = 0\n k = 0\n warikaisi = False\nif (a >= 1000000):\n n = n + 1\nprint(n)']
['Wrong Answer', 'Accepted']
['s942379671', 's481717319']
[9188.0, 9276.0]
[156.0, 167.0]
[300, 546]
p02660
u362599643
2,000
1,048,576
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.
["from collections import Counter\n \ndef factorize(n):\n a = 2\n fct = []\n while a <= n:\n print('-------')\n while n % a == 0:\n n = n // a\n fct.append(a)\n a += 1\n if n > 1:\n fct.append(n)\n return fct\n \n \nn = int(input())\nc = Counter(factorize(n))\n# print(factorize(n))\n# print(c.values())\n\n\nans = 0\nfor v in c.values():\n t = 1\n while v >= t:\n v -= t\n t += 1\n ans += 1\nprint(ans)", "from collections import Counter\n \ndef factorize(n):\n a = 2\n fct = []\n while a*a <= n:\n # print('-------')\n while n % a == 0:\n n = n // a\n fct.append(a)\n a += 1\n if n > 1:\n fct.append(n)\n return fct\n \n \nn = int(input())\nc = Counter(factorize(n))\n# print(factorize(n))\n# print(c.values())\n\n\nans = 0\nfor v in c.values():\n t = 1\n while v >= t:\n v -= t\n t += 1\n ans += 1\nprint(ans)"]
['Wrong Answer', 'Accepted']
['s751360018', 's735960294']
[61680.0, 9468.0]
[2430.0, 164.0]
[464, 468]
p02660
u363074342
2,000
1,048,576
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.
['n = int(input())\n\ndef factorize(n):\n fct = [] \n b, e = 2, 0 \n while b * b <= n:\n while n % b == 0:\n n = n // b\n e = e + 1\n if e > 0:\n fct.append([b, e])\n b, e = b + 1, 0\n if n > 1:\n fct.append([n, 1])\n return fct\n\naoinsu = factorize(n)\n\nkaijo = [1]\nb = 1\nfor i in range(1,10):\n b = b+i\n kaijo.append(b)\n\n\n\n#print(aoinsu)\n\nans = 0\nfor i in range(len(aoinsu)):\n a = aoinsu[i][1]\n for j in range(10):\n if a <= kaijo[j]:\n ans += j\n break\n\n\nprint(ans)', 'n = int(input())\n\ndef factorize(n):\n fct = [] \n b, e = 2, 0 \n while b * b <= n:\n while n % b == 0:\n n = n // b\n e = e + 1\n if e > 0:\n fct.append([b, e])\n b, e = b + 1, 0\n if n > 1:\n fct.append([n, 1])\n return fct\n\naoinsu = factorize(n)\n\nkaijo = [1]\nb = 1\nfor i in range(2,10):\n b = b+i\n kaijo.append(b)\n\n\n\n#print(aoinsu)\n\nans = 0\nfor i in range(len(aoinsu)):\n a = aoinsu[i][1]\n for j in range(10):\n if a < kaijo[j]:\n ans += j\n break\n\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s186464665', 's578326853']
[9240.0, 9232.0]
[182.0, 178.0]
[582, 581]
p02660
u364061715
2,000
1,048,576
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.
['N = int(input())\nif N == 1:\n print(0)\nelse:\n result = 0\n for i in range(len(factorization(N))):\n tempnumber = factorization(N)[i][1]\n plusnumber = 1\n while tempnumber > 0:\n tempnumber -= plusnumber\n result += 1\n plusnumber += 1\n print(result)', 'def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\nN = int(input())\nif N == 1:\n print(0)\nelse:\n result = 0\n for i in range(len(factorization(N))):\n tempnumber = factorization(N)[i][1]\n plusnumber = 1\n while tempnumber > 0:\n result += 1\n plusnumber += 1\n tempnumber -= plusnumber\n print(result)']
['Runtime Error', 'Accepted']
['s689059812', 's808194537']
[9184.0, 9500.0]
[22.0, 452.0]
[308, 660]
p02660
u364693468
2,000
1,048,576
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.
['import sympy\nN = int(input())\np_list = list(sympy.primerange(2,1000000))\nprint(p_list)\ncnt = 0\nfor i in range(10000):\n j = 1\n while N % (p_list[i] ** j) == 0:\n cnt += 1\n N = N / (p_list[i] ** j)\n j += 1\n a = sympy.isprime(N)\n if a == True:\n cnt += 1\n break\nprint(cnt)', 'def sieve(n):\n is_prime = [True for _ in range(n+1)]\n is_prime[0] = False\n\n for i in range(2, n+1):\n if is_prime[i-1]:\n j = 2 * i\n while j <= n:\n is_prime[j-1] = False\n j += i\n table = [ i for i in range(1, n+1) if is_prime[i-1]]\n return table\n\ndef is_prime(n):\n for i in range(2, n + 1):\n if i * i > n:\n break\n if n % i == 0:\n return False\n return n != 1\n\nN = int(input())\np_list = sieve(10000000)\ncnt = 0\nfor i in range(100000):\n for j in range(1,100):\n q, mod = divmod(N, (p_list[i] ** j))\n if mod == 0:\n cnt += 1\n N = q\n else:\n break\n if N > 104743:\n a = is_prime(N)\n if a == True:\n cnt += 1\n break\nprint(cnt)\n', 'import collections\n\ndef prime_decomposition(n):\n i = 2\n table = []\n while i * i <= n:\n while n % i == 0:\n n //= i\n table.append(i)\n i += 1\n if n > 1:\n table.append(n)\n return table\n\nN = int(input())\nif N == 1:\n print(0)\nelse:\n A = prime_decomposition(N)\n\n c = collections.Counter(A)\n values, counts = zip(*c.most_common())\n\n\n cnt = 0\n for i in range(len(counts)):\n for j in range(10,0,-1):\n if counts[i] >= j * (j + 1)//2:\n cnt += j\n break\n print(cnt)']
['Runtime Error', 'Time Limit Exceeded', 'Accepted']
['s499600104', 's904191006', 's288934345']
[9064.0, 87252.0, 9464.0]
[24.0, 2208.0, 166.0]
[314, 864, 588]
p02660
u364774090
2,000
1,048,576
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.
['n = int(input())\nans = 0\n\nd = 2\nwhile d * d < n:\n if n % d != 0:\n d += 1\n continue\n\n e = d\n while n % e == 0:\n print(n, e)\n n //= e\n e *= d\n ans += 1\n\nif n != 1:\n ans += 1\n\nprint(ans)', 'n = int(input())\nans = 0\n\nd = 2\nwhile d * d <= n:\n if n % d != 0:\n d += 1\n continue\n\n e = d\n while n % e == 0:\n n //= e\n e *= d\n ans += 1\n\n while n % d == 0:\n n //= d\nif n != 1:\n ans += 1\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s860743473', 's146638401']
[9148.0, 9188.0]
[228.0, 224.0]
[237, 256]
p02660
u373047809
2,000
1,048,576
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.
['n=int(input())\np=1\nwhile p<1e6:\n c=t=0;p+=1\n while n%p<1:n/=p;x=c==t;t+=x;c+=1-t*x\nprint(t+1-(n<2))', 'n=int(input())\na=p=1\nwhile p<1e6:\n c=t=0;p+=1\n while n%p<1:n/=p;x=c==t;t+=x;c+=1-t*x;a+=x\nprint(a-(n<2))']
['Wrong Answer', 'Accepted']
['s309370079', 's318817163']
[9188.0, 9248.0]
[248.0, 253.0]
[99, 104]
p02660
u374082254
2,000
1,048,576
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.
['import collections\n\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nN = int(input())\n\nprimes = prime_factorize(N)\n\n\nnum = 0\nhist = []\nc = primes[0]\nfor p in primes:\n if c not in hist:\n hist.append(c)\n num += 1\n c = 1\n c *= p\n\nprint(num)\n', 'def prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\nN = int(input())\n\nprimes = prime_factorize(N)\n\nnum = 0\nhist = [1]\nc = 1\n\ntmp = 1\nfor p in primes:\n \n if tmp != p:\n c = 1\n tmp = p\n c *= p\n if c not in hist:\n hist.append(c)\n num += 1\n c = 1\nprint(num)\n']
['Runtime Error', 'Accepted']
['s845026027', 's256039633']
[9408.0, 9212.0]
[92.0, 91.0]
[492, 545]
p02660
u377158682
2,000
1,048,576
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.
['pf={}\nm=int(input())\nfor i in range(2,int(m**0.5)+1):\n while m%i==0:\n pf[i]=pf.get(i,0)+1\n m//=i\nif m>1:pf[m]=1\nprint(pf)\n\ncnt = 0\na = []\na.append(0)\nfor i in range(1,30000):\n a.append(i + a[i-1])\n#print(a)\nfor i in pf:\n s = pf[i]\n c = s\n if c in a:\n cnt += a.index(c)\n else:\n cnt += 1\n #print(c)\nprint(cnt)\n\n', 'pf={}\nm=int(input())\nfor i in range(2,int(m**0.5)+1):\n while m%i==0:\n pf[i]=pf.get(i,0)+1\n m//=i\nif m>1:pf[m]=1\nprint(pf)\n\ncnt = 0\na = []\na.append(0)\nfor i in range(1,30000):\n a.append(i + a[i-1])\n#print(a)\nfor i in pf:\n s = pf[i]\n c = s\n if c in a:\n cnt += a.index(c)\n else:\n cnt += 1\n #print(c)\nprint(cnt)\n\n', 'from math import sqrt\npf={}\nm=int(input())\nfor i in range(2,int(m**0.5)+1):\n while m%i==0:\n pf[i]=pf.get(i,0)+1\n m//=i\nif m>1:pf[m]=1\n#print(pf)\n\ncnt = 0\ncalc = lambda n: (sqrt(8 * n + 1) - 1) // 2\nfor i in pf:\n v = pf[i]\n n = 1\n while v >= n:\n v -= n\n cnt += 1\n n += 1\n# cnt += calc(pf[i])\nprint(int(cnt))\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s492009315', 's622903681', 's570436538']
[10448.0, 10420.0, 9456.0]
[147.0, 146.0, 144.0]
[358, 358, 357]
p02660
u382407432
2,000
1,048,576
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.
['def make_divisors(n):\n lower_divisors , upper_divisors = [], []\n i = 1\n while i*i <= n:\n if n % i == 0:\n lower_divisors.append(i)\n if i != n // i:\n upper_divisors.append(n//i)\n i += 1\n return lower_divisors + upper_divisors[::-1]\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n\nfactorization(24) \n\nimport sys\nN=int(input())\nif(N==1):\n print(0)\n sys.exit()\ndiv = make_divisors(N)\ndiv.remove(1)\nnew_div=[]\nfor k in div:\n jud=factorization(k) \n if(len(jud)==1):\n new_div.append(k)\nans=0\nprint(new_div)\nfor i in new_div:\n if(N%i==0):\n N=N/i\n ans+=1\n if(N==1):\n print(ans)\n sys.exit()\nprint(ans)', 'def make_divisors(n):\n lower_divisors , upper_divisors = [], []\n i = 1\n while i*i <= n:\n if n % i == 0:\n lower_divisors.append(i)\n if i != n // i:\n upper_divisors.append(n//i)\n i += 1\n return lower_divisors + upper_divisors[::-1]\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n\nfactorization(24) \n\nimport sys\nN=int(input())\nif(N==1):\n print(0)\n sys.exit()\ndiv = make_divisors(N)\ndiv.remove(1)\nnew_div=[]\nfor k in div:\n jud=factorization(k) \n if(len(jud)==1):\n new_div.append(k)\nans=0\n\nfor i in new_div:\n if(N%i==0):\n N=N/i\n ans+=1\n if(N==1):\n print(ans)\n sys.exit()\nprint(ans)']
['Wrong Answer', 'Accepted']
['s120232447', 's826216625']
[9456.0, 9536.0]
[917.0, 914.0]
[980, 966]
p02660
u385309449
2,000
1,048,576
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.
['def factorization(y):\n arr = []\n temp = y\n for i in range(2, int(-(-y**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n if temp!=1:\n arr.append([temp, 1])\n if arr==[]:\n arr.append([y, 1])\n return arr\nn=int(input())\nif n==1:\n print(0)\n exit()\nans=0\nl=factorization(n)\nfor i,j in l:\n if j<=2:\n ans+=1\n else:\n t=1\n while j:\n print(j,t)\n if j<t:\n break\n ans+=1\n j-=t\n t+=1 \nprint(ans)', 'def factorization(y):\n arr = []\n temp = y\n for i in range(2, int(-(-y**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n if temp!=1:\n arr.append([temp, 1])\n if arr==[]:\n arr.append([y, 1])\n return arr\nn=int(input())\nif n==1:\n print(0)\n exit()\nans=0\nl=factorization(n)\nfor i,j in l:\n if j<=2:\n ans+=1\n else:\n t=1\n while j:\n if j<t:\n break\n ans+=1\n j-=t\n t+=1 \nprint(ans)']
['Wrong Answer', 'Accepted']
['s298381308', 's058557908']
[9516.0, 9496.0]
[112.0, 111.0]
[606, 587]
p02660
u397496203
2,000
1,048,576
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.
['import sys\ninput = sys.stdin.readline\n\n\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp % i == 0:\n cnt = 0\n while temp % i == 0:\n cnt += 1\n temp //= i\n arr.append([i, cnt])\n if temp != 1:\n arr.append([temp, 1])\n if arr == []:\n arr.append([n, 1])\n return arr\n\n\ndef main():\n N = int(input().strip())\n if N == 1:\n return 0\n factors = factorization(N)\n ans = 0\n for factor in factors:\n counter = 1\n while True:\n if factor[1] >= counter:\n factor[1] -= counter\n counter += 1\n ans += 1\n else:\n break\n return ans', 'import sys\ninput = sys.stdin.readline\n\n\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp % i == 0:\n cnt = 0\n while temp % i == 0:\n cnt += 1\n temp //= i\n arr.append([i, cnt])\n if temp != 1:\n arr.append([temp, 1])\n if arr == []:\n arr.append([n, 1])\n return arr\n\n\ndef main():\n N = int(input().strip())\n if N == 1:\n return 0\n factors = factorization(N)\n ans = 0\n for factor in factors:\n counter = 1\n while True:\n if factor[1] >= counter:\n selected.add(factor[0]**counter)\n factor[1] -= counter\n counter += 1\n ans += 1\n else:\n break\n return ans\n\n\nif __name__ == "__main__":\n print(main())\n', 'import sys\ninput = sys.stdin.readline\n\n\n\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp % i == 0:\n cnt = 0\n while temp % i == 0:\n cnt += 1\n temp //= i\n arr.append([i, cnt])\n if temp != 1:\n arr.append([temp, 1])\n if arr == []:\n arr.append([n, 1])\n return arr\n\n\ndef main():\n N = int(input().strip())\n if N == 1:\n return 0\n factors = factorization(N)\n ans = 0\n for factor in factors:\n counter = 1\n while True:\n if factor[1] >= counter:\n factor[1] -= counter\n counter += 1\n ans += 1\n else:\n break\n return ans\n\n\nif __name__ == "__main__":\n print(main())']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s674584634', 's700020314', 's835060343']
[9164.0, 9516.0, 9500.0]
[22.0, 104.0, 112.0]
[804, 901, 851]
p02660
u397953026
2,000
1,048,576
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.
['n = int(input())\nif n == 1:\n print(0)\n exit()\n\ndef factorization(num):\n arr = []\n temp = num\n for i in range(2, int(num**0.5)+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([num, 1])\n\n return arr\n\nx = factorization(n)\nans = 0\nprint(x)\nfor i in range(len(x)):\n x[i][1] -= 1\n ans += 1\n y = 2\n while x[i][1] > 0:\n x[i][1] -= y\n if x[i][1] >= 0:\n ans += 1\n y += 1\n \nprint(ans)', 'n = int(input())\nif n == 1:\n print(0)\n exit()\n\ndef factorization(num):\n arr = []\n temp = num\n for i in range(2, int(num**0.5)+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([num, 1])\n\n return arr\n\nx = factorization(n)\nans = 0\nfor i in range(len(x)):\n x[i][1] -= 1\n ans += 1\n y = 2\n while x[i][1] > 0:\n x[i][1] -= y\n if x[i][1] >= 0:\n ans += 1\n y += 1\n \nprint(ans)']
['Wrong Answer', 'Accepted']
['s243929042', 's824358732']
[9484.0, 9488.0]
[116.0, 115.0]
[600, 591]
p02660
u398930122
2,000
1,048,576
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.
['n = int(input())\ndef prime_factors(n):\n i = 2\n factors = []\n while i * i <= n:\n if n % i:\n i += 1\n else:\n n //= i\n factors.append(i)\n if n > 1:\n factors.append(n)\n return factors\nf = list(set(prime_factors(n)))\nprint(f)\nans = 0\nfor i in f:\n e = 1\n while n % i**e == 0:\n n = n//(i**e)\n ans += 1\n e+=1\n\nprint(ans) ', 'n = int(input())\ndef prime_factors(n):\n i = 2\n factors = []\n while i * i <= n:\n if n % i:\n i += 1\n else:\n n //= i\n factors.append(i)\n if n > 1:\n factors.append(n)\n return factors\nf = list(set(prime_factors(n)))\nf = f+list(map(lambda x: x**2,f))+list(map(lambda x: x**3,f))\nf.sort()\nprint(f)\nans = 0\nfor i in f:\n if n % i == 0:\n n = n//i\n ans += 1\n\nprint(ans) ', 'n = int(input())\ndef prime_factors(n):\n i = 2\n factors = []\n while i * i <= n:\n if n % i:\n i += 1\n else:\n n //= i\n factors.append(i)\n if n > 1:\n factors.append(n)\n return factors\n\nf = list(set(prime_factors(n)))\nans = 0\nfor i in f:\n e = 1\n while n % i**e == 0:\n n = n//(i**e)\n ans += 1\n e+=1\n\nprint(ans) ']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s003763395', 's585701566', 's492317725']
[9208.0, 9216.0, 9100.0]
[167.0, 169.0, 171.0]
[409, 446, 401]
p02660
u405733072
2,000
1,048,576
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.
['def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n if temp!=1:\n arr.append([temp, 1])\n if arr==[]:\n arr.append([n, 1])\n return arr\nN = int(input())\nif a == 1:\n print(0)\n exit()\na = factorization(N)\ncnt = 0\nfor i in a:\n temp = i[1]-1\n d = 2\n while temp>=d:\n temp -= d\n d += 1\n cnt+=d-1\nprint(cnt)\n \n \n \n \n \n ', 'def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n if temp!=1:\n arr.append([temp, 1])\n if arr==[]:\n arr.append([n, 1])\n return arr\nN = int(input())\nif N == 1:\n print(0)\n exit()\na = factorization(N)\ncnt = 0\nfor i in a:\n temp = i[1]-1\n d = 2\n while temp>=d:\n temp -= d\n d += 1\n cnt+=d-1\nprint(cnt)\n \n \n \n \n \n ']
['Runtime Error', 'Accepted']
['s395717856', 's378283825']
[9224.0, 9444.0]
[27.0, 121.0]
[543, 543]
p02660
u406355300
2,000
1,048,576
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.
['import collections\n\ndef prime_factorize(n):\n a = []\n f = 2\n while n % f == 0:\n a.append(f)\n n //= f\n f *= 2 \n\n g = 3\n while g * g <= n:\n if n % g == 0:\n a.append(g)\n n //= g\n g += 2\n else:\n g += 2\n flag = 0\n if n != 1 and n not in a:\n m = n\n while n % 2 == 0:\n n //= 2\n if n == 2:\n flag == 1\n g = 3\n while g * g <= n:\n if n % g == 0:\n n //= g\n if n == g:\n flag == 1\n else:\n g += 2\n n = m\n if flag == 1:\n a.append(n)\n return a\nN = int(input())\nfact = prime_factorize(N)\n#print(fact)\nprint(len(fact))\n', 'import collections\n\ndef prime_factorize(n):\n a = []\n f = 2\n while n % f == 0:\n a.append(f)\n n //= f\n f *= 2 \n\n g = 3\n while g * g <= n:\n if n % g == 0:\n a.append(g)\n n //= g\n g += 2\n else:\n g += 2\n return a\n\nN = int(input())\nfact = prime_factorize(N)\nprint(len(fact))\n', 'import collections\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\nN = int(input())\nfact = prime_factorize(N)\n\nb = []\nq = 1\nfor p in fact:\n if p not in b:\n while fact.count(p) > q:\n for i in range (q):\n fact.remove(p)\n b.append(p ** q)\n #print(b)\n q += 1\n q = 1\n #print(p)\n\n#print(b)\nprint(len(b))\n', 'import collections\n\ndef prime_factorize(n):\n a = []\n f = 2\n while n % f == 0:\n a.append(f)\n n //= f\n f *= 2 \n\n g = 3\n while g * g <= n:\n if n % g == 0:\n a.append(g)\n n //= g\n g += 2\n else:\n g += 2\n aflag = 0\n bflag = 0\n if n != 1 and n not in a:\n m = n\n while n % 2 == 0:\n bflag = 1\n n //= 2\n if n == 2:\n aflag == 1\n g = 3\n n = m\n while g * g <= n:\n if n % g == 0:\n bflag = 1\n n //= g\n if n == g:\n aflag == 1\n else:\n g += 2\n n = m\n if aflag == 1 or bflag == 1:\n a.append(m)\n return a\nN = int(input())\nfact = prime_factorize(N)\n#print(fact)\nprint(len(fact))\n', 'import collections\n\ndef prime_factorize(n):\n a = []\n f = 2\n while n % f == 0:\n a.append(f)\n n //= f\n f *= 2 \n\n g = 3\n while g * g <= n:\n if n % g == 0:\n a.append(g)\n n //= g\n g += 2\n else:\n g += 2\n flag = 0\n if n != 1 and n not in a:\n m = n\n while n % 2 == 0:\n n //= 2\n if n == 2:\n flag == 1\n g = 3\n while g * g <= n:\n if n % g == 0:\n n //= g\n if n == g:\n flag == 1\n else:\n g += 2\n n = m\n if flag == 1:\n a.append(n)\n return a\nN = int(input())\nfact = prime_factorize(N)\nprint(fact)\nprint(len(fact))\n', 'import collections\n\ndef prime_factorize(n):\n a = []\n f = 2\n while n % f == 0:\n a.append(f)\n n //= f\n f *= 2 \n\n g = 3\n while g * g <= n:\n if n % g == 0:\n a.append(g)\n n //= g\n g += 2\n else:\n g += 2\n return a\n if n != 1 and n in a:\n a.append(n)\n\nN = int(input())\nfact = prime_factorize(N)\nprint(len(fact))\n', 'import collections\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\nN = int(input())\nfact = prime_factorize(N)\n\nb = []\nc = fact.copy()\nq = 1\nfor p in fact:\n if p not in b:\n while c.count(p) >= q:\n for i in range (q):\n c.remove(p)\n #print(c)\n b.append(p ** q)\n #print(b)\n q += 1\n q = 1\n #print(p)\n #print(fact)\n\nprint(len(b))\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s080103897', 's425269368', 's563219971', 's749208993', 's915131935', 's998221192', 's511957568']
[9332.0, 9308.0, 9468.0, 9452.0, 9324.0, 9296.0, 9272.0]
[165.0, 95.0, 94.0, 165.0, 165.0, 93.0, 93.0]
[786, 365, 600, 880, 785, 411, 644]
p02660
u408375121
2,000
1,048,576
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.
['sieve = [True] * (10**6+1)\nprime = []\nfor i in range(2, 10**6):\n if sieve[i]:\n prime.append(i)\n if i < 10**3:\n for j in range(i**2, 10**6, i):\n sieve[j] = False\nn = int(input())\nif n == 1:\n print(0)\nelse:\n e = []\n for p in prime:\n if n % p == 0:\n idx = 0\n while n % p == 0:\n n = n // p\n idx += 1\n e.append(idx)\n if n == 1:\n break\n if len(e) > 0:\n total = 0\n for idx in e:\n cnt = 1\n while idx => cnt*(cnt+1)//2:\n cnt += 1\n cnt -= 1\n total += cnt \n if n == 1:\n print(total)\n else:\n print(total + 1)\n else:\n print(1)\n', 'sieve = [True] * 10**6\nprime = []\nfor i in range(2, 10**6):\n if sieve[i]:\n prime.append(i)\n if i < 10**3:\n for j in range(i**2, 10**6, i):\n sieve[j] = False\nn = int(input())\nif n == 1:\n print(0)\nelse:\n e = []\n for p in prime:\n if n % p == 0:\n idx = 0\n while n % p == 0:\n n = n // p\n idx += 1\n e.append(idx)\n if n == 1:\n break\n if len(e) > 0:\n total = 0\n for idx in e:\n cnt = 1\n while idx => cnt*(cnt+1)//2:\n cnt += 1\n cnt -= 1\n total += cnt \n if n == 1:\n print(total)\n else:\n print(total + 1)\n else:\n print(1)\n', 'sieve = [True] * 10**12\nprime = []\nfor i in range(2, 10**6):\n if sieve[i]:\n prime.append(i)\n for j in range(i**2, 10**12, i):\n sieve[j] = False\nn = int(input())\nif n == 1:\n print(0)\nelse:\n e = []\n for p in prime:\n if n % p == 0:\n idx = 0\n while n % p == 0:\n n = n // p\n idx += 1\n e.append(idx)\n if n == 1:\n break\n if len(e) > 0:\n total = 0\n for idx in e:\n cnt = 1\n while idx => cnt*(cnt+1)//2:\n cnt += 1\n total += cnt - 1\n if n == 1:\n print(total)\n else:\n print(total + 1)\n else:\n print(1)\n \n \n ', 'sieve = [True] * 10**6\nprime = []\nfor i in range(2, 10**6):\n if sieve[i]:\n prime.append(i)\n if i < 10**3:\n for j in range(i**2, 10**6, i):\n sieve[j] = False\nn = int(input())\nif n == 1:\n print(0)\nelse:\n e = []\n for p in prime:\n if n % p == 0:\n idx = 0\n while n % p == 0:\n n = n // p\n idx += 1\n e.append(idx)\n if n == 1:\n break\n if len(e) > 0:\n total = 0\n for idx in e:\n cnt = 1\n while idx => cnt*(cnt+1)//2:\n cnt += 1\n cnt -= 1\n total += cnt \n if n == 1:\n print(total)\n else:\n print(total + 1)\n else:\n print(1)\n', 'sieve = [True] * 10**6\nprime = []\nfor i in range(2, 10**6):\n if sieve[i]:\n prime.append(i)\n if i < 10**3:\n for j in range(i**2, 10**6, i):\n sieve[j] = False\nn = int(input())\nif n == 1:\n print(0)\nelse:\n e = []\n for p in prime:\n if n % p == 0:\n idx = 0\n while n % p == 0:\n n = n // p\n idx += 1\n e.append(idx)\n if n == 1:\n break\n if len(e) > 0:\n total = 0\n for idx in e:\n cnt = 1\n while idx => cnt*(cnt+1)//2:\n cnt += 1\n total += cnt - 1\n if n == 1:\n print(total)\n else:\n print(total + 1)\n else:\n print(1)', 'sieve = [True] * 10**6\nprime = []\nfor i in range(2, 10**6):\n if sieve[i]:\n prime.append(i)\n if i < 10**3:\n for j in range(i**2, 10**6, i):\n sieve[j] = False\nn = int(input())\nif n == 1:\n print(0)\nelse:\n e = []\n for p in prime:\n if n % p == 0:\n idx = 0\n while n % p == 0:\n n = n // p\n idx += 1\n e.append(idx)\n if n == 1:\n break\n if len(e) > 0:\n total = 0\n for idx in e:\n cnt = 1\n while idx >= cnt*(cnt+1)//2:\n cnt += 1\n cnt -= 1\n total += cnt \n if n == 1:\n print(total)\n else:\n print(total + 1)\n else:\n print(1)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s010127821', 's275661040', 's422650395', 's769539055', 's946405314', 's196825513']
[8896.0, 9020.0, 9056.0, 9064.0, 9072.0, 19964.0]
[24.0, 26.0, 22.0, 23.0, 23.0, 311.0]
[632, 628, 610, 630, 617, 627]
p02660
u411923565
2,000
1,048,576
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.
['N = int(input())\n\ndef Prime_factorize(n):\n cnt = 0\n \n two_div = 2\n while n%2==0 and (n>=two_div):\n cnt += 1\n n //= two_div\n \n two_div *= 2\n \n print(n)\n f = 3\n f_div = 3\n \n while f*f <= n:\n if n%f_div == 0:\n cnt += 1\n n //= f_div\n \n f_div = f_div*f\n \n else:\n f += 2\n f_div = f\n \n if n != 1:\n cnt += 1\n return cnt\nif N == 1:\n ans = 0\nelse:\n ans = Prime_factorize(N)\nprint(ans)', 'N = int(input())\n\ndef Prime_factorize(n):\n cnt = 0\n \n two_div = 2\n while n%2==0:\n cnt += 1\n n //= two_div\n \n two_div *= 2\n \n f = 3\n f_div = 3\n \n while f*f <= n:\n if n%f_div == 0:\n cnt += 1\n n //= f_div\n \n f_div = f_div*f\n \n else:\n f += 2\n f_div = f\n \n if cnt == 0:\n cnt = 1\n return cnt\nans = Prime_factorize(N)\nprint(ans)', 'N = int(input())\n\ndef Prime_factorize(n):\n cnt = 0\n \n two_div = 2\n while n%2==0 and (n>=two_div):\n cnt += 1\n n //= two_div\n \n print(two_div,n)\n two_div *= 2\n \n f = 3\n f_div = 3\n \n while f*f <= n:\n if n%f_div == 0:\n cnt += 1\n n //= f_div\n print(f_div,n)\n \n f_div = f_div*f\n \n else:\n f += 2\n f_div = f\n \n if n != 1 and (n ==f_div+2):\n cnt += 1\n print(n)\n return cnt\nif N == 1:\n ans = 0\nelse:\n ans = Prime_factorize(N)\nprint(ans)', "N = int(input())\n\ndef Prime_Factorize(n):\n primes = []\n while n%2 == 0:\n n//=2\n primes.append(2)\n f = 3\n while f*f <= n:\n if n%f == 0:\n n//=f\n primes.append(f)\n else:\n f += 2\n if n != 1:\n primes.append(n)\n return primes\n\nPrimes = Prime_Factorize(N)\nprint(Primes,N)\ncnt = 0\nfor p in Primes:\n e = 1\n z = p\n while (N%z == 0) and (N >= z):\n print('N,z,p,e',N,z,p,e)\n N //= z\n e += 1 \n z = p**e\n cnt += 1\n while N%p == 0:\n N //= p\nprint(cnt)", '#D - Div Game\nN = int(input())\n\ndef Prime_factorize(n):\n cnt = 0\n A = []\n \n z = 2\n while n%z==0 and (n>=z):\n cnt += 1\n n //= z\n print(n,z)\n A.append(z)\n \n z *= 2\n \n f = 3\n z = 3\n \n while f*f <= n:\n if n%z == 0:\n cnt += 1\n n //= z\n A.append(z)\n print(n,z,f)\n \n z = z*f\n \n else:\n f += 2\n z = f\n print(list(A))\n \n if n != 1 and all((n%i != 0 for i in A)):\n A.append(z)\n cnt += 1\n \n if cnt == 0:\n cnt = 1\n return cnt\nif N == 1:\n ans = 0\nelse:\n ans = Prime_factorize(N)\nprint(ans)', 'N = int(input())\n\ndef Prime_factorize(n):\n cnt = 0\n \n two_div = 2\n while n%2==0 and (n>=two_div):\n cnt += 1\n n //= two_div\n \n two_div *= 2\n \n f = 3\n f_div = 3\n \n while f*f <= n:\n if n%f_div == 0:\n cnt += 1\n n //= f_div\n \n f_div = f_div*f\n \n else:\n f += 2\n f_div = f\n \n if n != 1 and (n ==f_div+2):\n cnt += 1\n return cnt\nif N == 1:\n ans = 0\nelse:\n ans = Prime_factorize(N)\nprint(ans)', 'N = int(input())\n\ndef Prime_Factorize(n):\n primes = []\n while n%2 == 0:\n n//=2\n primes.append(2)\n f = 3\n while f*f <= n:\n if n%f == 0:\n n//=f\n primes.append(f)\n else:\n f += 2\n if n != 1:\n primes.append(n)\n return primes\n\nPrimes = Prime_Factorize(N)\ncnt = 0\nfor p in Primes:\n e = 1\n z = p\n while (N%z == 0) and (N >= z):\n N //= z\n e += 1 \n z = p**e\n cnt += 1\n while N%p == 0:\n N //= p\nprint(cnt)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s355063445', 's466414495', 's488013172', 's531838777', 's558930600', 's592933938', 's474103627']
[9208.0, 9168.0, 9148.0, 9140.0, 9252.0, 9144.0, 9176.0]
[101.0, 2206.0, 100.0, 100.0, 101.0, 101.0, 96.0]
[790, 719, 894, 576, 1002, 825, 527]
p02660
u412197640
2,000
1,048,576
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.
['from sys import *\nfrom collections import Counter\nN = int(stdin.readline())\nthings = []\nif N ==1:\n print(0)\n exit()\nfor i in range(2,N):\n if i*i > N:\n if len(things) == 0:\n print(1)\n exit()\n break\n while(N%i == 0):\n things.append(i)\n N = N/i\n\nc = Counter(things)\nvals = 0\nfor item in c:\n hue = 0\n for i in range(1,100000):\n if (hue + i) > c[item]:\n break\n else:\n hue += i\n vals += 1\nprint(vals)\n', 'from sys import *\nfrom collections import Counter\nN = int(stdin.readline())\nthings = []\nif N ==1:\n print(0)\n exit()\nfor i in range(2,N):\n if i*i > N:\n if len(things) == 0:\n print(1)\n exit()\n if N > 1:\n things.append(int(N))\n break\n while(N%i == 0):\n things.append(i)\n N = N/i\nc = Counter(things)\nvals = 0\nfor item in c:\n hue = 0\n for i in range(1,100000):\n if (hue + i) > c[item]:\n break\n else:\n hue += i\n vals += 1\n\nprint(vals)\n']
['Wrong Answer', 'Accepted']
['s532807685', 's786792650']
[9540.0, 9540.0]
[249.0, 272.0]
[510, 562]
p02660
u426175055
2,000
1,048,576
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.
['import math\nfrom collections import defaultdict\n\n\nN = int(input())\nn = N\n\nfactor = defaultdict(lambda: 0)\ntmp = int(math.sqrt(N))+1\nfor num in range(2,tmp):\n while N % num == 0:\n N //= num\n factor[num] += 1\nif not factor:\n factor[n] += 1\nelif N != 1:\n factor[N] += 1\n\nprint(factor)\n\nans = 0\nfor num in factor:\n i = 1\n while True:\n factor[num] -= i\n if factor[num]<0:\n break\n ans += 1\n i+=1\n\nprint(ans)\n', 'import math\nfrom collections import defaultdict\n\n\nN = int(input())\nn = N\n\nfactor = defaultdict(lambda: 0)\ntmp = int(math.sqrt(N))+1\nfor num in range(2,tmp):\n while N % num == 0:\n N //= num\n factor[num] += 1\nif not factor:\n factor[n] += 1\nelse:\n factor[N] += 1\n\n\n\nans = 0\nfor num in factor:\n i = 1\n while True:\n factor[num] -= i\n if factor[num]<0:\n break\n ans += 1\n i+=1\n\nprint(ans)\n', 'import math\nfrom collections import defaultdict\n\n\nN = int(input())\nn = N\n\nfactor = defaultdict(lambda: 0)\ntmp = int(math.sqrt(N))+1\nfor num in range(2,tmp):\n while N % num == 0:\n N //= num\n factor[num] += 1\nif not factor and n!=1:\n factor[n] += 1\nelif N != 1:\n factor[N] += 1\n\n\n\nans = 0\nfor num in factor:\n i = 1\n while True:\n factor[num] -= i\n if factor[num]<0:\n break\n ans += 1\n i+=1\n\nprint(ans)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s022981817', 's275977752', 's850960343']
[9512.0, 9484.0, 9484.0]
[152.0, 148.0, 144.0]
[486, 466, 482]
p02660
u432098488
2,000
1,048,576
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.
['def prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\nN = int(input())\nans = prime_factorize(N)\nprint(len(ans))', 'def factorization(n):\n ans = 0\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n tmp = set()\n while temp%i==0:\n cnt+=1\n temp //= i\n if not cnt in tmp:\n tmp.add(cnt)\n cnt = 0\n ans += 1\n\n if temp!=1:\n ans += 1\n\n if ans==0 and temp!=1:\n ans += 1\n\n return ans\n\nN = int(input())\nprint(factorization(N))']
['Wrong Answer', 'Accepted']
['s471345587', 's168246299']
[9136.0, 9464.0]
[85.0, 109.0]
[331, 496]
p02660
u434846982
2,000
1,048,576
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.
['n = int(input())\nlimit = n**0.5\nq = 2\n\nif n == 1:\n print(0)\nelse:\n ans = 0\n while q < limit:\n cnt = 0\n while n % q == 0:\n cnt += 1\n n /= q\n if cnt > 0:\n ans += int((2*cnt + 0.25)**0.5 + 1.5 - 10**(-100))\n limit = n**0.5\n q += 1\n print(ans)\n', 'n = int(input())\nlimit = n**0.5\nq = 2\n\nif n == 1:\n print(0)\nelse:\n ans = 0\n while q < limit:\n cnt = 0\n while n % q == 0:\n cnt += 1\n n /= q\n if cnt > 0:\n ans += int((2*cnt + 0.25)**0.5 - 0.5)\n limit = n**0.5\n q += 1\n if n > 1:\n ans += 1\n print(ans)\n']
['Wrong Answer', 'Accepted']
['s295227585', 's741505322']
[9348.0, 9288.0]
[264.0, 258.0]
[324, 342]
p02660
u437351386
2,000
1,048,576
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.
['a,b=list(map(float,input().split()))\nc=a*(b*100)\nd=int(c//100)\nprint(d)', 'import collections\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n \nn=int(input())\nc= collections.Counter(prime_factorize(n))\n\nsum=0\nfor i in c:\n n=1\n while n*(n+1)/2<=c[i]:\n n=n+1\n sum=sum+n-1\nprint(sum)\n \n']
['Runtime Error', 'Accepted']
['s096148329', 's475081043']
[9092.0, 9468.0]
[25.0, 96.0]
[71, 527]
p02660
u439063038
2,000
1,048,576
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.
['import math\n\nN = int(input())\nnum_list = [0] + [0] * int(math.sqrt(N)) # 0~N\npn_list = []\nfor i in range(2, int(math.sqrt(N))+1):\n if num_list[i] == 0:\n pn_list.append(i)\n num_list[i::i] = [1] * len(num_list[i::i])\n\ncount = 0\nfor pn in pn_list:\n e = 1\n while N%(pn**e)==0 and N//(pn**e)>=1:\n N //= (pn**e)\n e += 1\n count += 1\nif count == 0:\n count += 1\nprint(count)\nprint(count)', 'import math\n\nN = int(input())\nnum_list = [0] + [0] * int(math.sqrt(N)) # 0~N\npn_list = []\nfor i in range(2, int(math.sqrt(N))+1):\n if num_list[i] == 0:\n pn_list.append(i)\n num_list[i::i] = [1] * len(num_list[i::i])\n\ncount = 0\nfor pn in pn_list:\n e = 1\n while N%(pn**e)==0 and N//(pn**e)>=1:\n N //= (pn**e)\n e += 1\n count += 1\nif count == 0: \n count += 1\nprint(count)\nprint(count)', 'import math\n\nN = int(input())\nnum_list = [0] + [0] * math.sqrt(N) # 0~sqrt(N)\npn_list = []\nfor i in range(2, int(math.sqrt(N))+2):\n if num_list[i] == 0:\n pn_list.append(i)\n num_list[i::i] = [1] * len(num_list[i::i])\n\ncount = 0\nfor pn in pn_list:\n e = 1\n while N%(pn**e)==0 and N>=(pn**e):\n N //= (pn**e)\n e += 1\n count += 1\nif count==0 and N>1: \n count += 1\nprint(count)', 'N = int(input())\n\npn_list = [2]\ncount = 0\n\ne = 1\nwhile N%(2**e) == 0:\n N //= (2**e)\n count += 1\n e += 1\nloop_stop = N\n\nfor n in range(3, N+1):\n pn_check = True\n for pn in pn_list:\n if n%pn == 0:\n pn_check = False\n break\n \n e = 1\n if pn_check:\n while N%(pn**e) == 0:\n N //= (pn**e)\n count += 1\n e += 1\n loop_stop //= (pn**e)\n if n >= loop_stop:\n print(count)\n exit()\nprint(count)\n\n', 'import math\n \nN = int(input())\nnum_list = [0] + [0] * int(math.sqrt(N)) # 0~N\npn_list = []\nfor i in range(2, int(math.sqrt(N))+2):\n if num_list[i] == 0:\n pn_list.append(i)\n num_list[i::i] = [1] * len(num_list[i::i])\n \ncount = 0\nfor pn in pn_list:\n e = 1\n while N%(pn**e)==0 and N//(pn**e)>=1:\n N //= (pn**e)\n e += 1\n count += 1\nif count == 0 and N>1:\n count += 1\nprint(count)', 'N = int(input())\n\ndiv_counts = []\nfor i in range(2, int(N**0.5)+1):\n count = 0\n while N%i == 0:\n count += 1\n N //= i\n if N == 1:\n break\n div_counts.append(count)\n \nif N != 1:\n div_counts.append(1)\n \nans = 0\nfor count in div_counts:\n for i in range(1, count):\n if count >= i:\n ans += 1\n count -= i\nprint(ans)', 'N = int(input())\n\ndiv_counts = []\nfor i in range(2, int(N**0.5)+1):\n count = 0\n while N%i == 0:\n count += 1\n N //= i\n if N == 1:\n break\n div_counts.append(count)\n \nif N != 1:\n div_counts.append(1)\n\nans = 0\nfor count in div_counts:\n for i in range(1, count+1):\n if count >= i:\n ans += 1\n count -= i\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s125046407', 's356778847', 's380128394', 's439271843', 's773353994', 's933189196', 's869589301']
[27036.0, 27152.0, 9060.0, 9192.0, 27128.0, 17144.0, 17140.0]
[230.0, 239.0, 28.0, 2205.0, 204.0, 387.0, 404.0]
[426, 470, 461, 435, 430, 341, 341]
p02660
u444481227
2,000
1,048,576
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.
['arr = []\ntemp = n\nfor i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\nif temp!=1:\n arr.append([temp, 1])\n\nif arr==[]:\n arr.append([n, 1])\n\nif arr==[[1,1]]:\n print(0)\n\nelse:\n # print(arr)\n total=0\n for i in range(len(arr)):\n x=1\n s=0\n c=-1\n while s<=arr[i][1]:\n s+=x\n x+=1\n c+=1\n total+=c\n print(total)\n', 'arr = []\ntemp = n\nfor i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\nif temp!=1:\n arr.append([temp, 1])\n\nif arr==[]:\n arr.append([n, 1])\n\nif arr==[[1,1]]:\n print(0)\n\nelse:\n # print(arr)\n total=0\n for i in range(len(arr)):\n x=1\n s=0\n c=-1\n while s<=arr[i][1]:\n s+=x\n x+=1\n c+=1\n total+=c\n print(total)\n', 'n=int(input())\n\narr = []\ntemp = n\nfor i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\nif temp!=1:\n arr.append([temp, 1])\n\nif arr==[]:\n arr.append([n, 1])\n\nif arr==[[1,1]]:\n print(0)\n\nelse:\n total=0\n for i in range(len(arr)):\n x=1\n s=0\n c=-1\n while s<=arr[i][1]:\n s+=x\n x+=1\n c+=1\n total+=c\n print(total)\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s063137426', 's726516919', 's129366742']
[9096.0, 9152.0, 9492.0]
[25.0, 24.0, 146.0]
[509, 509, 508]
p02660
u449473917
2,000
1,048,576
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.
['def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n \na=factorization(int(input()))\n\nb=[1,3,6,10,15,21,28,36,43]\n\nans=0\nprint(a)\nif len(a)==1 and a[0][0]==1:\n print(0)\n exit()\n\nfor i in a:\n for j in range(len(b)):\n if i[1]<b[j]:\n ans+=j\n break\nprint(ans)\n', 'def factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\n \na=factorization(int(input()))\n\nb=[1,3,6,10,15,21,28,36,43]\n\nans=0\nif len(a)==1 and a[0][0]==1:\n print(0)\n exit()\n\nfor i in a:\n for j in range(len(b)):\n if i[1]<b[j]:\n ans+=j\n break\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s741597638', 's424763882']
[9328.0, 9500.0]
[111.0, 112.0]
[596, 587]
p02660
u449863068
2,000
1,048,576
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.
['"nの約数列挙"\ndef divisor(n):\n ass = []\n for i in range(1,int(n**0.5)+1):\n if n%i == 0:\n ass.append(i)\n if i**2 == n:\n continue\n ass.append(n//i)\n return ass\n\n"nの素因数分解"\ndef prime_factor(n):\n ass = []\n for i in range(2,int(n**0.5)+1):\n while n % i==0:\n ass.append(i)\n n = n//i\n if n != 1:\n ass.append(n)\n return ass\n\ndef is_prime(n):\n if n == 1:\n return False\n for i in range(2,int(n**0.5)+1):\n if n % i == 0:\n return False\n return True\n\n\nN = int(input())\nA = divisor(N)\nA.sort()\n\ncount = 0\nprint(A)\nfor a in A:\n if a == 1:\n continue\n if N % a != 0 and is_prime(a) == False:\n continue\n N //= a\n count += 1\n\nprint(count)\n\n', '24', 'import math\n"nの約数列挙"\ndef divisor(n):\n ass = []\n for i in range(1,int(n**0.5)+1):\n if n%i == 0:\n ass.append(i)\n if i**2 == n:\n continue\n ass.append(n//i)\n return ass\n\n"nの素因数分解"\ndef prime_factor(n):\n ass = []\n for i in range(2,int(n**0.5)+1):\n while n % i==0:\n ass.append(i)\n n = n//i\n if n != 1:\n ass.append(n)\n return ass\n\ndef is_prime(n):\n if n == 1:\n return False\n for i in range(2,int(n**0.5)+1):\n if n % i == 0:\n return False\n return True\n\n\nimport collections\nN = int(input())\nA = prime_factor(N)\nA.sort()\nc = collections.Counter(A)\nans = 0\nfor x in c.values():\n count = 1\n while x > 0:\n x -= count\n if x >= 0:\n count +=1\n ans += 1\n\nprint(ans)\n\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s033103676', 's958651451', 's320974869']
[9496.0, 8944.0, 9740.0]
[196.0, 24.0, 112.0]
[793, 2, 835]
p02660
u455408345
2,000
1,048,576
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.
['def prime(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\n\n\n\n\n\n\nn=int(input(""))\n\ns=0\n\nt=0\nlista=prime(n)\naa=len(lista)\nc=lista[0]\nfor i in lista:\n if (c==i):\n t+=1\n else:\n k=1\n while(t>=k):\n t-=k\n s+=1\n k+=1\n t=1\n c=i\n\nif(t!=1):\n k=1\n while(t>=k):\n t-=k\n s+=1\n k+=1\n \n\n\n \n \n \n \n \nif(n==1):\n print(0)\nelse:\n\n print(s)\n \n \n \n \n \n \n', 'n=int(input(""))\ns=0\ni=1\nwhile(n>i):\n \n i+=1\n if (n%2==0 and n!=2):\n continue\n t=0\n while(n%i==0):\n n/=i\n t+=1\n k=1\n while(t>=k):\n \n t-=k\n s+=1\n k+=1\n\nprint(s)', 'def prime(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\n\n\n\n\n\n\nn=int(input(""))\nif(n==1):\n print(0)\ns=0\n\nt=0\nlista=prime(n)\naa=len(lista)\nc=lista[0]\nfor i in lista:\n if (c==i):\n t+=1\n else:\n k=1\n while(t>=k):\n t-=k\n s+=1\n k+=1\n t=1\n c=i\n\nif(t!=1):\n k=1\n while(t>=k):\n t-=k\n s+=1\n k+=1\n \n\n\n \n \n \n \n \n \n\nprint(s)\n \n \n \n \n \n \n', 'def prime(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\n\n\n\nn=int(input(""))\n\nif(n!=1):\n \n\n s=0\n\n t=0\n lista=prime(n)\n aa=len(lista)\n c=lista[0]\n for i in lista:\n if (c==i):\n t+=1\n else:\n k=1\n while(t>=k):\n t-=k\n s+=1\n k+=1\n t=1\n c=i\n\n if(t!=1):\n k=1\n while(t>=k):\n t-=k\n s+=1\n k+=1\n \n\n\n \n \n \n \n \nif(n==1):\n s==0\n\nprint(s)\n \n \n \n \n \n \n', 'def prime(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n a.append(n)\n return a\n\n\n\n\n\nn=int(input(""))\ns=0\nif(n!=1):\n \n\n \n\n t=0\n lista=prime(n)\n #print(lista)\n \n c=lista[0]\n for i in lista:\n if (c==i):\n t+=1\n else:\n k=1\n while(t>=k):\n t-=k\n s+=1\n k+=1\n t=1\n c=i\n\n\n k=1\n while(t>=k):\n t-=k\n s+=1\n k+=1\n \n\n\n \n \n \n \n \n\n\nprint(s)\n \n \n \n \n \n \n']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s265012400', 's702009317', 's787142170', 's936650872', 's611391233']
[9268.0, 9088.0, 9184.0, 9236.0, 9228.0]
[104.0, 2206.0, 100.0, 99.0, 99.0]
[704, 225, 698, 807, 761]
p02660
u455629561
2,000
1,048,576
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.
['x = int(input())\nimport math\nfrom collections import defaultdict\n\nres = 0\nvalue = defaultdict(int)\ndef isprime(n):\n if n <= 1:\n return 0\n m = int(math.sqrt(n)) + 1\n for i in range(2, m):\n if n % i == 0:\n return 0\n return 1\nif isprime(x):\n print(1)\nelse:\n def bprime(n):\n cnt = 2\n while n != 1 and cnt < int(math.sqrt(n)) + 1:\n while n % cnt == 0:\n n //= cnt\n value[cnt] += 1\n cnt += 1\n def cal(n):\n if n <= 2:\n return 1\n j = 1\n cnt = 0\n while n >= j:\n n -= j\n j += 1\n cnt += 1\n return cnt\n bprime(x)\n for key in value.keys():\n res += cal(value[key])\n print(res)', 'x = int(input())\nimport math\nfrom collections import defaultdict\n\nres = 0\nvalue = defaultdict(int)\ndef isprime(n):\n if n <= 1:\n return 0\n m = int(math.sqrt(n)) + 1\n for i in range(2, m):\n if n % i == 0:\n return 0\n return 1\nif isprime(x):\n print(1)\nelse:\n def bprime(n):\n cnt = 2\n m = int(math.sqrt(n)) + 1\n while n != 1 and cnt < m:\n while n % cnt == 0:\n n //= cnt\n value[cnt] += 1\n cnt += 1\n if cnt == m and n != 1:\n value[n] += 1\n def cal(n):\n if n <= 2:\n return 1\n j = 1\n cnt = 0\n while n >= j:\n n -= j\n j += 1\n cnt += 1\n return cnt\n bprime(x)\n for key in value.keys():\n res += cal(value[key])\n print(res)']
['Wrong Answer', 'Accepted']
['s162322075', 's248656112']
[9504.0, 9488.0]
[441.0, 240.0]
[768, 840]
p02660
u457901067
2,000
1,048,576
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.
['N = int(input())\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\nif N == 1:\n print(0)\n exit(0)\nf = factorization(N)\nprint(f)\nans = 0\namari_cnt = 0\nfor a,b in f:\n wk = b\n tempc = 1\n while wk - tempc >= 0:\n wk -= tempc\n ans += 1\n tempc += 1\n\nprint(ans)\n ', 'N = int(input())\ndef factorization(n):\n arr = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp%i==0:\n cnt=0\n while temp%i==0:\n cnt+=1\n temp //= i\n arr.append([i, cnt])\n\n if temp!=1:\n arr.append([temp, 1])\n\n if arr==[]:\n arr.append([n, 1])\n\n return arr\nif N == 1:\n print(0)\n exit(0)\nf = factorization(N)\n#print(f)\nans = 0\namari_cnt = 0\nfor a,b in f:\n wk = b\n tempc = 1\n while wk - tempc >= 0:\n wk -= tempc\n ans += 1\n tempc += 1\n\nprint(ans)\n ']
['Wrong Answer', 'Accepted']
['s381038561', 's893553515']
[9420.0, 9488.0]
[110.0, 112.0]
[574, 575]