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 | u460980455 | 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())\nnoso=[]\ncount=0\nif n==1:\n count=0\nelif sosu(n)==1:\n count=1\nelse:\n for x in range(2,int(n/2)+2):\n if x>n:\n break\n if x in noso:\n pass\n elif x<=10:\n xx=x\n while n%xx==0:\n noso.append(xx)\n count+=1\n n=n/xx\n xx=xx*x\n elif x>11:\n xx=x\n while n%xx==0:\n noso.append(xx)\n count+=1\n n=n/x\n xx=xx*x\nprint(count)', '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\nn=int(input())\nif n==1:\n ans=0\nelse:\n a=prime_factorize(n)\n if a==[]:\n ans=1\n else:\n ans=0\n xzen=a[0]\n count=1\n ans+=1\n for x in range(1,len(a)):\n if xzen==a[x]:\n count+=1\n if count==3 or count==6 or count==10 or count==15 or count==21 or count==28 or or count==35:\n ans+=1\n else:\n xzen=a[x]\n count=1\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\nn=int(input())\nif n==1:\n ans=0\nelse:\n a=prime_factorize(n)\n if a==[]:\n ans=1\n else:\n ans=0\n xzen=a[0]\n count=1\n ans+=1\n for x in range(1,len(a)):\n if xzen==a[x]:\n count+=1\n if count==3 or count==6 or count==10 or count==15 or count==21 or count==28 or count==36:\n ans+=1\n else:\n xzen=a[x]\n count=1\n ans+=1\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s118139828', 's447617452', 's273979940'] | [9204.0, 9088.0, 9244.0] | [26.0, 20.0, 91.0] | [556, 762, 759] |
p02660 | u462192060 | 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 stdin\n\ndef main():\n read = stdin.readline\n N =int(read())\n count = 0\n start = 2\n while(1):\n if N <= start:\n break\n for i in range(start,N+1):\n if N%i == 0:\n count += 1\n N = N//i\n start = i+1\n break\n print(count)\n \n \n\n \n \n \nif __name__ == "__main__":\n main()', 'from sys import stdin\n\ndef waru(a,b):\n if a%b != 0:\n return 0\n if a/b == 1:\n return b\n return waru(a/b,b)\n \n\ndef main():\n s = []\n read = stdin.readline\n N =int(read())\n if N == 1:\n print(0)\n exit()\n i = 2\n table = []\n ap = table.append\n while i * i <= N:\n while N%i == 0:\n ap(i)\n N //= i\n i += 1\n if N > 1:\n ap(N)\n set_table = sorted(list(set(table)))\n kaisu = [0] * len(set_table)\n num = 0\n for i in table:\n if i == set_table[num]:\n kaisu[num] += 1\n else:\n num += 1\n kaisu[num] += 1\n maxk = max(kaisu)\n j = 1\n k = 0\n count = 0\n while j <= maxk:\n count += len([i for i in kaisu if i >= j])\n k += 1\n j = j + k + 1\n print(count)\n \n \n \n\n \n \n \nif __name__ == "__main__":\n main()'] | ['Wrong Answer', 'Accepted'] | ['s860315871', 's375468575'] | [9176.0, 9260.0] | [2206.0, 160.0] | [339, 775] |
p02660 | u464205401 | 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 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\nif n==1:\n print(0)\n exit() \n \nf=factorization(n)\ncnt=0\nfor i in range(len(f)):\n m=2 \n while f[i][1]>0:\n f[i][1]-=m\n m+=1\n cnt+=1\n print(f)\nprint(cnt)', 'n=int(input())\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\nif n==1:\n print(0)\n exit() \n \nf=factorization(n)\ncnt=0\nfor i in range(len(f)):\n m=2 \n while f[i][1]>0:\n f[i][1]-=m\n m+=1\n cnt+=1\n# print(f)\nprint(cnt)'] | ['Wrong Answer', 'Accepted'] | ['s056911039', 's109282256'] | [9500.0, 9328.0] | [109.0, 112.0] | [541, 542] |
p02660 | u465101448 | 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\nN=int(input())\nN_=N\nf_=[]\nfor n in range(2,int(N**(1/2))+2): \n while N_ % n==0: \n N_=int(N_/n)\n f_.append(n)\n \nif len(f_) == 0:\n f_.append(N)\n \n\nC=Counter(f_)\nans=0\nfor c in C.keys():\n for c_ in range(1,C[c]+1):\n if N % c**c_ == 0:\n N = N/c**c_\n ans+=1\nif N==1:\n ans=0\n \nprint(ans)', 'from collections import Counter\n\nN=int(input())\nN_=N\nf_=[]\nfor n in range(2,int(N**(1/2))+2): \n while N_ % n==0: \n N_=int(N_/n)\n f_.append(n)\n \nif N_ != 1:\n\tf_.append(N_)\n \nC=Counter(f_)\nN_=N\nans=0\nfor c in C.keys():\n for c_ in range(1,C[c]+1):\n if N_ % c**c_ == 0:\n N_ = N_/c**c_\n ans+=1\nif N==1:\n ans=0\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s408611957', 's651095370'] | [9624.0, 9576.0] | [147.0, 161.0] | [385, 381] |
p02660 | u474561976 | 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 io,sys\nsys.setrecursionlimit(10**6)\n\ndef prime(n):\n nums = [True]*n\n primes = []\n for i in range(2,n):\n if nums[i]:\n primes.append(i)\n for j in range(2*i,n,i):\n nums[j] = False\n return primes\n\ndef main():\n from collections import Counter\n from collections import deque\n import bisect\n n = int(input())\n num = Counter([])\n\n primes = prime(int(n**0.5+1))+[n]\n primes = deque(primes)\n\n while n !=1:\n while True:\n p = primes.popleft()\n q = primes.pop()\n if n%p==0:\n num[p]+=1\n n = n//p\n primes.appendleft(p)\n break\n elif n%q==0:\n num[q]+=1\n n = n//q\n primes.append(q)\n break\n\n m = max(num.values())\n N = [i*(i+1)//2 for i in range(1,int((2*m)**0.5)+1)]\n ans = 0\n for i in num.values():\n k = bisect.bisect_right(N,i)\n ans+=k\n print(ans)\nmain()', 'import io,sys\nsys.setrecursionlimit(10**6)\n\ndef prime(n):\n nums = [True]*n\n primes = []\n for i in range(2,n):\n if nums[i]:\n primes.append(i)\n for j in range(2*i,n,i):\n nums[j] = False\n return primes\n\ndef main():\n from collections import Counter\n from collections import deque\n import bisect\n n = int(input())\n num = Counter([])\n\n primes = prime(int(n**0.5+1))+[n]\n primes = deque(primes)\n\n while n !=1:\n while len(primes)>0:\n p = primes.popleft()\n if len(primes)>0:\n q = primes.pop()\n else:\n q=10**10\n if n%p==0:\n num[p]+=1\n n = n//p\n primes.appendleft(p)\n break\n elif n%q==0:\n num[q]+=1\n n = n//q\n primes.append(q)\n break\n\n m = max(num.values())\n N = [i*(i+1)//2 for i in range(1,int((2*m)**0.5)+1)]\n ans = 0\n for i in num.values():\n k = bisect.bisect_right(N,i)\n ans+=k\n print(ans)\nmain()', 'def prime(n):\n nums = [True]*n\n primes = []\n for i in range(2,n):\n if nums[i]:\n primes.append(i)\n for j in range(2*i,n,i):\n nums[j] = False\n return primes\n\ndef prime_fac(n):\n fac = {}\n primes = prime(int(n**0.5)+1)\n for p in primes:\n while n%p==0:\n fac[p] = fac.get(p,0)+1\n n//=p\n if n > 1:\n fac[n] = 1\n return fac\n\ndef main():\n n = int(input())\n fac = prime_fac(n)\n\n ans = 0\n for i in fac.values():\n ct = 1\n while i >= ct*(ct+1)//2:\n ct += 1\n ans+=1\n print(ans)\nmain()'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s211037141', 's916592895', 's527319588'] | [20440.0, 20568.0, 20268.0] | [209.0, 2206.0, 239.0] | [1025, 1111, 627] |
p02660 | u474925961 | 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\n\nif sys.platform =='ios':\n sys.stdin=open('input_file.txt')\n \nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nn=int(input())\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 \na=factorization(n)\nle=len(a)\ncnt=0\nb=0\nfor i in range(le):\n\tb=1\n\twhile a[i][1]>=b: \n\t\ta[i][1]-=b\n\t\tb+=1\n\t\tcnt+=1\n\nif n=1:\n\tprint(0)\nelse:\n\tprint(cnt)", "import sys\n\nif sys.platform =='ios':\n sys.stdin=open('input_file.txt')\n \nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nn=int(input())\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 \na=factorization(n)\nle=len(a)\ncnt=0\nb=0\nfor i in range(le):\n\tb=1\n\twhile a[i][1]>=b: \n\t\ta[i][1]-=b\n\t\tb+=1\n\t\tcnt+=1\n\nif n==1:\n\tprint(0)\nelse:\n\tprint(cnt)"] | ['Runtime Error', 'Accepted'] | ['s058719627', 's087349057'] | [9108.0, 9524.0] | [26.0, 106.0] | [706, 707] |
p02660 | u479719434 | 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 sqrt\nfrom bisect import bisect\n\n\ndef main():\n N = int(input())\n factor = {}\n max_count = 1\n while N > 1:\n for i in range(2, int(sqrt(N))):\n if N % i == 0:\n N = N // i\n if i in factor:\n factor[i] += 1\n if max_count < factor[i]:\n max_count = factor[i]\n else:\n factor[i] = 1\n break\n else:\n if N in factor:\n factor[N] += 1\n if max_count < factor[i]:\n max_count = factor[i]\n else:\n factor[N] = 1\n N = 1\n\n sum_up = [n * (n + 1) // 2 for n in range(max_count+1)]\n ans = 0\n for prime, count in factor.items():\n ans += bisect(sum_up, count)-1\n print(ans)\n\n\nif __name__ == "__main__":\n main()\n', 'from math import sqrt\nfrom bisect import bisect\n\n\ndef main():\n N = int(input())\n factor = {}\n max_count = 1\n while N > 1:\n for i in range(2, int(sqrt(N)) + 1):\n if N % i == 0:\n N = N // i\n if i in factor:\n factor[i] += 1\n if max_count < factor[i]:\n max_count = factor[i]\n else:\n factor[i] = 1\n break\n else:\n if N in factor:\n factor[N] += 1\n if max_count < factor[N]:\n max_count = factor[N]\n else:\n factor[N] = 1\n N = 1\n sum_up = [n * (n + 1) // 2 for n in range(max_count + 1)]\n ans = 0\n for prime, count in factor.items():\n ans += bisect(sum_up, count)-1\n print(ans)\n\n\nif __name__ == "__main__":\n main()\n'] | ['Wrong Answer', 'Accepted'] | ['s288337355', 's068743234'] | [9168.0, 9228.0] | [113.0, 110.0] | [896, 901] |
p02660 | u482157295 | 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\ndum = prime_factorize(int(input()))\nprint(dum)\nprint(len(dum))\ndum1 = 0\nans = 0\nfor i in range(len(dum)):\n if dum[i] == dum[i+1]:\n cnt += 1\n else:\n dum1 = 0\n cnt = 0\n if cnt > dum1:\n ans += 1\n cnt = 0\n dum1 += 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\ndum = prime_factorize(int(input()))\ndum_len = len(dum)\n\nnum = 0\nans = 0\ncnt = 0\ncheck = 0\nfor i in range(dum_len):\n if num == dum[i]:\n cnt += 1\n if cnt >= check:\n check += 1\n ans += 1\n cnt = 0\n else:\n num = dum[i]\n ans += 1\n cnt = 0\n check = 2\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s916466362', 's248987384'] | [9260.0, 9232.0] | [90.0, 101.0] | [546, 608] |
p02660 | u483391772 | 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())\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(cnt)\n\nif temp!=1:\n arr.append(1)\nif arr==[]:\n arr.append(1)\nfor i in range(len(arr)):\n if arr[i] == 1:\n arr[i] = 1\n else:\n s = (-1+math.sqrt(1+8*arr[i]))/2\n arr[i] = s\nif n = 1:\n print(0)\nelse:\n print(int(sum(arr)))', 'import math\nN = 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(cnt)\n\n if temp!=1:\n arr.append(1)\n\n if arr==[]:\n arr.append(1)\n\n return arr\nA = factorization(N)\nif N == 1:\n print(0)\nelse:\n for i in range(len(A)):\n if A[i] == 1:\n A[i] = 1\n else:\n s = (-1+int(math.sqrt(1+8*A[i])))/2\n A[i] = int(s)\n print(int(sum(A)))\n '] | ['Runtime Error', 'Accepted'] | ['s311678836', 's330354042'] | [9084.0, 9492.0] | [21.0, 109.0] | [460, 600] |
p02660 | u485979475 | 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\nn=int(input())\n\nif n == 1:\n print(0)\n sys.exit()\n\norgn=n\ncounter=0\nfor i in range(2,int((n**0.5) + 1) ):\n if n % i == 0:\n counter += 1\n n //= i\n wari=i**2\n while n % wari == 0:\n counter +=1\n n //= wari\n wari *= i\n \n while n % i ==0:\n n //= i\n\nif n == orgn:\n print(1)\n\nif n >= int(n ** 0.5):\n counter+=1\nprint(counter)', 'import sys\nn=int(input())\n\nif n == 1:\n print(0)\n sys.exit()\n\norgn=n\ncounter=0\nfor i in range(2,int((n**0.5) + 1) ):\n if n % i == 0:\n counter += 1\n n //= i\n wari=i**2\n while n % wari == 0:\n counter +=1\n n //= wari\n wari *= i\n \n while n % i ==0:\n n //= i\n\nif n == orgn:\n print(1)\n sys.exit()\n\nif n > int(n ** 0.5):\n counter+=1\nprint(counter)'] | ['Wrong Answer', 'Accepted'] | ['s883002065', 's996931612'] | [9468.0, 9464.0] | [145.0, 146.0] | [433, 447] |
p02660 | u487767879 | 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 Counter\nA= int(input())\nresArray = []\ntmpA = A\ni = 1\nwhile i <= math.sqrt(A):\n #print (i)\n i += 1\n if tmpA == 1:\n break\n\n if i >2 and i %2 == 0:\n continue\n\n\n while tmpA % i == 0:\n tmpA = tmpA / i\n resArray.append(i)\n\nres = 0\nif tmpA == A:\n print(1)\n exit()\nelse tmpA > 1:\n res += 1\n\n\ncArray = Counter(resArray)\n\nfor i in cArray.values():\n if i > 0:\n \n tmp = 1\n while tmp*(tmp+1)//2 <= i:\n tmp += 1\n res += tmp -1\nprint(res)', 'import math\nfrom collections import Counter\nA= int(input())\nresArray = []\ntmpA = A\ni = 1\nwhile i <= math.sqrt(A):\n #print (i)\n i += 1\n if tmpA == 1:\n break\n\n if i >2 and i %2 == 0:\n continue\n\n\n while tmpA % i == 0:\n tmpA = tmpA / i\n resArray.append(i)\n\nres = 0\nif tmpA == A:\n print(1)\n exit()\nelse:\n res += 1\n\n\ncArray = Counter(resArray)\n\nfor i in cArray.values():\n if i > 0:\n \n tmp = 1\n while tmp*(tmp+1)//2 <= i:\n tmp += 1\n res += tmp -1\nprint(res)', 'import math\nA= int(input())\nresArray = []\ntmpA = A\nfor i in range(2, int(math.sqrt(A))):\n if tmpA == 1:\n break\n tmp = tmpA%i\n resArray.append(0)\n while tmp == 0:\n print(i)\n tmpA = tmpA/i\n resArray[-1] += 1\n tmp = tmpA%i\nif tmpA != 1:\n print(1)\n exit()\nres = 0\nfor i in resArray:\n if i != 0:\n for j in range(i + 1):\n if j*(j+1)/2 > i:\n res += j - 1\n break\nprint(res)', 'import math\nA= int(input())\nresArray = []\ntmpA = A\nfor i in range(2, int(math.sqrt(A))):\n if tmpA == 1:\n break\n tmp = tmpA%i\n resArray.append(0)\n while tmp == 0:\n tmpA = tmpA/i\n resArray[-1] += 1\n tmp = tmpA%i\nif tmpA != 1:\n print(1)\n exit()\nres = 0\nfor i in resArray:\n if i != 0:\n for j in range(i + 1):\n if j*(j+1)/2 > i:\n res += j - 1\n break\nprint(res)', 'import math\nfrom collections import Counter\nA= int(input())\nif A == 1:\n print(0)\n exit()\nresArray = []\ntmpA = A\ni = 1\nwhile i <= math.sqrt(A):\n #print (i)\n i += 1\n if tmpA == 1:\n break\n\n if i >2 and i %2 == 0:\n continue\n\n\n while tmpA % i == 0:\n tmpA = tmpA / i\n resArray.append(i)\n\nres = 0\nif tmpA == A:\n print(1)\n exit()\nelif tmpA > 1:\n res += 1\n\n\ncArray = Counter(resArray)\n\nfor i in cArray.values():\n if i > 0:\n \n tmp = 1\n while tmp*(tmp+1)//2 <= i:\n tmp += 1\n res += tmp -1\nprint(res)\n'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s041361058', 's119387549', 's851182995', 's920152792', 's555896662'] | [9068.0, 9540.0, 17052.0, 16968.0, 9400.0] | [24.0, 351.0, 246.0, 245.0, 370.0] | [553, 544, 469, 452, 589] |
p02660 | u489762173 | 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\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\nc = collections.Counter(prime_factorize(N))\nprint(c)\n\nans=0\nfor i in c.values():\n tmp = i\n cnt=0\n val=1\n while True:\n tmp = tmp-val\n val+=1\n\n if tmp > 0:\n cnt+=1\n \n if tmp == 0:\n cnt+=1\n ans+=cnt\n break\n \n if tmp < 0:\n ans+=cnt\n break\n\nprint(ans)\n', 'import collections\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\nc = collections.Counter(prime_factorize(N))\n\nans=0\nfor i in c.values():\n tmp = i\n cnt=0\n val=1\n while True:\n tmp = tmp-val\n val+=1\n\n if tmp > 0:\n cnt+=1\n \n if tmp == 0:\n cnt+=1\n ans+=cnt\n break\n \n if tmp < 0:\n ans+=cnt\n break\n\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s481218548', 's375193956'] | [9496.0, 9468.0] | [92.0, 92.0] | [686, 677] |
p02660 | u494037809 | 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 solve(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())\nprint(solve(n))', 'n = int(input())\n\ndef factorization(n):\n arr = []\n if n == 1:\n return 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', 'def solve(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())\narr = solve(n)\n\ncnt = 0\nfor n in arr:\n a=1\n if n[0]==1:\n break\n while n[1]>=a:\n n[1] -= a\n a += 1\n cnt += 1\n\nprint(cnt)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s379708779', 's838389233', 's260495820'] | [9424.0, 9208.0, 9448.0] | [110.0, 21.0, 109.0] | [377, 399, 518] |
p02660 | u496009935 | 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 copy\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\nL=prime_factorize(n)\nM=L.copy()\nM=list(set(M))\n\ncnt=0\nfor x in M:\n m=L.count(x)\n for i in range(L.count(x)):\n if m-i-1 > 0:\n m -= i+1\n cnt += 1\n\nprint(cnt)\n', 'import copy\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\nL=prime_factorize(n)\nM=L.copy()\nM=list(set(M))\n\ncnt=0\nfor x in M:\n m=L.count(x)\n for i in range(L.count(x)):\n if m-i-1 >= 0:\n m -= i+1\n cnt += 1\n\nprint(cnt)\n'] | ['Wrong Answer', 'Accepted'] | ['s432664394', 's510180375'] | [9204.0, 9344.0] | [102.0, 103.0] | [493, 494] |
p02660 | u497277272 | 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 math\n\ndef factorization(n):\n factor_list = []\n tmp = int(math.sqrt(n)) + 1\n for num in range(2, tmp+1):\n count = 0\n while n % num == 0:\n count += 1\n n //= num\n \n if count != 0:\n factor = [num, count]\n factor_list.append(factor)\n \n if n != 1:\n factor = [n, 1]\n factor_list.append(factor)\n #print(n)\n return factor_list\n \n\ndef main():\n n = int(input())\n count = 0\n \n if n == 1:\n print(0)\n return\n \n factor_list = factorization(n)\n print(factor_list)\n if len(factor_list) == 0:\n print(1)\n return\n \n for factor in factor_list:\n exponent = 1\n n /= factor[0] ** exponent\n count += 1\n factor[1] -= exponent\n exponent += 1\n \n while factor[1] > 1:\n #print(factor_list)\n n /= factor[0] ** exponent\n count += 1\n factor[1] -= exponent\n exponent += 1\n \n print(count)\n return\n \nif __name__ == '__main__':\n main()", "\nimport math\n\ndef factorization(n):\n factor_list = []\n tmp = int(math.sqrt(n)) + 1\n for num in range(2, tmp+1):\n if n % num == 0:\n count = 0\n while n % num == 0:\n count += 1\n n //= num\n \n factor_list.append([num, count])\n \n if n != 1:\n factor = [n, 1]\n factor_list.append(factor)\n #print(n)\n return factor_list\n \n\ndef main():\n n = int(input())\n count = 0\n \n factor_list = factorization(n)\n \n for _, exponent in factor_list:\n \n \n #count += 1\n \n \n \n i = 1\n while exponent >= i:\n #print(factor_list)\n \n count += 1\n exponent = exponent - i\n i += 1\n \n print(count)\n return\n \nif __name__ == '__main__':\n main()"] | ['Wrong Answer', 'Accepted'] | ['s818543790', 's943657098'] | [9192.0, 9108.0] | [138.0, 120.0] | [1109, 1002] |
p02660 | u497592162 | 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 is_prime(n):\n for i in range(2, int(math.sqrt(n))+1):\n if n%i == 0:\n return False\n return True\n \ndef getPrimeExp(n):\n n_sqrt = int(math.sqrt(n))\n array = [True]*(n_sqrt+1)\n result = []\n for i in range(2, n_sqrt+1):\n if array[i]:\n array[i] = False\n result.append(i)\n for j in range(2, n_sqrt+1):\n ij = i**j\n if ij <= n_sqrt and array[ij]:\n result.append(ij)\n array[ij] = False\n elif ij > n:\n break\n for j in range(i*2, n_sqrt+1, i):\n array[j] = False\n \n # for j in range(2, n):\n \n \n \n \n return sorted(result)\n \nN = int(input())\nif N == 1:\n print(0)\nelif is_prime(N) and N != 1:\n print(1)\nelse:\n cnt = 0\n primeExp = getPrimeExp(N) \n n = N\n already = []\n \n for z in primeExp:\n if n%z == 0:\n n = int(n/z)\n cnt += 1\n already.append(z)\n if is_prime(n) and n not in already:\n cnt += 1\n else:\n for a in already:\n if n%a == 0:\n while n%a == 0:\n n = int(n/a)\n if is_prime(n) and n not in already:\n cnt += 1\n\n print(cnt)', 'import math\n\n\ndef is_prime(n):\n for i in range(2, int(math.sqrt(n))+1):\n if n%i == 0:\n return False\n return True\n\ndef getPrimeExp(n):\n n_sqrt = int(math.sqrt(n))\n array = [True]*(n_sqrt+1)\n result = []\n for i in range(2, n_sqrt+1):\n if array[i]:\n array[i] = False\n result.append(i)\n for j in range(2, n_sqrt+1):\n ij = i**j\n if ij <= n_sqrt and array[ij]:\n result.append(ij)\n array[ij] = False\n elif ij > n:\n break\n for j in range(i*2, n_sqrt+1, i):\n array[j] = False\n\n # for j in range(2, n):\n \n \n \n \n return sorted(result, reverse=True)\n\nN = int(input())\nif N == 1:\n print(0)\nelif is_prime(N) and N != 1:\n print(1)\nelse:\n cnt = 0\n n = N\n primeExp = getPrimeExp(n) \n already = []\n \n for z in primeExp:\n if n%z == 0:\n n = int(n/z)\n cnt += 1\n already.append(z)\n # print(z)\n # print(n)\n if is_prime(n):\n cnt += 1\n print(cnt)', 'import math\n\n\ndef is_prime(n):\n for i in range(2, int(math.sqrt(n))+1):\n if n%i == 0:\n return False\n return True\n\ndef getPrimeExp(n):\n n_sqrt = int(math.sqrt(n))\n array = [True]*(n_sqrt+1)\n result = []\n for i in range(2, n_sqrt+1):\n if array[i]:\n array[i] = False\n result.append(i)\n for j in range(2, n_sqrt+1):\n ij = i**j\n if ij <= n_sqrt and array[ij]:\n result.append(ij)\n array[ij] = False\n elif ij > n:\n break\n for j in range(i*2, n_sqrt+1, i):\n array[j] = False\n\n # for j in range(2, n):\n \n \n \n \n return sorted(result, reverse=True)\n\nN = int(input())\nif N == 1:\n print(0)\nelif is_prime(N) and N != 1:\n print(1)\nelse:\n cnt = 0\n n = N\n primeExp = getPrimeExp(n) \n already = []\n \n for z in primeExp:\n if n%z == 0:\n n = int(n/z)\n cnt += 1\n already.append(z)\n # print(z)\n # print(n)\n if is_prime(n) and n not in already:\n cnt += 1\n print(cnt)', 'import math\n\n\ndef is_prime(n):\n for i in range(2, int(math.sqrt(n))+1):\n if n%i == 0:\n return False\n return True \n\n\ndef getPrime(n):\n n_sqrt = int(math.sqrt(n))\n array = [True]*(n_sqrt+1)\n result = []\n for i in range(2, n_sqrt+1):\n if array[i]:\n array[i] = False\n result.append(i)\n for j in range(i*2, n_sqrt+1, i):\n array[j] = False\n return result\n\nN = int(input())\nn = N\nprime = getPrime(n)\nprime_exp = []\n\nfor p in prime:\n cnt = 0\n while n%p == 0:\n n = int(n/p)\n # print(n)\n cnt += 1\n if cnt != 0:\n prime_exp.append([p, cnt])\nif is_prime(n) and n != 1:\n prime_exp.append([n, 1])\nans = 0\nfor pe in prime_exp:\n ans += int((-1+math.sqrt(1+8*pe[1]))/2)\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s067815664', 's280070873', 's468933961', 's369644646'] | [20472.0, 20352.0, 20416.0, 19996.0] | [355.0, 352.0, 349.0, 309.0] | [1481, 1323, 1344, 922] |
p02660 | u502126017 | 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\nimport math\n\ndef factorization(n): \n arr = []\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(cnt)\n\n if temp!=1:\n arr.append(1)\n\n# if arr==[]:\n\n\n return arr\n\nz=factorization(n)\n\nans=0\nfor i in range(len(z)):\n for j in range(1,z[i]):\n if (z[i]-j)>=0:\n z[i]-=j\n ans+=1\n else:\n break\nprint(ans)', 'n=int(input())\n\nimport math\n\ndef factorization(n): \n arr = []\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(cnt)\n\n if temp!=1:\n arr.append(1)\n\n# if arr==[]:\n\n\n return arr\n\nz=factorization(n)\n\nans=0\nfor i in range(len(z)):\n for j in range(1,z[i]+1):\n if (z[i]-j)>=0:\n z[i]-=j\n ans+=1\n else:\n break\nprint(ans)\n '] | ['Wrong Answer', 'Accepted'] | ['s563204375', 's189010022'] | [9220.0, 9188.0] | [109.0, 113.0] | [616, 623] |
p02660 | u504836877 | 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\np = [0]*10**6\nfor i in range(2, 10**6):\n if p[i] == 0:\n p[i] = 1\n j = 2\n while i*j < 10**6:\n p[i*j] = -1\n j += 1\n\nL = []\nfor i in range(10**6):\n if p[i] < 1:\n continue\n j = 1\n while pow(i, j) <= N:\n L.append(pow(i, j))\n j += 1\n\nL.sort()\nans = 0\ntemp = []\nfor i in L:\n if N%i == 0:\n N //= i\n ans += 1\n temp.append(i)\n\ni = 2\nf = True\nwhile i <= N**0.5:\n if N%i == 0 and i in temp:\n f = False\n break\n i += 1\nif N in temp:\n f = False\nif f:\n ans += 1\nprint(ans)', 'N = int(input())\n\np = [0]*10**6\nfor i in range(2, 10**6):\n if p[i] == 0:\n p[i] = 1\n j = 2\n while i*j < 10**6:\n p[i*j] = -1\n j += 1\n\nans = 0\nfor i in range(10**6):\n if p[i] < 1:\n continue\n j = 1\n while N%pow(i, j) == 0:\n N //= pow(i, j)\n j += 1\n ans += 1\n\nfor i in range(10**6):\n if p[i] < 1:\n continue\n while N%i == 0:\n N //= i\n \nif N > 10**6:\n i = 2\n f = True\n while i <= N**0.5:\n if N%i == 0:\n f = False\n break\n i += 1\n if f:\n ans += 1\n\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s565293657', 's060440791'] | [23568.0, 16796.0] | [1221.0, 1164.0] | [600, 610] |
p02660 | u506086925 | 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 divisor(n): \n i = 1\n table = []\n while i * i <= n:\n if n%i == 0:\n table.append(i)\n table.append(n//i)\n i += 1\n table = list(set(table))\n return table\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())\na = divisors(n)\ncnt = 0\nfor i in range(1, len(a)):\n b = prime_decomposition(a[i])\n if len(list(set(b))) == 1:\n if n % a[i] == 0:\n n //= a[i]\n cnt += 1\nprint(cnt)', 'def divisor(n): \n i = 1\n table = []\n while i * i <= n:\n if n%i == 0:\n table.append(i)\n table.append(n//i)\n i += 1\n table = list(set(table))\n return table\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())\na = sorted(divisor(n))\ncnt = 0\nfor i in range(1, len(a)):\n b = prime_decomposition(a[i])\n if len(list(set(b))) == 1:\n if n % a[i] == 0:\n n //= a[i]\n cnt += 1\nprint(cnt)'] | ['Runtime Error', 'Accepted'] | ['s971463372', 's072223254'] | [9248.0, 9244.0] | [23.0, 304.0] | [604, 611] |
p02660 | u511449169 | 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 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 using_sqrt(limit):\n n = []\n for k in range(2, limit + 1):\n factor = 0\n\n \n if k % 2 == 0 and k != 2:\n continue\n\n \n for divisor in range(2, math.floor(math.sqrt(k)) + 1):\n if k % divisor == 0:\n factor += 1\n\n if factor == 0:\n n.append(k)\n\n return n\n\n\ndef isPrime(limit):\n for k in range(limit, limit + 1):\n factor = 0\n\n \n if k % 2 == 0 and k != 2:\n continue\n\n \n for divisor in range(2, math.floor(math.sqrt(k)) + 1):\n if k % divisor == 0:\n factor += 1\n\n if factor == 0:\n return True\n return False\n\n\nn = int(input())\nprime = using_sqrt(50**5)\nprev = []\n\nif n > 1 and isPrime(n):\n print(1)\n exit()\n\n\ndef check(n, prev):\n divs = make_divisors(int(n))\n flag = False\n for i in divs[1:]:\n for p in prime:\n e = math.log(i, p)\n if e.is_integer() and i not in prev:\n prev.append(i)\n flag = True\n check(n/i, prev)\n break\n if flag:\n break\n\n\ncheck(n, prev)\nprint(len(prev))', '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\nn = int(input())\nif n == 1:\n print(0)\n exit()\nz = factorization(n)\ncnt = 0\nfor item in z:\n p = item[0]\n e = item[1]\n num = 1\n while e >= num:\n e -= num\n cnt += 1\n num += 1\n\nprint(cnt)'] | ['Time Limit Exceeded', 'Accepted'] | ['s516493313', 's551276950'] | [10184.0, 9492.0] | [2206.0, 112.0] | [1707, 592] |
p02660 | u512099209 | 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 itertools import combinations\nfrom functools import reduce\nfrom operator import mul\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\nfacts = prime_factorize(N)\n\nused = set()\ncnt = 0\n\nwhile facts:\n #print(used)\n #print(facts)\n for i in range(1, len(facts)):\n for s in combinations(facts, i):\n m = reduce(mul, s)\n if not m in used:\n used |= {m}\n cnt += 1\n for j in s:\n facts.remove(j)\n break\n else:\n continue\n break\n else:\n break\n\nprint(cnt)', 'from collections import Counter\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\nfacts = Counter(prime_factorize(N))\ncnt = 0\n\ndef pattern_cnt(n):\n res = 0\n cur = 1\n while n - cur >= 0:\n n -= cur\n res += 1\n cur += 1\n return res\n\nfor k in facts:\n cnt += pattern_cnt(facts[k])\n #print(k, cnt)\n\nprint(cnt)'] | ['Wrong Answer', 'Accepted'] | ['s053692455', 's875236345'] | [9648.0, 9464.0] | [89.0, 96.0] | [706, 510] |
p02660 | u512212329 | 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 defaultdict\nfrom itertools import accumulate\n\n\ndef main():\n n = int(input())\n prime_counter = defaultdict(int)\n acc = tuple(accumulate(range(1, 42))) # 10^12 < 2^39\n\n f = 2\n while f * f <= n:\n if n % f == 0:\n n //= f\n prime_counter[f] += 1\n else:\n f += 1\n if n != 1:\n prime_counter[f] += 1\n\n ans = 0\n for c in prime_counter.values():\n for i, x in enumerate(acc):\n if c < x:\n tmp = i\n break\n ans += tmp\n print(ans)\n\n\nif __name__ == '__main__':\n main()\n", "def main():\n n = int(input())\n ans = 0\n\n e = 1\n for fac in (2, *(x * 2 + 3 for x in range(pow(10, 12)))):\n while n % (div := pow(fac, e)) == 0:\n n //= div\n ans += 1\n e += 1\n\n while n % fac == 0:\n n //= fac\n\n if fac * fac > n:\n break\n e = 1\n\n if n != 1:\n ans += 1\n\n print(ans)\n\n\nif __name__ == '__main__':\n main()\n", "from itertools import accumulate\n\n\ndef main():\n n = int(input())\n prime_counter = [0] * int(n ** 0.5 + 2)\n acc = tuple(accumulate(range(1, 42))) # 10^12 < 2^39\n\n f = 2\n while f * f <= n:\n if n % f == 0:\n n //= f\n prime_counter[f] += 1\n else:\n f += 1\n if n != 1:\n prime_counter[f] += 1\n\n ans = 0\n for c in prime_counter:\n for i, x in enumerate(acc):\n if c < x:\n tmp = i\n break\n ans += tmp\n print(ans)\n\n\nif __name__ == '__main__':\n main()\n", "from itertools import accumulate\nfrom collections import defaultdict\n\n\ndef main():\n n = int(input())\n prime_counter = defaultdict(int) # key ^ value\n # 10 because 2^39 < 10^12 < 2^40 and accum[9] = 45\n accum = tuple(accumulate(range(10)))\n\n def facs(n):\n yield 2\n max_prime = int(pow(n, 0.5)) + 1\n for x in range(3, max_prime, 2):\n yield x\n\n for fac in facs(n):\n while n % fac == 0:\n n //= fac\n prime_counter[fac] += 1\n if n != 1:\n prime_counter[n] += 1\n\n ans = 0\n for c in prime_counter.values():\n for accum_count, accum_value in enumerate(accum):\n if c < accum_value:\n ans += accum_count - 1\n break\n print(ans)\n\n\nif __name__ == '__main__':\n main()\n"] | ['Wrong Answer', 'Time Limit Exceeded', 'Wrong Answer', 'Accepted'] | ['s245210181', 's431272154', 's991506420', 's215266359'] | [9364.0, 870944.0, 17016.0, 9708.0] | [163.0, 2234.0, 366.0, 82.0] | [615, 424, 577, 800] |
p02660 | u523087093 | 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 isPrime(num):\n if num < 2:\n return False\n elif num == 2:\n return True\n elif num % 2 == 0:\n return False\n\n for i in range(3, math.floor(math.sqrt(num))+1, 2):\n if num % i == 0:\n return False\n return True\n\n\ndef find_all_prime(num):\n prime_list = [2]\n for i in range(3, num, 2):\n if isPrime(i):\n prime_list.append(i)\n\n return prime_list\n\n\nif __name__ == "__main__":\n N = int(input())\n if isPrime(N):\n print(1)\n else: \n prime_list = find_all_prime(int(1.25*10**6))\n count = 0 \n for i in prime_list:\n j = 1\n while N > 1:\n if N // i**j == 0:\n break\n if N % i**j == 0:\n N = N // i**j\n count += 1\n j +=1\n \n print(count)', 'import math\n\ndef isPrime(num):\n if num < 2:\n return False\n elif num == 2:\n return True\n elif num % 2 == 0:\n return False\n\n for i in range(3, math.floor(math.sqrt(num))+1, 2):\n if num % i == 0:\n return False\n return True\n\n\ndef find_all_prime(num):\n prime_list = [2]\n for i in range(3, num, 2):\n if isPrime(i):\n prime_list.append(i)\n\n return prime_list\n\n\nif __name__ == "__main__":\n N = int(input())\n prime_list = find_all_prime(10**6)\n count = 0\n if isPrime(N):\n print(1)\n else: \n for i in prime_list:\n j = 1\n while N > 1:\n if N // i**j == 0:\n break\n if N % i**j == 0:\n N = N // i**j\n count += 1\n j +=1\n \n print(count)', 'import math\n\ndef isPrime(num):\n if num < 2:\n return False\n elif num == 2:\n return True\n elif num % 2 == 0:\n return False\n\n for i in range(3, math.floor(math.sqrt(num))+1, 2):\n if num % i == 0:\n return False\n return True\n\n\ndef find_all_prime(num):\n prime_list = [2]\n for i in range(3, num, 2):\n if isPrime(i):\n prime_list.append(i)\n\n return prime_list\n\n\nif __name__ == "__main__":\n N = int(input())\n prime_list = find_all_prime(10**6)\n count = 0\n if isPrime(N):\n print(1)\n else: \n for i in prime_list:\n j = 1\n while N > 1:\n if N // i**j == 0:\n break\n if N % i**j == 0:\n N = N // i**j\n count += 1\n\n print(\'i: \',i, \'j: \',j, \'N: \', N)\n j +=1\n \n print(count)', 'import math\n\ndef isPrime(num):\n if num < 2:\n return False\n elif num == 2:\n return True\n elif num % 2 == 0:\n return False\n\n for i in range(3, math.floor(math.sqrt(num))+1, 2):\n if num % i == 0:\n return False\n return True\n\n\ndef find_all_prime(num):\n prime_list = [2]\n for i in range(3, num, 2):\n if isPrime(i):\n prime_list.append(i)\n\n return prime_list\n\n\nif __name__ == "__main__":\n N = int(input())\n if isPrime(N):\n print(1)\n else: \n prime_list = find_all_prime(2*10**6)\n count = 0 \n for i in prime_list:\n j = 1\n while N > 1:\n if N // i**j == 0:\n break\n if N % i**j == 0:\n N = N // i**j\n count += 1\n j +=1\n \n print(count)', 'def factorization(n):\n factorization_list = []\n temp = n\n for i in range(2, int(-(-n**0.5//1))+1):\n if temp % i == 0:\n count = 0\n while temp % i == 0:\n count += 1\n temp //= i\n factorization_list.append([i, count])\n\n if temp != 1:\n factorization_list.append([temp, 1])\n\n if factorization_list==[]:\n factorization_list.append([n, 1])\n\n return factorization_list\n\n\nif __name__ == "__main__":\n N = int(input())\n\n if N == 1:\n print(0)\n\n else:\n factorization_list = factorization(N)\n count = 0\n for factor in factorization_list:\n e = factor[1]\n i = 1\n while True:\n e -= i\n i += 1\n count += 1\n if e < i:\n break\n print(count)'] | ['Time Limit Exceeded', 'Wrong Answer', 'Wrong Answer', 'Time Limit Exceeded', 'Accepted'] | ['s308938208', 's511196812', 's578969985', 's661591626', 's641647997'] | [12632.0, 12276.0, 12264.0, 12620.0, 9468.0] | [2206.0, 2058.0, 2061.0, 2206.0, 108.0] | [890, 872, 927, 882, 875] |
p02660 | u536034761 | 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())\nn = N\nans = 0\nnum = [2]\nfor i in range(3, int(N ** 0.5)):\n if all(i % x != 0 for x in num):\n num.append(i)\n if n % i == 0:\n index = 1\n while n % i**index == 0:\n ans += 1\n n = n // (i**index)\n index += 1\n if n == 1:\n break\nprint(ans)', 'N = int(input())\nans = 0\nn = N\ncounter = []\nfor i in range(2, int(N**0.5) + 2):\n if n % i == 0:\n counter.append(1)\n n = n // i\n while n % i == 0:\n counter[-1] += 1\n n = n // i\nif n != 1:\n counter.append(1)\nfor c in counter:\n a = 1\n while c >= a:\n c -= a\n a += 1\n ans += 1\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s920454802', 's705437712'] | [9620.0, 9440.0] | [2206.0, 147.0] | [279, 314] |
p02660 | u536781361 | 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. | ['history = set([])\n\n\nimport sympy\n\ndef func(n):\n if n == 1:\n return \n l = sympy.divisors(n)\n for i in sorted(l[1:]):\n if i in history:\n continue\n if len(sympy.factorint(i)) > 1:\n continue\n print(i, n)\n history.add(i)\n _ = n // i\n func(_)\n break\n return\n\nN = int(input())\nif N == 0:\n print(0)\nelif N == 1:\n print(1)\nelse:\n func(N)\n print(len(history))', "input_count = 0\n\nimport math\n\nA, B = input().split()\n\nA = int(A)\nif '.' in B:\n B_a = int(B.split('.')[0])\n B_b_size = len(B.split('.')[1])\n B_b = int(B.split('.')[1])\nelse:\n B_a = int(B)\n B_b_size = 0\n B_b = 0\nans_a = A * B_a\nans_b = A * B_b \nans = ans_a + int(ans_b * pow(10, B_b_size))\nprint(ans)", 'history = set([])\n\ndef 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\ndef func(n):\n if n == 1:\n return \n l = make_divisors(n)\n for i in sorted(l[1:]):\n if i in history:\n continue\n if len(factorization(i)) > 1:\n continue\n history.add(i)\n _ = n // i\n func(_)\n break\n return\n\nN = int(input())\nif N == 0:\n print(0)\nelif N == 1:\n print(0)\nelse:\n func(N)\n print(len(history))'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s765735549', 's821673391', 's702520179'] | [9144.0, 9068.0, 9644.0] | [25.0, 23.0, 359.0] | [451, 317, 1060] |
p02660 | u540761833 | 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_dict(n):\n a = {}\n if n%2 == 0:\n a[2] = 1\n n//=2\n while n%2 == 0:\n a[2] += 1\n n //= 2\n f = 3\n while f*f <= n:\n if n%f == 0:\n if f not in a:\n a[f] = 1\n else:\n a[f] += 1\n else:\n f += 2\n if n!= 1:\n a[n] = 1\n return a\nprimes = prime_dict(N)\nans = 0\n\nprint(ans)\n ', 'from collections import Counter\nN = int(input())\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\nans = 0\nprimes = prime_factorize(N)\npc = Counter(primes)\nfor v in pc.values():\n now = 1\n while now*(now+1)//2 <= v:\n now += 1\n ans += now-1\nprint(ans)\n\n'] | ['Wrong Answer', 'Accepted'] | ['s542205413', 's455944404'] | [9136.0, 9440.0] | [2206.0, 93.0] | [417, 490] |
p02660 | u541929993 | 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())\nn=N\np=2\ndcmp={}\nwhile n>1:\n if n%p==0:\n dcmp[p]=1+(dcmp[p] if p in dcmp else 0)\n n//=p\n else:\n p+=1\ncnt=0\nfor k,v in dcmp.items():\n i=1\n while True:\n dcmp[k]-=i\n if dcmp[k]<0:\n break\n i+=1\n cnt+=1\n\n', 'N=int(input())\nn=N\np=2\ndcmp={}\nwhile n>1:\n if n%p==0:\n dcmp[p]=1+(dcmp[p] if p in dcmp else 0)\n else:\n p+=1\ncnt=0\nfor k,v in dcmp.items():\n i=1\n while True:\n dcmp[k]-=i\n if dcmp[k]<0:\n break\n i+=1\n cnt+=1\n\nprint(cnt)\n', 'N=int(input())\nn=N\np=2\ndcmp={}\nwhile n>1:\n if n%p==0:\n dcmp[p]=1+(dcmp[p] if p in dcmp else 0)\n else:\n p+=1\n n//=p\ncnt=0\nfor k,v in dcmp.items():\n i=1\n while True:\n dcmp[k]-=i\n if dcmp[k]<0:\n break\n i+=1\n cnt+=1\n\nprint(cnt)\n', 'import math\nN=int(input())\nn=N\np=2\ndp=1\nthrP=math.sqrt(N)\ndcmp={}\nwhile n>1:\n if n%p==0:\n dcmp[p]=1+(dcmp[p] if p in dcmp else 0)\n n//=p\n else:\n p+=dp\n dp=2\n if p>thrP:\n if n>1:\n dcmp[n]=1\n break\ncnt=0\nfor k,v in dcmp.items():\n i=1\n while True:\n dcmp[k]-=i\n if dcmp[k]<0:\n break\n i+=1\n cnt+=1\n\nprint(cnt)\n'] | ['Wrong Answer', 'Time Limit Exceeded', 'Wrong Answer', 'Accepted'] | ['s107829039', 's245847669', 's286986561', 's755906892'] | [9176.0, 8996.0, 9092.0, 9196.0] | [2206.0, 2206.0, 27.0, 150.0] | [285, 282, 292, 412] |
p02660 | u559250296 | 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())\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\nfactorization(a)\n', 'a=int(input())\nans =0\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\nb = factorization(a)\nfor i in range(len(b)):\n count=0\n c = b[i][1]\n\n for j in range(1,40):\n if c - j >= 0:\n c -= j\n count += 1\n else:\n ans += count\n break\nif a ==1:\n print(0)\nelse:\n print(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s285548419', 's421564809'] | [9456.0, 9432.0] | [112.0, 106.0] | [387, 642] |
p02660 | u561862393 | 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\nimport numpy as np\nfrom decimal import *\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())\nif n == 1:\n print(0)\nelse:\n arr = factorization(n)\n\n arr = np.array(arr)\n\n kazu = arr[:,1]\n sum = 0\n for i in range(1, 1000000):\n if len(kazu) ==0:\n break\n sum += len(kazu)\n kazu -= (i)\n tugi =[]\n for k in kazu:\n if k <= 0:\n sum -=1\n pass\n else:\n tugi.append(k)\n kazu = np.array(tugi)\n print(sum)\n', 'import sys\ninput = sys.stdin.readline\nimport numpy as np\nfrom decimal import *\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())\nif n == 1:\n print(0)\nelse:\n arr = factorization(n)\n\n arr = np.array(arr)\n\n kazu = arr[:,1]\n sum = 0\n for i in range(1, 1000000):\n if len(kazu) ==0:\n break\n sum += len(kazu)\n kazu -= (i)\n tugi =[]\n for k in kazu:\n if k < 0:\n sum -=1\n pass\n elif k == 0:\n pass\n else:\n tugi.append(k)\n kazu = np.array(tugi)\n print(sum)\n'] | ['Wrong Answer', 'Accepted'] | ['s522320977', 's765825878'] | [27268.0, 27240.0] | [184.0, 202.0] | [889, 934] |
p02660 | u580273604 | 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_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\nl=prime_factorize(N)\nL=set(l)\nprint(l,L)\nz=0\nfor j in L:\n i=1\n while i*(i+1)//2<=l.count(j):\n i+=1\n z+=i-1;print(z)\nprint(z)', 'N=int(input())\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\nl=prime_factorize(N)\nL=set(l)\nz=0\nfor j in L:\n i=1\n while i*(i+1)//2<=l.count(j):\n i+=1\n z+=i-1\nprint(z)'] | ['Wrong Answer', 'Accepted'] | ['s772437553', 's309673803'] | [9116.0, 8992.0] | [102.0, 99.0] | [418, 398] |
p02660 | u585963734 | 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 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\n\nN=int(input())\nif N==1:\n print(0)\n exit(0)\nc=0\np=factorization(N)\nprint(p)\nfor i in range(len(p)):\n r=1\n s=0\n while 1:\n s+=r\n if p[i][1]>=s:\n N/=pow(p[i][0],r)\n print(N)\n c+=1\n r+=1\n else:\n break\n \nprint(c)', '#import math\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\n\nN=int(input())\nif N==1:\n print(0)\n exit(0)\nc=0\np=factorization(N)\n#print(p)\nfor i in range(len(p)):\n r=1\n s=0\n while 1:\n s+=r\n if p[i][1]>=s:\n N/=pow(p[i][0],r)\n #print(N)\n c+=1\n r+=1\n else:\n break\n \nprint(c)'] | ['Wrong Answer', 'Accepted'] | ['s313614224', 's254129972'] | [9504.0, 9500.0] | [112.0, 112.0] | [674, 676] |
p02660 | u586639900 | 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 sqrt\nfrom collections import defaultdict\n\nN = int(input())\ndic = defaultdict(int)\n\ndef func(N):\n if N == 1:\n return 1\n \n for i in range(2, max(int(sqrt(N))+1, 3)):\n if N % i == 0:\n N = N // i\n dic[i] += 1\n return func(N)\n\nfunc(N)\n\ndef func2(k):\n n = 1\n count = 1\n while count * (count+1) // 2 <= k:\n count += 1\n return count-1\n\nres = 0\n\nfor value in dic.values():\n if value > 0:\n res += func2(value)\n\nprint(res)', 'from math import sqrt\nfrom collections import defaultdict\n\nN = int(input())\n\ndef prime_factorize(n):\n a = defaultdict(int)\n while n % 2 == 0:\n a[2] += 1\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a[f] += 1\n n //= f\n else:\n f += 2\n if n != 1:\n a[n] += 1\n return a\n \nps = prime_factorize(N)\n\ndef func2(k):\n n = 1\n count = 1\n while count * (count+1) // 2 <= k:\n count += 1\n return count-1\n\nres = 0\n\nfor value in ps.values():\n if value > 0:\n res += func2(value)\n\nprint(res)'] | ['Wrong Answer', 'Accepted'] | ['s392087713', 's121542428'] | [9360.0, 9480.0] | [120.0, 102.0] | [463, 576] |
p02660 | u587589241 | 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\nn=int(input())\nif n==1:\n print(0)\n sys.exit()\ndef f(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\ntmp=f(n)\nans=0\nfor i in tmp:\n dd=i[1]\n tt=1\n while dd>0:\n if dd-tt>=0:\n dd-=tt\n tt+=1\n ans+=1\n else:\n break\nprint(ans)=0:\n dd-=tt\n tt+=1\n ans+=1\nprint(ans)', 'import sys\nn=int(input())\nif n==1:\n print(0)\n sys.exit()\ndef f(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\ntmp=f(n)\nans=0\nfor i in tmp:\n dd=i[1]\n tt=1\n while dd>0:\n if dd-tt>=0:\n dd-=tt\n tt+=1\n ans+=1\n else:\n break\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s754220390', 's479367639'] | [9096.0, 9496.0] | [26.0, 112.0] | [658, 588] |
p02660 | u588558668 | 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. | ['m=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\n\nl=factorization(m)\nans=0\nfor i in range(len(l)):\n a=1\n while(l[i][1]>=a):\n ans+=1\n l[i][1]-=a\n a+=1\nif m=1:\n print("0")\nelse:\n print(ans)', 'm=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\n\nl=factorization(m)\nans=0\nfor i in range(len(l)):\n a=1\n while(l[i][1]>=a):\n ans+=1\n l[i][1]-=a\n a+=1\nif m==1:\n print("0")\nelse:\n print(ans)'] | ['Runtime Error', 'Accepted'] | ['s512728559', 's355071965'] | [9092.0, 9500.0] | [21.0, 111.0] | [538, 539] |
p02660 | u589783652 | 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\np = 2\ncounter = 0\nwhile N != 1:\n ind = 0\n n = -1\n while N % p == 0:\n N //= p\n ind += 1\n while (n+1)(n+2)//2 <= ind:\n n += 1\n counter += n\n p += 1\n\nprint(counter)', 'import math\n\nN = int(input())\n\np = 2\ncounter = 0\nwhile N != 1:\n if p > math.sqrt(N):\n counter += 1\n break\n ind = 0\n n = -1\n while N % p == 0:\n N //= p\n ind += 1\n if ind == 0:\n p += 1\n continue\n while (n+1)*(n+2)//2 <= ind:\n n += 1\n counter += n\n p += 1\n\nprint(counter)'] | ['Runtime Error', 'Accepted'] | ['s845666840', 's717524822'] | [9180.0, 9192.0] | [25.0, 388.0] | [194, 275] |
p02660 | u590748872 | 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())\nans = 0\nk = int(math.sqrt(n)) + 1\nprime = set()\nn1 = n\n\n\nfor i in range(2,k):\n while n1%i==0:\n prime.add(i)\n n1 = n1//i\n if n1==1: break\n\n\nfor i in range(2,k):\n p = 1\n while n%(i**p)==0 and i in prime:\n ans+=1\n n = n//(i**p)\n p+=1\n if n<i: break\n\nif n==1: print(0)\nelif ans==0: print(1)\nelse: print(ans)\n\n', 'import math\nn = int(input())\nans = 0\nk = int(math.sqrt(n)) + 1\nfor i in range(2,k):\n p = 1\n while n%(i**p)==0:\n ans+=1\n p+=1\n n = n//(i**p)\n if n==1: break\nprint(ans)\n\n', 'import math\nn = int(input())\nans = 0\nk = int(math.sqrt(n)) + 1\n\nfor i in range(2,k):\n p = 1\n while n%(i**p)==0:\n ans+=1\n n = n//(i**p)\n p+=1\n \n while n % i == 0:\n n //= i\n\n if n<i: break\n\nif n!=1: ans+=1\nprint(ans)\n\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s419358063', 's836636090', 's014295490'] | [9176.0, 9196.0, 9072.0] | [524.0, 2205.0, 473.0] | [384, 198, 263] |
p02660 | u593346450 | 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 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) \nif __name__ == "__main__":\n s = int(input())\n a = factorization(s) \n print(a)\n if a[0][0] == 1:\n print(0)\n else:\n an = 0\n for list1 in a: \n z = 0\n check = 0\n count = list1[1]\n while True:\n z += 1\n count -= z\n if count < 0:\n break\n check += 1\n an += check\n print(an) \n\n', 'import math \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) \nif __name__ == "__main__":\n s = int(input())\n a = factorization(s) \n if a[0][0] == 1:\n print(0)\n else:\n an = 0\n for list1 in a: \n z = 0\n check = 0\n count = list1[1]\n while True:\n z += 1\n count -= z\n if count < 0:\n break\n check += 1\n an += check\n print(an) \n\n'] | ['Wrong Answer', 'Accepted'] | ['s085151822', 's300590039'] | [9500.0, 9500.0] | [105.0, 105.0] | [865, 852] |
p02660 | u593590006 | 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 from math import sqrt as S \n pf=[]\n for i in range(2,int(S(n))+1):\n if n%i==0:\n c=0 \n while n%i==0:\n n//=i \n c+=1 \n pf.append([i,c])\n if n>1:\n pf.append([n,1])\n cnt=0 \n def search(x):\n i=1 \n while i(i+1)//2<=x:\n i+=1 \n return i-1 \n for x in range(len(pf)):\n a=pf[x][0]\n b=pf[x][1]\n cnt+=search(b)\n print(cnt)', 'n=int(input())\nfrom math import sqrt as S \npf=[]\nfor i in range(2,int(S(n))+1):\n if n%i==0:\n c=0 \n while n%i==0:\n n//=i \n c+=1 \n pf.append([i,c])\nif n>1:\n pf.append([n,1])\ncnt=0 \ndef search(x):\n i=1 \n while i*(i+1)//2<=x:\n i+=1 \n return i-1 \nfor x in range(len(pf)):\n a=pf[x][0]\n b=pf[x][1]\n cnt+=search(b)\nprint(cnt)'] | ['Runtime Error', 'Accepted'] | ['s486640510', 's076619347'] | [9008.0, 9228.0] | [22.0, 150.0] | [482, 391] |
p02660 | u595905528 | 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\ni = 2\nwhile(N**0.5>i):\n tmpi = i\n while(N%tmpi==0):\n ans+=1\n N/=tmpi\n tmpi*=i\n i+=1\nif N != 1:\n ans = 1\nprint(ans)', 'N = int(input())\nans = 0\ni = 2\nN\nl=2\nflag=True\nwhile(N**0.5>l):\n if N%l==0:\n flag=False\n break\n l+=1\nif N ==1:\n ans = 0\nelif flag:\n ans = 1\nelse:\n while(N**0.5>i):\n tmpi = i\n while(N%i==0):\n if N%tmpi==0:\n N/=tmpi\n tmpi*=i\n ans += 1\n else:\n N/=i\n i+=1\nprint(ans)', 'N = int(input())\nans = 0\ni = 2\nN\nl=2\nflag=True\nif N ==1:\n ans = 0\nelse:\n while(N**0.5>i):\n tmpi = i\n while(N%i==0):\n if N%tmpi==0:\n N/=tmpi\n tmpi*=i\n ans += 1\n else:\n N/=i\n i+=1\nwhile(N**0.5>l):\n if N%l==0:\n flag=False\n break\n l+=1\nif flag and N!=1:\n ans+=1\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s194614440', 's631929101', 's121264062'] | [9436.0, 9464.0, 9472.0] | [364.0, 662.0, 641.0] | [172, 394, 400] |
p02660 | u596368396 | 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# import math\n#\n\n\n\n\n#\n# while True:\n# p = min(candidate)\n\n\n# break\n\n#\n\n#\n\n#\n#\n# if N == 1:\n# print(0)\n# exit()\n#\n\n\n# print('hoge')\n#\n# n = N\n# c = 0\n# used = {}\n#\n# for l in L:\n# if n % l == 0:\n\n# l2 = l\n# while n % l2 == 0:\n# c += 1\n\n# used[l2] = True\n# n = n // l2\n# l2 = l ** i\n#\n# if c == 0:\n# print(1)\n# else:\n# if n != 1:\n\n# if n not in used:\n# c += 1\n# print(c)\n\nif N == 1:\n print(0)\n exit()\n\nans = 0\nused = {}\n\nn = N\ni = 1\np = 2\nwhile n % p == 0:\n ans += 1\n n = n // p\n used[p] = True\n i += 1\n p = 2**i\n\n\ni = 1\np = 3\nk = p\nwhile p * p <= N:\n while n % k == 0:\n if k in used:\n i += 1\n k = k ** i\n else:\n ans += 1\n i += 1\n n = n // k\n used[k] = True\n k = k ** i\n i = 1\n p += 2\n k = p\n\nif n not in used and used != 1:\n ans += 1\nprint(ans)\n", "N = int(input())\n\n# import math\n#\n\n\n\n\n#\n# while True:\n# p = min(candidate)\n\n\n# break\n\n#\n\n#\n\n#\n#\n# if N == 1:\n# print(0)\n# exit()\n#\n\n\n# print('hoge')\n#\n# n = N\n# c = 0\n# used = {}\n#\n# for l in L:\n# if n % l == 0:\n\n# l2 = l\n# while n % l2 == 0:\n# c += 1\n\n# used[l2] = True\n# n = n // l2\n# l2 = l ** i\n#\n# if c == 0:\n# print(1)\n# else:\n# if n != 1:\n\n# if n not in used:\n# c += 1\n# print(c)\n\n# if N == 1:\n# print(0)\n# exit()\n#\n# ans = 0\n# used = {}\n#\n# n = N\n\n# p = 2\n# while n % p == 0:\n# ans += 1\n# n = n // p\n# used[p] = True\n\n# p = 2**i\n#\n#\n\n# p = 3\n\n# while p * p <= N:\n# while n % k == 0:\n\n\n\n# else:\n# ans += 1\n\n# n = n // k\n# used[k] = True\n\n\n# p += 2\n\n#\n# if n not in used and n != 1:\n# ans += 1\n# print(ans)\n\ndef factorize(n):\n a = []\n \n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n \n \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\nfs = factorize(N)\n\nfrom collections import Counter\nc = Counter(fs)\n\nans = 0\ni = 1\nfor k, v in c.items():\n k2, v2 = k,v\n while v2 >= i:\n ans += 1\n v2 -= i\n i += 1\n i = 1\n\nprint(ans)\n"] | ['Wrong Answer', 'Accepted'] | ['s505669479', 's142041887'] | [9236.0, 9452.0] | [147.0, 93.0] | [1440, 2173] |
p02660 | u598296382 | 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\nN = int(input())\ndef pf(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\nc = collections.Counter(pf(N))\nprint(c)\nans = 0\nfor i in c.keys():\n for j in range(1,40):\n if j*(j+1)/2 <= c[i] < (j+1)*(j+2)/2:\n ans += j\nprint(ans)', 'import collections\nN = int(input())\ndef pf(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\nc = collections.Counter(pf(N))\nans = 0\nfor i in c.keys():\n for j in range(1,40):\n if j*(j+1)/2 <= c[i] < (j+1)*(j+2)/2:\n ans += j\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s821669319', 's233797721'] | [9412.0, 9376.0] | [99.0, 102.0] | [466, 457] |
p02660 | u600402037 | 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. | ['# coding: utf-8\nimport sys\nimport numpy as np\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\n\nU = 10 ** 8 + 10\nis_prime = np.zeros(U, np.bool)\nis_prime[2] = 1\nis_prime[3::2] = 1\nfor p in range(3, U, 2):\n if p*p > U:\n break\n if is_prime[p]:\n is_prime[p*p::p+p] = 0\n\nM = 10 ** 5\nsmall_primes = np.where(is_prime[:M])[0].tolist()\n\nN = ir()\nanswer = 0\nused = set([1])\nfor p in small_primes:\n d = p\n while N%d == 0:\n answer += 1\n N //= d\n used.add(d)\n d *= p\n\nif N > 1 and N not in used:\n answer += 1\n\nprint(answer)\n', '# coding: utf-8\nimport sys\nimport numpy as np\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\n\nU = 10 ** 6 + 10\nis_prime = np.zeros(U, np.bool)\nis_prime[2] = 1\nis_prime[3::2] = 1\nfor p in range(3, U, 2):\n if p*p > U:\n break\n if is_prime[p]:\n is_prime[p*p::p+p] = 0\n\nM = 10 ** 3\nsmall_primes = np.where(is_prime[:M])[0].tolist()\n\nN = ir()\nanswer = 0\nused = set()\nfor p in small_primes:\n d = p\n while N%d == 0:\n answer += 1\n N //= d\n used.add(d)\n d *= p\n\nif N > 1 and N not in used:\n answer += 1\n\nprint(answer)\n', '# coding: utf-8\nimport sys\n\nsr = lambda: sys.stdin.readline().rstrip()\nir = lambda: int(sr())\nlr = lambda: list(map(int, sr().split()))\n\ndef prime_factorize(n): \n A = []\n while n % 2 == 0:\n A.append(2); n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n A.append(f); n //= f\n else:\n f += 2\n if n != 1:\n A.append(n)\n return A\n\nN = ir()\nprimes = set(prime_factorize(N))\nanswer = 0\nfor p in primes:\n d = p\n while N%d == 0:\n answer += 1\n N //= d\n d *= p\n\nprint(answer)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s258485472', 's347891770', 's543289088'] | [124836.0, 27688.0, 9212.0] | [926.0, 112.0, 96.0] | [630, 627, 581] |
p02660 | u601426916 | 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. | ['#D\nimport math\nN = int(input())\nNsyo = N\ncount = 0\ndiv = 2\ndivcount = 0\ndivlist = []\nwhile N > 1 and div <= math.sqrt(N):\n if N%div == 0:\n while N%div == 0:\n N = N/div\n divcount = divcount+1\n divlist.append(divcount)\n divcount = 0\n else:\n pass\n div = div + 1\ndiv = 1\ndivcount = 0\nfor i in divlist:\n while i >= div:\n i = i-div\n divcount = divcount + 1\n div = div + 1\n \n count = count +divcount\n divcount = 0\n div = 1\nif divlist == [] and N >0:\n count = 1\nprint(count)', '#D\nimport math\nN = int(input())\nNsyo = N\ncount = 0\ndiv = 2\nwhile N > 1 and div <= math.sqrt(N):\n if N%div == 0:\n N = N/div\n count = count +1\n else:\n pass\n div = div +1\nif N == Nsyo and N>0:\n count = count +1\nelse:\n pass\nprint(count)', '#D\nimport math\nN = int(input())\nNsyo = N\ncount = 0\ndiv = 2\ndivcount = 0\ndivlist = []\nwhile N > 1 and div <= math.sqrt(Nsyo)+1:\n if N%div == 0:\n while N%div == 0:\n N = N/div\n divcount = divcount+1\n divlist.append(divcount)\n divcount = 0\n else:\n pass\n div = div + 1\ndiv = 1\ndivcount = 0\nfor i in divlist:\n while i >= div:\n i = i-div\n divcount = divcount + 1\n div = div + 1\n \n count = count +divcount\n divcount = 0\n div = 1\nif N > math.sqrt(Nsyo):\n count = count + 1\nprint(count)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s815473208', 's854161204', 's551435772'] | [9284.0, 9124.0, 9292.0] | [340.0, 325.0, 412.0] | [568, 268, 578] |
p02660 | u602773379 | 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 prime(num):\n\tarray=[]\n\ttmp=int(math.sqrt(n))+1\n\tfor i in range(2,tmp):\n\t\twhile num % i == 0:\n\t\t\tnum/=i\n\t\t\tarray.append(i)\n\t\n\tif array==[]:\n\t\treturn [num]\n\telse:\n\t\treturn array\n \nn=int(input())\nP=prime(n)\ntmp=P[0]\n\nif 1 in P:\n\tprint(0)\nelse:\n\tans=0\n\tfor i in range(0,len(P)):\n\t\tif i==0:\n\t\t\ttmp=P[i] \n\t\telif P[i]==P[i-1]:\n\t\t\ttmp*=P[i]\n\t\telse:\n\t\t\ttmp=P[i]\n\n\t\tif n%tmp==0:\n\t\t\tn/=tmp\n\t\t\tans+=1\n\t\tprint(n)\n\tprint(ans)', 'import math\n\ndef prime(num):\n\tarray=[]\n\ttmp=int(math.sqrt(n))+1\n\tfor i in range(2,tmp):\n\t\twhile num % i == 0:\n\t\t\tnum/=i\n\t\t\tarray.append(i)\n\t\n\t\n\tif array==[]:\n\t\treturn [num]\n\telse:\n\t\tif num>1:\n\t\t\tarray.append(int(num))\n\t\treturn array\n\nn=int(input())\nP=prime(n)\nP=sorted(P)\nnum=n\nif 1 in P:\n\tprint(0)\nelse:\n\tans=0\n\ttmp=0\n\tfor i in range(0,len(P)):\n\t\tif i==0:\n\t\t\ttmp=P[i] \n\t\telif P[i]==P[i-1]:\n\t\t\ttmp*=P[i]\n\t\telse:\n\t\t\ttmp=P[i]\n\t\t\tnum=n\n\t\tif num%tmp==0:\n\t\t\tnum/=tmp\n\t\t\tans+=1\n\t\t\t\n\tprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s483686163', 's069754836'] | [9116.0, 9292.0] | [116.0, 117.0] | [476, 530] |
p02660 | u606146341 | 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\na, b = map(str, input().split())\na = int(a)\nb = float(b)\n\nb = int(b * 100)\nans = a * b // 100\n\nans = int(math.floor(ans))\nprint(ans)', '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 \n arr.append(cnt)\n\n if temp != 1:\n arr.append(1)\n \n if arr==[] and n != 1:\n arr.append(1)\n\n return arr\n \nlst = factorization(n)\nans = 0\nif not lst:\n print(ans)\nelse:\n mx = max(lst)\n for _ in lst:\n for i in range(1, mx+1):\n if _ - i >= 0:\n \t_ -= i\n \tans += 1\n else:\n \tbreak\n print(ans)'] | ['Runtime Error', 'Accepted'] | ['s772129735', 's270112999'] | [9112.0, 9484.0] | [25.0, 111.0] | [144, 603] |
p02660 | u608178601 | 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\nN=int(input())\nans=0\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\nif N==1:\n\tprint(0)\n\t\nelse:\n\tlis=collections.Counter(prime_factorize(N))\n\tlis_=list(lis.values())\n\tfor i in range(len(lis_)):\n\t\tfor h in range(1,45):\n\t\t\tif lis_[i]>=h*(h+1)/2:\n\t\t\t\tans+=1', 'import collections\n\nN=int(input())\nans=0\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\nif N==1:\n\tprint(0)\n\t\nelse:\n\tlis=collections.Counter(prime_factorize(N))\n\tlis_=list(lis.values())\n\tfor i in range(len(lis_)):\n\t\tfor h in range(1,45):\n\t\t\tif lis_[i]>=h*(h+1)/2:\n\t\t\t\tans+=1\n\tprint(int(ans))\n\t\t'] | ['Wrong Answer', 'Accepted'] | ['s547330717', 's138130768'] | [9484.0, 9468.0] | [94.0, 89.0] | [502, 522] |
p02660 | u613920660 | 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 prime(x):\n if x==1:\n prime=False\n else:\n prime=True\n for i in range(2,int(math.sqrt(x)+1)):\n if x%i==0:\n prime=False\n break\n return prime\n\ndef count_prime(N):\n if prime(N): \n big_prime=True\n \n else:\u3000\n big_prime=False\n rtN_init=int(math.sqrt(N)+1)\n p=[0 for n in range(int(math.sqrt(N)+1))]\n \n \n while N>1 and prime(N)==False:\n rtN=int(math.sqrt(N)+1)\n for i in range(2,rtN+1):\n if N%i==0 and prime(i):\n p[i]+=1\n N=N//i\n break\n \n if prime(N) and N>rtN_init:\n big_prime=True\n return p,big_prime\n\ndef main():\n N=int(input())\n p,q=count_prime(N)\n cnt=0\n \n for n in range(len(p)):\n num=1\n while p[n]>=1:\n p[n]-=num\n if p[n]>=0:\n cnt+=1\n num+=1\n if q==True:\n cnt+=1\n print(cnt)\n \nif __name__=="__main__":\n main()\n ', 'import math\n\ndef prime(x):\n if x==1:\n prime=False\n else:\n prime=True\n for i in range(2,int(math.sqrt(x)+1)):\n if x%i==0:\n prime=False\n break\n return prime\n\ndef count_prime(N):\n p=[0 for n in range(int(math.sqrt(N)+1))]\n \n if prime(N):\n big_prime=True\n \n else:\n big_prime=False\n rtN_init=int(math.sqrt(N)+1)\n \n \n while N>1:\n \n if prime(N) and N>rtN_init:\n big_prime=True\n break\n else:\n for i in range(2,rtN_init):\n if N%i==0 and prime(i):\n p[i]+=1\n N=N//i\n break\n return p,big_prime\n\ndef main():\n N=int(input())\n p,q=count_prime(N)\n cnt=0\n \n for n in range(len(p)):\n num=1\n while p[n]>=1:\n p[n]-=num\n if p[n]>=0:\n cnt+=1\n num+=1\n if q==True:\n cnt+=1\n print(cnt)\n \nif __name__=="__main__":\n main()'] | ['Runtime Error', 'Accepted'] | ['s714286825', 's980908056'] | [9044.0, 17020.0] | [22.0, 366.0] | [1336, 1324] |
p02660 | u618107373 | 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(100000)\n\n\ndef ins(): return input().split()\ndef ii(): return int(input())\ndef iil(): return list(map(int, ins()))\ndef lin(): return list(input())\ndef iin(): return map(int, ins())\n\nfrom collections import defaultdict\nfrom math import sqrt\n\narr = []\nmax_p = int(50000)\nl1 = [1 for i in range(max_p)]\nl2 = set()\nl2.add(2)\nfor i in range(max_p):\n if not l1[i]:\n continue\n l2.add(2*i+3)\n for j in range(3*i+3, max_p, 2*i+3):\n l1[j] = 0\n\nn = int(input())\ndic = defaultdict(int)\nfor i in l2:\n while n % i == 0:\n n //= i\n dic[i] += 1\nif n != 1:\n dic[n] += 1\n\nans = 0\nfor i in dic.values():\n ans += (-1 + sqrt(1 + 8 * i))//2\nprint(ans)\n', 'import sys\nsys.setrecursionlimit(100000)\n\n\ndef ins(): return input().split()\ndef ii(): return int(input())\ndef iil(): return list(map(int, ins()))\ndef lin(): return list(input())\ndef iin(): return map(int, ins())\n\nfrom collections import defaultdict\nfrom math import sqrt\n\narr = []\nmax_p = int(500000)\nl1 = [1 for i in range(max_p)]\nl2 = set()\nl2.add(2)\nfor i in range(max_p):\n if not l1[i]:\n continue\n l2.add(2*i+3)\n for j in range(3*i+3, max_p, 2*i+3):\n l1[j] = 0\n\nn = int(input())\n#n = 10 ** 12\ndic = defaultdict(int)\nfor i in l2:\n while n % i == 0:\n n //= i\n dic[i] += 1\nif n != 1:\n dic[n] += 1\n\nans = 0\nfor i in dic.values():\n ans += (-1 + sqrt(1 + 8 * i))//2\nprint(int(ans))\n'] | ['Wrong Answer', 'Accepted'] | ['s183372421', 's388786888'] | [10468.0, 17672.0] | [45.0, 229.0] | [707, 727] |
p02660 | u621582427 | 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 x = 2\n f = []\n while x**2 <= n:\n c = 0\n if n % x != 0:\n break\n else:\n while n % x == 0:\n n //= x\n c += 1\n f.append([x, c])\n\n if n > 1:\n f.append([n, 1])\n return f\n\nn = int(input())\nf = factorize(n)\nans = 0\nfor el in f:\n m = el[1]\n i = 1\n while True:\n if i*(i+1)//2 > m:\n ans += i-1\n break\n i += 1\n\nfor el in f:\n print(el)\nprint(ans)', 'def factorize(n):\n x = 2\n f = []\n while x**2 <= n:\n c = 0\n if n % x != 0:\n x += 1\n continue\n else:\n while n % x == 0:\n n //= x\n c += 1\n f.append([x, c])\n x += 1\n\n if n > 1:\n f.append([n, 1])\n return f\n\nn = int(input())\nf = factorize(n)\nans = 0\nfor el in f:\n m = el[1]\n i = 1\n while True:\n if i*(i+1)//2 > m:\n ans += i-1\n break\n i += 1\n\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s371099161', 's173114370'] | [9224.0, 9220.0] | [24.0, 317.0] | [505, 515] |
p02660 | u628047647 | 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())\ni = 2\nans = 0\nwhile True:\n if i * i > n:\n break\n if n % i == 0:\n cnt = 0\n while n % i == 0:\n n /= i\n cnt += 1\n k = 1\n while cnt >= k:\n cnt -= k\n k += 1\n ans += k - 1\n i += 1\nprint(ans)', 'n = int(input())\ni = 2\nans = 0\nwhile True:\n if i * i > n:\n break\n if n % i == 0:\n cnt = 0\n while n % i == 0:\n n /= i\n cnt += 1\n k = 1\n while cnt >= k:\n cnt -= k\n k += 1\n ans += k - 1\n i += 1\nif n > 1:\n ans += 1\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s033794813', 's225067910'] | [9260.0, 9264.0] | [241.0, 224.0] | [242, 263] |
p02660 | u628285938 | 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\nans = 0\n\nif(N>1):\n Q = factorization(N)\n "print(Q)"\n A = [ b for [a,b] in Q]\n for a in A:\n i = 1\n while(a >= i):\n a -= i\n i += 1\n ans += 1\n print(ans)\n\nelse:\n print(0)', 'N = int(input())\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\nans = 0\n\nif(N>1):\n Q = factorization(N)\n A = [ b for [a,b] in Q]\n for a in A:\n i = 1\n while(a >= i):\n a -= i\n i += 1\n ans += 1\n print(ans)\n\nelse:\n print(0)'] | ['Runtime Error', 'Accepted'] | ['s773109692', 's009291794'] | [9192.0, 9496.0] | [24.0, 106.0] | [584, 587] |
p02660 | u629670559 | 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\tarr = []\n\ttemp = n\n\tfor i in range(2, int(-(-n**0.5 // 1)) + 1):\n\t\tif temp % i == 0:\n\t\t\tcnt = 0\n\t\t\twhile temp % i == 0:\n\t\t\t\tcnt += 1\n\t\t\t\ttemp //= i\n\t\t\tarr.append([i,cnt])\n\n\tif temp != 1:\n\t\tarr.append([temp, 1])\n\n\tif arr == []:\n\t\tarr.append([n,1])\n\n\treturn arr\n\nN = int(input())\nprint(factorization(N))', 'def doit(n):\n\tif(n == 1):\n\t\treturn 0\n\tc = 0\n\ttemp = n\n\tfor p in range(2, int(n ** 0.5) + 1):\n\t\tif temp % p == 0:\n\t\t\te = 0\n\t\t\twhile temp % p == 0:\n\t\t\t\te += 1\n\t\t\t\ttemp //= p\n\t\t\tc += int(0.5 * (-1 + (1 + 8 * e) ** 0.5))\n\n\tif temp == n:\n\t\tc += 1\n\telif temp != 1:\n\t\tc += 1\n\n\treturn c\n\nprint(doit(int(input())))'] | ['Wrong Answer', 'Accepted'] | ['s695432247', 's125336089'] | [9460.0, 9348.0] | [112.0, 110.0] | [324, 305] |
p02660 | u637897856 | 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 collections import Counter\n \nf = Counter()\n \nfor i in range(2, min(int(n ** 0.5 + 1), n + 1)):\n while n % i == 0:\n f[i] += 1\n n //= i\n \n \ndef bsearch(test, lo, hi):\n while lo != hi:\n mid = (lo + hi + 1) // 2\n if test(mid):\n lo = mid\n else:\n hi = mid - 1\n return lo\n \nans = 0\nfor p, q in f.items():\n ans += bsearch(lambda w: w * (w + 1) // 2 < q, 0, 10 ** 12)\n \nif ans == 0 and n > 1:\n print(1)\nelse:\n print(ans)\n', 'n = int(input())\n \nfrom collections import Counter\n \nf = Counter()\n\nfactors = []\nfor i in range(2, min(int(n ** 0.5 + 1), n + 1)):\n if n % i == 0:\n factors.append(i)\n factors.append(n // i)\n\nfactors.sort()\n\nfor factor in factors:\n while n % factor == 0:\n n //= factor\n f[factor] += 1\n\n \n \ndef bsearch(test, lo, hi):\n while lo != hi:\n mid = (lo + hi + 1) // 2\n if test(mid):\n lo = mid\n else:\n hi = mid - 1\n return lo\n \nans = 0\nfor p, q in f.items():\n ans += bsearch(lambda w: w * (w + 1) // 2 <= q, 0, 10 ** 12)\n \nif ans == 0 and n > 1:\n print(1)\nelse:\n print(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s299009458', 's872587427'] | [9688.0, 9628.0] | [154.0, 152.0] | [474, 623] |
p02660 | u638033979 | 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\nfactorization(24) \n\nn = int(input())\nP = factorization(n)\n\nQ = []\nfor p in P:\n \n temp = 1\n while p[1] > 1:\n t = p[0] ** temp\n Q.append(t)\n p[1] -= temp\n temp += 1\n\nprint(len(Q))', '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\nfactorization(24) \n\nn = int(input())\nP = factorization(n)\n\nQ = []\nfor p in P:\n \n temp = 1\n while p[1] > 1:\n t = p[0] ** temp\n Q.append(t)\n p[1] -= temp\n temp += 1\n\nprint(len(Q))', '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\nfactorization(24) \n\nn = int(input())\nP = factorization(n)\n\nQ = []\nfor i in range(len(P)):\n temp = 1\n while P[i][1] >= temp and P[i][0] != 1:\n t = P[i][0] ** temp\n Q.append(t)\n P[i][1] -= temp\n temp += 1\n\nprint(len(Q))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s535534194', 's624594938', 's750462958'] | [9496.0, 9500.0, 9504.0] | [111.0, 114.0, 103.0] | [567, 567, 604] |
p02660 | u638282348 | 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 statistics import median\nN = int(input())\nA, B = zip(*tuple(tuple(map(int, input().split())) for _ in range(N)))\nprint(int((median(B) - median(A)) * (1 + (not N & 1))) + 1)', 'from itertools import accumulate\nfrom bisect import bisect_right\ndef prime_factorize_dict(n):\n d = dict()\n while not n & 1:\n d[2] = d.get(2, 0) + 1\n n >>= 1\n f = 3\n while f * f <= n:\n if not n % f:\n d[f] = d.get(f, 0) + 1\n n //= f\n else:\n f += 2\n if n != 1:\n d[n] = d.get(n, 0) + 1\n return d\n\nN = int(input())\nl = list(prime_factorize_dict(N).values())\nL = list(accumulate(range(10 ** 6)))\nprint(sum(bisect_right(L, item) - 1 for item in l))'] | ['Runtime Error', 'Accepted'] | ['s544906138', 's263103003'] | [10972.0, 63760.0] | [32.0, 184.0] | [177, 527] |
p02660 | u644126199 | 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 = int(input())\nsu =0\nfor i in range(2, int(-(-temp**0.5//1))+1):\n if temp%i==0:\n cnt=0\n store =i\n while temp%i==0 and temp !=i :\n cnt+=1\n \n temp //= i\n arr.append(i)\n su +=1\n i *=store\n \n \nif temp!=1:\n if all(temp>s for s in arr):\n arr.append(temp)\n su +=1\n \n \n\nif arr==[] and temp !=1:\n arr.append(n)\n su =1\n\n \n\nprint(su)', 'arr = []\ntemp = int(input())\nsu =0\nfor i in range(2, int(-(-temp**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(cnt)\n \n \n \n \n\nif temp!=1:\n arr.append(1)\n \n \nif arr==[] and temp !=1:\n arr.append(1)\n su =1\n\n\nfor t in range(len(arr)):\n cnt =1\n while arr[t] -cnt>=0:\n arr[t] -=cnt\n su +=1\n cnt +=1\n \n \nprint(su)'] | ['Wrong Answer', 'Accepted'] | ['s216476720', 's201443635'] | [9488.0, 9412.0] | [143.0, 148.0] | [405, 402] |
p02660 | u645504441 | 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 p(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())\ns = p(n)\nc = collections.Counter(s)\nt = list(c.values())\nm = 0\n\nfor i in range(len(t)):\n for j in range (100):\n if (t[i]- 1 >= 0):\n m = m + 1\n t[i] = t[i] - 1\n else:\n break\n\nprint(m)', 'import collections\n\ndef p(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())\ns = p(n)\nc = collections.Counter(s)\nt = list(c.values())\nm = 0\n\nfor x in t:\n \n a = 1\n\n for j in range (100):\n if (x - a >= 0):\n x = x - a\n m = m + 1\n a = a + 1\n else:\n break\n\nprint(m)'] | ['Wrong Answer', 'Accepted'] | ['s228750377', 's148248023'] | [9464.0, 9468.0] | [92.0, 93.0] | [529, 547] |
p02660 | u648881683 | 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, collections\ninput = lambda: sys.stdin.readline().rstrip() \nsys.setrecursionlimit(10**7)\nINF = 10**20\ndef I(): return int(input())\ndef F(): return float(input())\ndef S(): return input()\ndef LI(): return [int(x) for x in input().split()]\ndef LI_(): return [int(x)-1 for x in input().split()]\ndef LF(): return [float(x) for x in input().split()]\ndef LS(): return input().split()\n\ndef resolve():\n N = I()\n\n ans = []\n temp = N\n for i in range(2, int(N**0.5)+1):\n if temp%i == 0:\n ans.append(i)\n temp //= i\n if temp > int(N**0.5):\n ans.append(temp)\n\n print(ans)\n print(len(ans))\n\nif __name__ == '__main__':\n resolve()", "import sys, collections\ninput = lambda: sys.stdin.readline().rstrip() \nsys.setrecursionlimit(10**7)\nINF = 10**20\ndef I(): return int(input())\ndef F(): return float(input())\ndef S(): return input()\ndef LI(): return [int(x) for x in input().split()]\ndef LI_(): return [int(x)-1 for x in input().split()]\ndef LF(): return [float(x) for x in input().split()]\ndef LS(): return input().split()\n\ndef resolve():\n N = I()\n\n def sieve(n):\n is_prime = [True for _ in range(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 is_prime[i]:\n for j in range(i*2, n+1, i):\n is_prime[j] = False\n return [i for i in range(n+1) if is_prime[i]]\n\n primes = sieve(int(N**0.5))\n\n ans = []\n temp = N\n for i in primes:\n j = i\n while j<int(N**0.5)+1:\n if temp%j == 0:\n ans.append(j)\n temp //= j\n j *= i\n if temp > int(N**0.5):\n ans.append(temp)\n\n # print(ans)\n print(len(ans))\n\nif __name__ == '__main__':\n resolve()"] | ['Wrong Answer', 'Accepted'] | ['s273005523', 's269977346'] | [9760.0, 20592.0] | [109.0, 248.0] | [683, 1107] |
p02660 | u648901783 | 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\nimport heapq \n\n\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,i, cnt])\n\n if temp!=1:\n arr.append([temp,temp, 1])\n\n if arr==[]:\n arr.append([n,n,1])\n\n return arr\n\n# for N in range(1,100000):\n# N = 288\n# print(N)\n\nheap = factorization(N) \nprint(heap)\n# print(heap)\nheapq.heapify(heap)\nans = 0\n\nwhile(heap):\n # print(heap)\n if N == 1:\n break\n sub,prime,cnt = heapq.heappop(heap)\n if N < sub:\n break\n if N % sub == 0:\n N = N // sub\n ans += 1\n if cnt > 0:\n cnt -= 1\n sub *= prime\n heapq.heappush(heap, [sub,prime,cnt])\n\n print(ans)\n\n\n', 'N = int(input())\n\nimport heapq \n\n\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,i, cnt])\n\n if temp!=1:\n arr.append([temp,temp, 1])\n\n if arr==[]:\n arr.append([n,n,1])\n\n return arr\n\n# for N in range(1,100000):\n# N = 288\n# print(N)\n\nheap = factorization(N) \n# print(heap)\n# print(heap)\nheapq.heapify(heap)\nans = 0\n\nwhile(heap):\n # print(heap)\n if N == 1:\n break\n sub,prime,cnt = heapq.heappop(heap)\n if N < sub:\n break\n if N % sub == 0:\n N = N // sub\n ans += 1\n if cnt > 0:\n cnt -= 1\n sub *= prime\n heapq.heappush(heap, [sub,prime,cnt])\n\nprint(ans)\n\n\n'] | ['Wrong Answer', 'Accepted'] | ['s604699010', 's340064657'] | [9544.0, 9448.0] | [112.0, 111.0] | [851, 849] |
p02660 | u652656291 | 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\nimport math\n\nn = int(input())\nB = [1,2,6,10,15,21,28,36,45,55]\nans = 0\n\ndef is_prime(n):\n if n == 1: return False\n\n for k in range(2, int(math.sqrt(n)) + 1):\n if n % k == 0:\n return False\n return True\nif is_prime(n) == True:\n print(1)\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\nc = collections.Counter(prime_factorize(n)) \n\nfor v in c.values():\n for j in range(len(B)):\n if v <=B[j]:\n ans += j\n break\n\nprint(ans)\n\n', 'import collections\nimport math\n\nn = int(input())\nB = [1,3,6,10,15,21,28,36,45,55,67,80]\nans = 0\n\ndef is_prime(n):\n if n == 1: return False\n\n for k in range(2, int(math.sqrt(n)) + 1):\n if n % k == 0:\n return False\n return True\nif is_prime(n) == True:\n print(1)\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\nc = collections.Counter(prime_factorize(n)) \nprint(c)\nfor v in c.values():\n for j in range(len(B)):\n if v < B[j]:\n ans += j+1\n break\n\nprint(ans)\n', 'import collections\nimport math\n\nn = int(input())\nB = [1,3,6,10,15,21,28,36,45,55,67,80]\nans = 0\n\ndef is_prime(n):\n if n == 1: return False\n\n for k in range(2, int(math.sqrt(n)) + 1):\n if n % k == 0:\n return False\n return True\nif is_prime(n) == True:\n print(1)\n exit()', 'import collections\nimport math\n\nn = int(input())\nB = [1,2,6,10,15,21,28,36,45,55,67,80]\nans = 0\n\ndef is_prime(n):\n if n == 1: return False\n\n for k in range(2, int(math.sqrt(n)) + 1):\n if n % k == 0:\n return False\n return True\nif is_prime(n) == True:\n print(1)\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\nc = collections.Counter(prime_factorize(n)) \n\nfor v in c.values():\n for j in range(len(B)):\n if v <=B[j]:\n ans += j\n break\n\nprint(ans)\n\n', 'import collections\nimport math\n\nn = int(input())\nB = [1,3,6,10,15,21,28,36,45,55,67,80]\nans = 0\n\ndef is_prime(n):\n if n == 1: return False\n\n for k in range(2, int(math.sqrt(n)) + 1):\n if n % k == 0:\n return False\n return True\nif is_prime(n) == True:\n print(1)\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\nc = collections.Counter(prime_factorize(n)) \n\nfor v in c.values():\n for j in range(len(B)):\n if v < B[j]:\n ans += j+1\n break\n\nprint(ans)\n', 'import collections\nimport math\n\nn = int(input())\nB = [1,2,6,10,15,21,28,36,45,55,67,80]\nans = 0\n\ndef is_prime(n):\n if n == 1: return False\n\n for k in range(2, int(math.sqrt(n)) + 1):\n if n % k == 0:\n return False\n return True\nif is_prime(n) == True:\n print(1)\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\nc = collections.Counter(prime_factorize(n)) \n\nfor v in c.values():\n for j in range(len(B)):\n if v < B[j]:\n ans += j+1\n break\n\nprint(ans)\n\n', 'import collections\nimport math\n\nn = int(input())\nB = [1,3,6,10,15,21,28,36,45,55,67,80]\nans = 0\n\ndef is_prime(n):\n if n == 1: return False\n\n for k in range(2, int(math.sqrt(n)) + 1):\n if n % k == 0:\n return False\n return True\nif is_prime(n) == True:\n print(1)\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\nc = collections.Counter(prime_factorize(n)) \nprint(c)\nfor v in c.values():\n for j in range(len(B)):\n if v < B[j]:\n ans += j\n break\n\nprint(ans)\n', 'import collections\nimport math\n\nn = int(input())\nB = [1,2,6,10,15,21,28,36,45,55]\nans = 0\n\ndef is_prime(n):\n if n == 1: return False\n\n for k in range(2, int(math.sqrt(n)) + 1):\n if n % k == 0:\n return False\n return True\nif is_prime(n) == True:\n print(1)\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\nc = collections.Counter(prime_factorize(840)) \nC = c.values()\nfor i in range(len(C)):\n for j in range(len(B)):\n if C[i] < B[j]:\n ans += j+1\n break\n\nprint(ans)\n', 'import collections\nimport math\n\nn = int(input())\nB = [1,3,6,10,15,21,28,36,45,55,66,78,91,105]\nans = 0\n\ndef is_prime(n):\n if n == 1: return False\n\n for k in range(2, int(math.sqrt(n)) + 1):\n if n % k == 0:\n return False\n return True\nif is_prime(n) == True:\n print(1)\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\nc = collections.Counter(prime_factorize(n)) \nprint(c)\nfor v in c.values():\n for j in range(len(B)):\n if v < B[j]:\n ans += j\n break\n print(ans)\n\nprint(ans)\n\n', 'import collections\nimport math\n\nn = int(input())\nB = [1,3,6,10,15,21,28,36,45,55,66,78,91,105]\nans = 0\n\ndef is_prime(n):\n if n == 1: return False\n\n for k in range(2, int(math.sqrt(n)) + 1):\n if n % k == 0:\n return False\n return True\nif is_prime(n) == True:\n print(1)\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\nc = collections.Counter(prime_factorize(n)) \nfor v in c.values():\n for j in range(len(B)):\n if v < B[j]:\n ans += j\n break\n \nprint(ans)\n\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s071094043', 's175460227', 's232263929', 's338535122', 's358512674', 's511710132', 's624107082', 's643484747', 's848802813', 's536280630'] | [9480.0, 9476.0, 9444.0, 9480.0, 9480.0, 9480.0, 9472.0, 9492.0, 9480.0, 9440.0] | [169.0, 180.0, 114.0, 174.0, 174.0, 174.0, 179.0, 113.0, 156.0, 179.0] | [717, 732, 296, 723, 724, 725, 730, 739, 753, 735] |
p02660 | u667854389 | 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 floor,sqrt\nN=int(input())\n\np = [1]*floor(sqrt(10**6))\np[0]=p[1]=0\nprime=[]\nfor i in range(2,len(p)):\n if p[i]==0:\n continue\n prime.append(i)\n for j in range(i*2,len(p),i):\n p[j]=0\n\nans=0\nfor x in prime:\n cnt=0\n while N%x==0:\n cnt+=1\n N/=x\n ans+=floor((-1+sqrt(1+8*cnt))/2)\nprint(ans+int(N!=0))\n', 'from math import floor,sqrt\nN=int(input())\n\np = [1]*floor((10**6))\np[0]=p[1]=0\nprime=[]\nfor i in range(2,len(p)):\n if p[i]==0:\n continue\n prime.append(i)\n for j in range(i*2,len(p),i):\n p[j]=0\n\nans=0\nfor x in prime:\n if N%x!=0:\n continue\n cnt=0\n while N%x==0:\n cnt+=1\n N//=x\n ans+=floor((-1+sqrt(1+8*cnt))/2)\nprint(ans+int(N!=1))\n'] | ['Wrong Answer', 'Accepted'] | ['s247183132', 's066006724'] | [9280.0, 20084.0] | [23.0, 432.0] | [357, 386] |
p02660 | u677267454 | 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\n if n != 1:\n a.append(n)\n\n return a\n\n\nN = int(input())\nsosu = prime_factorize(N)\nhistory = set()\ncount = 0\ncursor = 2\nwhile len(sosu) > 0:\n print(sosu)\n num = sosu.pop(0)\n cursor = num\n while True:\n if num not in history:\n history.add(num)\n break\n if (len(sosu) <= 0):\n break\n if (cursor != sosu[0]):\n break\n num *= sosu.pop(0)\n\nprint(len(history))\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\n if n != 1:\n a.append(n)\n\n return a\n\n\nN = int(input())\nsosu = prime_factorize(N)\nhistory = set()\ncount = 0\nwhile len(sosu) > 0:\n num = sosu.pop(0)\n cursor = num\n while True:\n if num not in history:\n history.add(num)\n break\n if (len(sosu) <= 0):\n break\n if (cursor != sosu[0]):\n break\n num *= sosu.pop(0)\n\nprint(len(history))\n'] | ['Wrong Answer', 'Accepted'] | ['s783001996', 's748366668'] | [9232.0, 9224.0] | [91.0, 90.0] | [672, 645] |
p02660 | u685983477 | 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 defaultdict\nfrom collections import deque\nfrom itertools import accumulate\nimport math\ndef main():\n a,b=map(float, input().split())\n print(int((a*(b*100))//100))\n\n\nif __name__ == '__main__':\n main()\n", "import math\nfrom collections import defaultdict\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\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 main():\n dd = defaultdict(int)\n n = int(input())\n pri = factorization(n)\n res = 0\n i = len(pri)-1\n ans = 0\n\n for i in pri:\n k = i[1]\n i=1\n tmp=2\n cnt = 0\n while i<=k:\n i+=tmp\n tmp+=1\n cnt+=1\n ans+=cnt\n if len(pri)==1 and pri[0][1]==1:\n ans=1\n if n==1:\n ans = 0\n print(ans)\n\n\nif __name__ == '__main__':\n main()\n"] | ['Runtime Error', 'Accepted'] | ['s175993385', 's918542650'] | [9284.0, 9752.0] | [26.0, 113.0] | [232, 1051] |
p02660 | u686036872 | 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 factorizatio(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\nans = 0\nfor i in factorizatio(N):\n cnt = i[1]\n a = 0\n for j in range(1, cnt+1):\n a += j \n if a > cnt:\n break\n b += 1 \n ans += b\n\nprint(ans)', 'from collections import Counter\n\nN = 2\n\ndef 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\nc = Counter(prime(N))\n\nans = 0\nfor i in c.values():\n if i > 0:\n a = 0\n b = 0\n for j in range(1, i+1):\n a += j\n if a > i:\n break\n b += 1 \n ans += b\n\nprint(ans)', 'N = int(input())\nif N == 1:\n print(0)\nelse:\n ans = 0\n for i in range(2, int(N**0.5)+1):\n cnt = 0\n while N%i == 0:\n N /= i\n cnt += 1\n a = 0\n b = 0\n for j in range(1, cnt+1):\n a += j\n if a > cnt:\n break\n b += 1 \n ans += b\n\n if ans == 0:\n print(1)\n else:\n print(ans)', 'N = int(input())\n\nans = 0\nfor i in range(2, int(N**0.5)+1):\n cnt = 0\n while N%i == 0:\n N /= i\n cnt += 1\n a = 0\n b = 0\n for j in range(1, cnt):\n a += j\n if a > cnt:\n break\n b += 1\n \n ans += b\n\nprint(1 if ans==0 else ans)', 'N = int(input())\n\ndef factorizatio(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\nans = 0\nfor i in factorizatio(N):\n cnt = i[1]\n a = 0\n b = 0\n for j in range(1, cnt+1):\n a += j \n if a > cnt:\n break\n b += 1 \n ans += b', 'N = int(input())\n\nans = 0\nfor i in range(2, int(N**0.5)+1):\n cnt = 0\n while N%i == 0:\n N /= i\n cnt += 1\n a = 0\n b = 0\n for j in range(1, cnt+1):\n a += j\n if a > cnt:\n break\n b += 1 \n ans += b\n\nif N == 1:\n print(0)\nelif ans == 0:\n print(1)\nelse:\n print(ans)', 'N = int(input())\n\nif N == 1:\n print(0)\n\nelse:\n ans = 0\n for i in range(2, int(N**0.5)+1):\n cnt = 0\n while N%i == 0:\n N /= i\n cnt += 1\n a = 0\n b = 0\n for j in range(1, cnt+1):\n a += j\n if a > cnt:\n break\n b += 1 \n ans += b\n\n if ans == 0:\n print(1)\n else:\n print(ans)', 'from collections import Counter\n\nN = int(input())\n\ndef 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\nc = Counter(prime(N))\n\nans = 0\nfor i in c.values():\n if i > 0:\n a = 0\n for j in range(1, cnt+1):\n a += j\n if a > cnt:\n break\n b += 1 \n ans += b\n\nprint(ans)', 'N = int(input())\n\nans = 0\nfor i in range(2, int(N**0.5)+1):\n cnt = 0\n while N%i == 0:\n N /= i\n cnt += 1\n \n a = 0\n b = 0\n for j in range(1, cnt+1):\n a += j\n if a > cnt:\n break\n b += 1\n \n ans += b\n\nprint(0 N == 1 else 1 if ans==0 else ans)', 'N = int(input())\n\ndef factorizatio(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\nans = 0\nfor i in factorizatio(N):\n cnt = i[1]\n a = 0\n b = 0\n for j in range(1, cnt+1):\n a += j \n if a > cnt:\n break\n b += 1 \n ans += b\n\nprint(0 if N == 1 else ans)'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s072482097', 's075074350', 's125668991', 's303891453', 's553104362', 's606543274', 's693164381', 's892016219', 's981472250', 's261432613'] | [9492.0, 9400.0, 9460.0, 9456.0, 9492.0, 9460.0, 9460.0, 9464.0, 9064.0, 9500.0] | [102.0, 25.0, 163.0, 404.0, 110.0, 432.0, 156.0, 94.0, 25.0, 108.0] | [567, 544, 451, 290, 565, 332, 449, 545, 309, 594] |
p02660 | u686230543 | 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())\nprimes = dict()\np = 2\n\nwhile p * p < n:\n if n % p == 0:\n primes[p] = 0\n while n % p == 0:\n n //= p\n primes[p] += 1\n p += 1\nif p * p == n:\n primes[p] = 2\nelif n >= p:\n primes[n] = 1\n\ncount = 0\nfor e in primes.values():\n c = 1\n while e >= c:\n e -= c\n c += 1\n count += c\n \nprint(count)', 'n = int(input())\nprimes = dict()\np = 2\n\nwhile p * p < n:\n if n % p == 0:\n primes[p] = 0\n while n % p == 0:\n n //= p\n primes[p] += 1\n p += 1\nif p * p == n:\n primes[p] = 2\nelif n >= p:\n primes[n] = 1\n\ncount = 0\nfor e in primes.values():\n c = 1\n while c * (c + 1) // 2 <= e:\n c += 1\n count += c - 1\n \nprint(count)'] | ['Wrong Answer', 'Accepted'] | ['s597118896', 's236789362'] | [9204.0, 9148.0] | [267.0, 231.0] | [329, 337] |
p02660 | u688375653 | 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=one_int()\n\ntemp = factorization(N)\ntemp = sorted(temp, key= lambda x: x[0])\n\noutput_set = []\noutput = [ output_set + [t[0]]*t[1] for t in temp ]\n\n\ncount = 0\nfor i in output:\n temp = len(i)\n sums = 0\n for t in range(1,temp+1):\n sums += t\n if temp >= sums:\n count += 1\n\nprint(count)', 'def input_int():\n return map(int, input().split())\n\ndef one_int():\n return int(input())\n\ndef one_str():\n return input()\n\ndef many_int():\n return list(map(int, input().split()))\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\nN=one_int()\n\ntemp = factorization(N)\ntemp = sorted(temp, key= lambda x: x[0])\n\n# temp = [[2,9]]\n\n\n\noutput_set = []\noutput = [ output_set + [t[0]]*t[1] for t in temp ]\n\ncount = 0\nfor i in output:\n temp = len(i)\n sums = 0\n for t in range(1,temp+1):\n sums += t\n if temp >= sums:\n count += 1\n\nif N==1:\n print(0)\nelse:\n print(count)'] | ['Runtime Error', 'Accepted'] | ['s166144835', 's594469773'] | [9164.0, 9424.0] | [25.0, 114.0] | [669, 910] |
p02660 | u689710606 | 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\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: # 1\n print(0)\n exit()\n\nc = collections.Counter(prime_factorize(n))\n_, counts = zip(*c.most_common())\n\nl = list(counts)\nans = 0\n\nif l == [1]: \n print(1)\n exit()\n\nfor i in l:\n for j in range(1, i):\n if i >= j:\n i -= j\n ans += 1\n\nprint(ans)', 'import collections\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: # 1\n print(0)\n exit()\n\nc = collections.Counter(prime_factorize(n))\n_, counts = zip(*c.most_common())\n\nl = list(counts)\nans = 0\n\nfor i in l:\n x = 0\n for j in range(i):\n x += j + 1\n if i >= x:\n ans += 1\n else:\n break\n\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s329353165', 's672294596'] | [9460.0, 9376.0] | [99.0, 100.0] | [618, 604] |
p02660 | u692746605 | 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\na={}\nc=0\nwhile N%2==0:\n N//=2\n c+=1\nif c!=0:\n a[2]=c\n\nf,c=3,0\nwhile f*f<=N:\n if N%f==0:\n N//=f\n c+=1\n a[f]=c\n else:\n f+=2\n c=0\nif N!=1:\n if N in a:\n a[N]+=1\n else:\n a[N]=1\n\nt=0\nfor v in a.values():\n i=1\n while v>=i:\n t+=1\n i+=1\n v-=i\n\nprint(t)\n', 'N=int(input())\n\na={}\nc=0\nwhile N%2==0:\n N//=2\n c+=1\nif c!=0:\n a[2]=c\n\nf,c=3,0\nwhile f*f<=N:\n if N%f==0:\n N//=f\n c+=1\n a[f]=c\n else:\n f+=2\n c=0\nif N!=1:\n if N in a:\n a[N]+=1\n else:\n a[N]=1\n\nt=0\nfor v in a.values():\n i=1\n while v>=i:\n t+=1\n v-=i\n i+=1\n\nprint(t)\n'] | ['Wrong Answer', 'Accepted'] | ['s670266663', 's347368944'] | [9088.0, 9224.0] | [145.0, 133.0] | [299, 299] |
p02660 | u693025087 | 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. | ['# -*- coding: utf-8 -*-\n# map(int, input().split())\nimport math\n\nN = int(input())\nif N == 1:\n print(0)\n exit()\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\nfactors = factorization(N)\nprint(factors)\n\nresult = 0\nfor fact in factors:\n result += int((-1+math.sqrt(8*fact[1]+1))/2)\n\nprint(result)', '# -*- coding: utf-8 -*-\n# map(int, input().split())\nimport math\n\nN = int(input())\nif N == 1:\n print(0)\n exit()\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\nfactors = factorization(N)\n\nresult = 0\nfor fact in factors:\n result += int((-1+math.sqrt(8*fact[1]+1))/2)\n\nprint(result)'] | ['Wrong Answer', 'Accepted'] | ['s786748909', 's173658819'] | [9488.0, 9488.0] | [111.0, 113.0] | [610, 595] |
p02660 | u693173434 | 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())\ncount=0\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\nl=factorization(n) \nprint(l)\n\nfor i in range(len(l)):\n m=l[i]\n m2=m[1]\n a=1\n while m2>=a:\n count+=1\n m2-=a\n a+=1\n\nprint(count)\n', 'n=int(input())\ncount=0\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\nl=factorization(n) \n\nfor i in range(len(l)):\n m=l[i]\n m2=m[1]\n a=1\n while m2>=a:\n count+=1\n m2-=a\n a+=1\nif n==1:\n print(0)\nelse:\n print(count)\n'] | ['Wrong Answer', 'Accepted'] | ['s368062254', 's217137738'] | [9488.0, 9492.0] | [112.0, 111.0] | [537, 559] |
p02660 | u694649864 | 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. | ['\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\ndef has_duplicates2(seq):\n seen = []\n unique_list = [x for x in seq if x not in seen and not seen.append(x)]\n return len(seq) != len(unique_list)\n\nfact = prime_factorize(N)\nprint(fact)\nresult = 0\n\nif has_duplicates2(fact):\n \n chofuku = [x for x in set(fact) if fact.count(x) > 1]\n for i in chofuku:\n flag = True\n n = 1\n Count = fact.count(i) + 1\n while flag:\n if(1/2 * n * (n - 1) < Count <= 1/2 * n * (n + 1)):\n result += n-1\n flag = False\n else:\n n += 1\n \n \n NOTchofuku = len((list(set(fact)))) - len(chofuku)\n print(result + NOTchofuku)\nelse:\n print(len(fact))', '\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\ndef has_duplicates2(seq):\n seen = []\n unique_list = [x for x in seq if x not in seen and not seen.append(x)]\n return len(seq) != len(unique_list)\n\nfact = prime_factorize(N)\n# print(fact)\nresult = 0\n\nif has_duplicates2(fact):\n \n chofuku = [x for x in set(fact) if fact.count(x) > 1]\n for i in chofuku:\n flag = True\n n = 1\n Count = fact.count(i)\n print(Count)\n while flag:\n if Count == 2:\n result += 1\n flag = False\n elif(1/2 * n * (n - 1) < Count <= 1/2 * n * (n + 1)):\n result += n\n flag = False\n else:\n n += 1\n \n \n NOTchofuku = len((list(set(fact)))) - len(chofuku)\n print(result + NOTchofuku)\nelse:\n print(len(fact))', '\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\ndef has_duplicates2(seq):\n seen = []\n unique_list = [x for x in seq if x not in seen and not seen.append(x)]\n return len(seq) != len(unique_list)\n\nfact = prime_factorize(N)\n# print(fact)\nresult = 0\n\nif has_duplicates2(fact):\n \n chofuku = [x for x in set(fact) if fact.count(x) > 1]\n for i in chofuku:\n flag = True\n n = 1\n Count = fact.count(i) + 1\n while flag:\n if(1/2 * n * (n - 1) < Count <= 1/2 * n * (n + 1)):\n result += n-1\n flag = False\n else:\n n += 1\n \n \n NOTchofuku = len((list(set(fact)))) - len(chofuku)\n print(result + NOTchofuku)\nelse:\n print(len(fact))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s026728322', 's789316082', 's615933580'] | [9296.0, 9288.0, 9276.0] | [93.0, 91.0, 91.0] | [1059, 1162, 1061] |
p02660 | u699008198 | 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() )\nA = []\nB = []\n\nfor i in range( n ):\n a, b = map( int, input().split() )\n A.append( a )\n B.append( b )\n\nA = sorted( A )\nB = sorted( B )\n\nif n % 2 == 0:\n i = n // 2\n print(( B[ i ] + B[ i - 1 ] ) - ( A[ i ] + A [ i - 1 ] ) + 1 )\nelse:\n i = ( n + 1 ) // 2 - 1\n print( B[ i ] - A[ i ] + 1 )\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\nn = int( input() )\nfact = factorization( n )\ncnt = 0\nfor f in fact:\n if f[0] == 1:\n continue\n i = 1\n while True:\n f[1] -= i\n i += 1\n if f[1] < 0:\n break\n cnt += 1\nprint( cnt )'] | ['Runtime Error', 'Accepted'] | ['s363171480', 's750300377'] | [9196.0, 9488.0] | [23.0, 110.0] | [313, 550] |
p02660 | u699944218 | 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 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\nA = prime_factorize(N)\nB = list(set(A))\nlb = len(B)\nC = [[] for _ in range(lb)]\nD = [0 for _ in range(lb)]\nfor i in range(lb):\n C[i] = [a for a in A if a == B[i]]\n D[i] = len(C[i])\nans = []\nfor j in range(len(D)):\n for i in range(1,D[j]):\n if D[j] - i < 0:\n break\n ans.append(D[j] - i)\nprint(A)\nprint(D)\nprint(ans)\nif len(D) == 0 and len(ans) == 0:\n print(0)\nelif len(D) == 1 and len(ans) == 0:\n print(1)\nelse:\n print(sum(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 \n\nN = int(input())\nS = []\nfac = factorization(N)\nfor i in range(len(fac)):\n S.append(fac[i][1])\nans = 0\nfor i in range(len(S)):\n for j in range(1,S[i] + 1):\n if S[i] - j <= 0:\n break\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 \n\nN = int(input())\nS = []\nif N == 1:\n print(0)\n exit(0)\nfac = factorization(N)\nfor i in range(len(fac)):\n S.append(fac[i][1])\nans = 0\nfor i in range(len(S)):\n for j in range(1,S[i] + 1):\n if S[i] - j < 0:\n break\n ans += 1\n S[i] -= j\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s142423466', 's887721228', 's558116812'] | [9184.0, 9492.0, 9504.0] | [93.0, 109.0, 110.0] | [736, 570, 615] |
p02660 | u701893485 | 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 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\nif __name__=="__main__":\n N = int(input())\n count = 0\n counter = collections.Counter(prime_factorize(N))\n output = 0\n for prime in counter:\n num_prime = 1\n count = 1\n while True:\n if counter[prime] >= wa:\n output += 1\n count += 1\n num_prime += count\n else:\n break\n print(output)', '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\n\nif __name__=="__main__":\n N = int(input())\n count = 0\n counter = collections.Counter(prime_factorize(N))\n output = 0\n for prime in counter:\n num_prime = 1\n count = 1\n while True:\n if counter[prime] >= num_prime:\n output += 1\n count += 1\n num_prime += count\n else:\n break\n print(output)\n\n'] | ['Runtime Error', 'Accepted'] | ['s297986169', 's863884360'] | [9464.0, 9464.0] | [93.0, 91.0] | [691, 700] |
p02660 | u714410759 | 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_factorizations(n):\n """\n [summary]\n\n Parameters\n ----------\n n : int\n the number factorized by prime numbers.\n\n Returns\n -------\n dict[int: int]\n prime and exponent pair\n ex.) if n == 40, the function return {2:3, 5:1} \n """ \n root_n = int( n**(1/2) )\n primes = {2:0}\n primes.update({i:0 for i in range(3, root_n+1, 2)})\n for i in primes.keys():\n if n == 1:\n primes = {i: v for i, v in primes.items() if v > 0}\n return primes\n \n exponent = 0\n while n % i == 0:\n n //= i\n exponent += 1\n # store the prime and exponent\n primes[i] = exponent\n\n primes = {i: v for i, v in primes.items() if v > 0}\n if len(primes) == 0:\n return {n: 1}\n return primes\n\nn = int(input())\nif n == 1:\n print(0)\nelse:\n primes = get_prime_factorizations(n)\n print(primes)\n result = 0\n for exponent in primes.values():\n count = 0\n while exponent - count > 0:\n count += 1\n exponent -= count\n result += count\n print(result)\n', 'def get_prime_factorizations(n):\n root_n = int( n**(1/2) )\n primes = {2:0}\n primes.update({i:0 for i in range(3, root_n+1, 2)})\n for i in primes.keys():\n if n == 1:\n primes = {i: v for i, v in primes.items() if v > 0}\n return primes\n \n exponent = 0\n while n % i == 0:\n n //= i\n exponent += 1\n # store the prime and exponent\n primes[i] = exponent\n\n primes = {n: 1}\n return primes\n\nn = int(input())\nif n == 1:\n print(0)\nelse:\n primes = get_prime_factorizations(n)\n result = 0\n for exponent in primes.values():\n count = 0\n while exponent - count > 0:\n count += 1\n exponent -= count\n result += count\n print(result)\n', 'def get_prime_factorizations(n):\n """\n [summary]\n\n Parameters\n ----------\n n : int\n the number factorized by prime numbers.\n\n Returns\n -------\n dict[int: int]\n prime and exponent pair\n ex.) if n == 40, the function return {2:3, 5:1} \n """ \n root_n = int( n**(1/2) )\n primes = {2:0}\n primes.update({i:0 for i in range(3, root_n+1, 2)})\n for i in primes.keys():\n if n == 1:\n primes = {i: v for i, v in primes.items() if v > 0}\n return primes\n \n exponent = 0\n while n % i == 0:\n n //= i\n exponent += 1\n # store the prime and exponent\n primes[i] = exponent\n\n primes = {i: v for i, v in primes.items() if v > 0}\n\n if n!=1:\n primes[n] = 1\n\n if len(primes) == 0:\n return {n: 1}\n return primes\n\nn = int(input())\nif n == 1:\n print(0)\nelse:\n primes = get_prime_factorizations(n)\n result = 0\n for exponent in primes.values():\n count = 0\n while exponent - count > 0:\n count += 1\n exponent -= count\n result += count\n print(result)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s011310783', 's761100030', 's294333563'] | [66096.0, 66000.0, 65968.0] | [191.0, 168.0, 190.0] | [1151, 791, 1170] |
p02660 | u714732628 | 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())\nli = []\nif n==1:\n print(0)\nelse:\n for i in range(1000000):\n if n==1:\n break\n if i==0 or i==1 or n%i!=0:\n continue\n j = i\n cnt = 0\n while(n%j==0):\n if flg==0:\n flg = 1\n n /= j\n cnt += 1\n li.append(cnt)\n if flg==0:\n print(1)\n else:\n ans = 0\n for e in li:\n i = 1\n while(e-i>=0):\n e -= i\n i += 1\n ans += 1\n print(ans)', 'n = int(input())\nif n==1:\n print(0)\nelse:\n cnt = 0\n flg = 0\n for i in range(1000000):\n if n<i:\n break\n if i==0 or i==1 or n%i!=0:\n continue\n j = i\n while(n%j==0):\n if flg==0:\n flg = 1\n n /= j\n j *= i\n cnt += 1\n\n\n if flg==0:\n print(1)\n else:\n print(cnt)', 'n = int(input())\nli = []\nflg = 0\nfor i in range(1000000):\n if n==1:\n break\n if i==0 or i==1 or n%i!=0:\n continue\n j = i\n cnt = 0\n while(n%j==0):\n print(n)\n print(j)\n if flg==0:\n flg = 1\n n /= j\n cnt += 1\n li.append(cnt)\nif flg==0 and n!=1:\n print(1)\nelif flg==0 and n==1:\n print(0)\nelif n==1:\n ans = 0\n for e in li:\n i = 1\n while(e-i>=0):\n e -= i\n i += 1\n ans += 1\n print(ans)\nelse:\n ans = 1\n for e in li:\n i = 1\n while(e-i>=0):\n e -= i\n i += 1\n ans += 1\n print(ans)', 'n = int(input())\nli = []\nflg = 0\nfor i in range(1000000):\n if n==1:\n break\n if i==0 or i==1 or n%i!=0:\n continue\n j = i\n cnt = 0\n while(n%j==0):\n if flg==0:\n flg = 1\n n /= j\n cnt += 1\n li.append(cnt)\nif flg==0 and n!=1:\n print(1)\nelif n==1:\n print(0)\nelse:\n ans = 0\n for e in li:\n i = 1\n while(e-i>=0):\n e -= i\n i += 1\n ans += 1\n print(ans)', 'n = int(input())\nli = []\nflg = 0\nfor i in range(1000000):\n if n==1:\n break\n if i==0 or i==1 or n%i!=0:\n continue\n j = i\n cnt = 0\n while(n%j==0):\n if flg==0:\n flg = 1\n n /= j\n cnt += 1\n li.append(cnt)\nif flg==0 and n!=1:\n print(1)\nelif flg==0 and n==1:\n print(0)\nelif n==1:\n ans = 0\n for e in li:\n i = 1\n while(e-i>=0):\n e -= i\n i += 1\n ans += 1\n print(ans)\nelse:\n ans = 1\n for e in li:\n i = 1\n while(e-i>=0):\n e -= i\n i += 1\n ans += 1\n print(ans)'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s255200434', 's340357818', 's638074896', 's841095493', 's963475672'] | [9172.0, 9020.0, 9300.0, 9264.0, 9304.0] | [216.0, 23.0, 237.0, 249.0, 248.0] | [427, 315, 548, 392, 522] |
p02660 | u715912777 | 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\nfrom itertools import combinations\nimport numpy as np\n\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\n\ndef factorize(n):\n b = 2\n fct = []\n while b * b <= n:\n while n % b == 0:\n n //= b\n fct.append(b)\n b = b + 1\n if n > 1:\n fct.append(n)\n return fct\n\ndef get_list(counter, index):\n ans = []\n for key, val in sorted(counter.items()):\n if val > index:\n ans += [key] * index\n else:\n ans += [key] * val\n return ans\n\ndef choice_min_data(counter, min_num):\n temp = sum(counter.values())\n temp_min_num = 10**12\n co_li = None\n for index in range(1, temp+1):\n flag = False\n to_comb_list = get_list(counter, index)\n for co in combinations(to_comb_list, index):\n check_val = np.prod(co)\n if temp_min_num > check_val > min_num:\n co_li = co\n temp_min_num = check_val\n flag = True\n break\n\n \n if temp_min_num is not None and flag == False:\n break\n\n if co_li is None:\n return None, -1\n else:\n # print(co_li, temp_min_num)\n return counter - Counter(co_li), temp_min_num\n\ndef main():\n \n \n \n \n \n N = int(input())\n\n if N <= 1:\n print(0)\n return\n\n counter = Counter(factorize(N))\n # print(counter)\n ans = 0\n min_num = 0\n while counter is not None:\n counter, min_num = choice_min_data(counter, min_num)\n if min_num == -1:\n break\n ans += 1\n \n print(ans)\n\nif __name__ == "__main__":\n main()\n', 'from collections import Counter\nfrom itertools import combinations\nimport numpy as np\n\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\ndef get_list(counter, index):\n ans = []\n for key, val in sorted(counter.items()):\n if val >= index:\n ans.append(key)\n return ans\n\ndef choice_min_data(counter, min_num):\n temp = sum(counter.values())\n temp_min_num = 10**12\n co_index = None\n for index in range(1, temp+1):\n \n exp_list = get_list(counter, index)\n # print(exp_list)\n if not exp_list:\n break\n for ex in exp_list:\n ex_2 = ex ** index\n if temp_min_num > ex_2 > min_num:\n co_index = [ex, index]\n temp_min_num = ex_2\n \n break\n\n \n # if co_index is not None and flag == False:\n # break\n\n if co_index is None:\n return None, -1\n else:\n # print(co_index, temp_min_num)\n counter[co_index[0]] -= co_index[1]\n return counter, temp_min_num\n\ndef main():\n \n \n \n \n \n N = int(input())\n\n if N <= 1:\n print(0)\n return\n\n counter = Counter(prime_factorize(N))\n # print(counter)\n ans = 0\n min_num = 0\n while counter is not None:\n counter, min_num = choice_min_data(counter, min_num)\n if min_num == -1:\n break\n ans += 1\n \n print(ans)\n\nif __name__ == "__main__":\n main()\n'] | ['Wrong Answer', 'Accepted'] | ['s544078083', 's055942774'] | [27280.0, 27168.0] | [245.0, 180.0] | [2145, 1923] |
p02660 | u723583932 | 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. | ['\nn=int(input())\nbunkai=[]\n\ndef different_value(e):\n cnt=0\n i=1\n while e-i>=0:\n e-=i\n i+=1\n cnt+=1\n return cnt\n\ndef soinsuu(x):\n for i in range(2,int((n+1)**0.5)+1):\n cnt=0\n while x%i==0:\n x//=i\n cnt+=1\n if cnt==0:\n continue\n bunkai.append([i,cnt])\n if bunkai==[]:\n bunkai.append([n,1])\nsoinsuu(n)\n\nans=0\nfor num,e in bunkai:\n ans+=different_value(e)\nif n==1:\n ans=0\nprint(ans)\nprint(bunkai)', '\nn=int(input())\nbunkai=[]\n\ndef different_value(e):\n cnt=0\n i=1\n while e-i>=0:\n e-=i\n i+=1\n cnt+=1\n return cnt\n\ndef soinsuu(x):\n for i in range(2,int((n+1)**0.5)+1):\n cnt=0\n while x%i==0:\n x//=i\n cnt+=1\n if cnt==0:\n continue\n bunkai.append([i,cnt])\n if bunkai==[]:\n bunkai.append([n,1])\nsoinsuu(n)\n\nans=0\nfor num,e in bunkai:\n ans+=different_value(e)\nif n==1:\n ans=0\nprint(ans)\nprint(bunkai)', '\nn=int(input())\nbunkai=[]\n\ndef different_value(e):\n cnt=0\n i=1\n while e-i>=0:\n e-=i\n i+=1\n cnt+=1\n return cnt\n\ndef soinsuu(x):\n for i in range(2,int(n**0.5)+1):\n cnt=0\n while x%i==0:\n x//=i\n cnt+=1\n if cnt==0:\n continue\n bunkai.append([i,cnt])\n if x!=1:\n bunkai.append([n,1])\nsoinsuu(n)\n\nans=0\nfor num,e in bunkai:\n ans+=different_value(e)\n\nprint(ans)\n\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s069845198', 's476253723', 's501405044'] | [9352.0, 9352.0, 9476.0] | [130.0, 127.0, 127.0] | [575, 575, 549] |
p02660 | u724844363 | 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 Pf(n):\n l = {}\n if n == 1:\n return 0\n else:\n i = 2\n tnp = 0\n while n > 1 and i < int(n**0.5)+1:\n if n % i == 0:\n tnp += 1\n n //= i\n else:\n l[i] = tnp\n tnp = 0\n i += 1\n l[i] = tnp\n return l\n\n\ndef f(x): \n if x == 0:\n return 0\n elif 1 <= x <= 2:\n return 1\n elif 3 <= x <= 5:\n return 2\n elif 6 <= x <= 9:\n return 3\n elif 10 <= x <= 14:\n return 4\n elif 15 <= x <= 20:\n return 5\n elif 21 <= x <= 27:\n return 6\n elif 28 <= x <= 35:\n return 7\n else:\n return 8\n\n\nif n == 1:\n print(0)\n quit()\n\ninfo = Pf(n).values()\n# print(info)\nans = 0\nfor i in info:\n ans += f(i)\n\nprint(ans)', 'import collections\n\n\ndef f(x): \n if x == 0:\n return 0\n elif 1 <= x <= 2:\n return 1\n elif 3 <= x <= 5:\n return 2\n elif 6 <= x <= 9:\n return 3\n elif 10 <= x <= 14:\n return 4\n elif 15 <= x <= 20:\n return 5\n elif 21 <= x <= 27:\n return 6\n elif 28 <= x <= 35:\n return 7\n elif 36 <= x <= 44:\n return 8\n else:\n return 9\n\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\nif n == 1:\n print(0)\n quit()\n\nc = collections.Counter(prime_factorize(n))\ncl = c.values()\n\nans = 0\nfor i in cl:\n ans += f(i)\n\nif ans == 0:\n print(1)\nelse:\n print(ans)'] | ['Wrong Answer', 'Accepted'] | ['s682475231', 's613155870'] | [92996.0, 9492.0] | [636.0, 90.0] | [864, 917] |
p02660 | u726284577 | 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\nn=int(input())\nans=0\nd=1\nm=0\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\nc=collections.Counter(prime_factorize(n))\nfor i in range(len(list(c.values()))):\n while d*(d+1)/2<list(c.values())[i]+1:\n if m<=d:\n m=d\n d+=1\n print(m)\n if d*(d+1)/2>=list(c.values())[i]+1:\n ans+=m\n d=1\n m=0\nprint(ans)', 'import collections\nn=int(input())\nans=0\nd=1\nm=0\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\nc=collections.Counter(prime_factorize(n))\nfor i in range(len(list(c.values()))):\n while d*(d+1)/2<list(c.values())[i]+1:\n if m<=d:\n m=d\n d+=1\n if d*(d+1)/2>=list(c.values())[i]+1:\n ans+=m\n d=1\n m=0\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s497260612', 's690815667'] | [9428.0, 9412.0] | [95.0, 92.0] | [607, 586] |
p02660 | u731603651 | 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())\ndiv = 2\nres = 0\nm = int(math.sqrt(n))\nwhile div < m:\n cnt = 0\n if ((n // div) * div != n):\n div += 1\n continue\n while (n // div) * div == n:\n cnt += 1\n n = n // div\n #print(div, cnt)\n tmp = 1\n while tmp < cnt:\n res += 1\n cnt -= tmp\n tmp += 1\n if (n == 1):\n div = m\n div += 1\nprint(res+1*(n != 1))\n', 'import math\nn = int(input())\ndiv = 2\nres = 0\nm = int(math.sqrt(n))\nwhile div < m:\n cnt = 0\n if ((n // div) * div != n):\n div += 1\n continue\n while (n // div) * div == n:\n cnt += 1\n n = n // div\n #print(div, cnt)\n tmp = 1\n while tmp <= cnt:\n res += 1\n cnt -= tmp\n tmp += 1\n if (n == 1):\n div = m\n div += 1\nprint(res+1*(n != 1))\n'] | ['Wrong Answer', 'Accepted'] | ['s492894831', 's621364968'] | [9192.0, 9136.0] | [262.0, 273.0] | [406, 407] |
p02660 | u731807761 | 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\n#import copy\n\n\ndef xnxn(n=0):\n """\n args:\n int n: a number of lows to read\n example:\n input 1\n retrun 1\n\n input 1 2 3\n return [1,2,3]\n input 1 2 3\n 4\n return [[1,2,3],\n [4]]\n """\n if n == 0:\n temp = list(map(int, input().split()))\n if len(temp) == 1:\n return temp[0]\n elif len(temp) > 1:\n return temp\n else:\n temp = [list(map(int, input().split())) for _ in range(n)]\n return temp\n\n\ndef sp_xnxn(n=0):\n """\n args:\n int n: a number of lows to read\n example\n input 1\n retrun [1]\n\n input 123\n return [1,2,3]\n\n input 123\n 4\n return [[1,2,3],\n [4]]\n """\n if n == 0:\n return [int(k) for k in xsxs()]\n else:\n return [[int(k) for k in xsxs()] for _ in range(n)]\n\n\ndef xsxs(n=0):\n """\n args:\n int n: a number of lows to read\n example:\n input AA\n retrun AA\n\n input A BBB CC\n return ["A","BBB","CC"]\n\n input A BB CCC\n D\n return [["A","BBB","CC"],\n ["D"]]\n """\n if n == 0:\n temp = list(input().split())\n if len(temp) == 1:\n return temp[0]\n elif len(temp) > 1:\n return temp\n else:\n return [list(input().split()) for _ in range(n)]\n\n\ndef sp_xsxs(n=0):\n """\n args:\n int n: a number of lows to read\n example:\n input A\n retrun ["A"]\n\n input ABC\n return ["A","B","C"]\n\n input ABC\n D\n return [["A","B","C"],\n ["D"]]\n """\n if n == 0:\n return [s for s in xsxs()]\n else:\n return [[s for s in xsxs()] for _ in range(n)]\n\n\ndef p_num(a):\n\n if a == 1:\n return [[a, 1]]\n else:\n tmp = 2\n ans = []\n while tmp < np.sqrt(a) + 1:\n n = 0\n p = [tmp]\n while a % tmp == 0:\n a = int(a / tmp)\n # p.append(tmp)\n n += 1\n if n != 0:\n p.append(n)\n ans.append(p)\n tmp += 1\n if n == 0:\n ans.append([a, 1])\n return ans\n\n\nn = xnxn()\n\nif n == 1:\n print(0)\n sys.exit()\nelse:\n a = p_num(n)\n c = 0\n for num in a:\n i = 1\n while n % (num[0]**i) == 0:\n n = n/(num[0]**i)\n i += 1\n c += 1\n print(c)\n', 'import numpy as np\ndef p_num_edit(n):\n tmp = n\n ans = []\n for i in range(2, int(np.sqrt(n)) + 1):\n cnt = 0\n while tmp % i == 0:\n cnt += 1\n tmp = int(tmp / i)\n if cnt > 0:\n ans.append([i, cnt])\n if tmp != 1:\n ans.append([tmp, 1])\n if ans == []:\n ans.append([n, 1])\n return ans\n\n\nn = xnxn()\n\nif n == 1:\n print(0)\n sys.exit()\nelse:\n a = p_num_edit(n)\n c = 0\n for num in a:\n i = 1\n while num[1] - i > -1:\n num[1] -= i\n i += 1\n c += 1\n print(c)\n', 'import numpy as np\nimport sys\n#import copy\n\n\ndef xnxn(n=0):\n """\n args:\n int n: a number of lows to read\n example:\n input 1\n retrun 1\n\n input 1 2 3\n return [1,2,3]\n input 1 2 3\n 4\n return [[1,2,3],\n [4]]\n """\n if n == 0:\n temp = list(map(int, input().split()))\n if len(temp) == 1:\n return temp[0]\n elif len(temp) > 1:\n return temp\n else:\n temp = [list(map(int, input().split())) for _ in range(n)]\n return temp\n\n\ndef sp_xnxn(n=0):\n """\n args:\n int n: a number of lows to read\n example\n input 1\n retrun [1]\n\n input 123\n return [1,2,3]\n\n input 123\n 4\n return [[1,2,3],\n [4]]\n """\n if n == 0:\n return [int(k) for k in xsxs()]\n else:\n return [[int(k) for k in xsxs()] for _ in range(n)]\n\n\ndef xsxs(n=0):\n """\n args:\n int n: a number of lows to read\n example:\n input AA\n retrun AA\n\n input A BBB CC\n return ["A","BBB","CC"]\n\n input A BB CCC\n D\n return [["A","BBB","CC"],\n ["D"]]\n """\n if n == 0:\n temp = list(input().split())\n if len(temp) == 1:\n return temp[0]\n elif len(temp) > 1:\n return temp\n else:\n return [list(input().split()) for _ in range(n)]\n\n\ndef sp_xsxs(n=0):\n """\n args:\n int n: a number of lows to read\n example:\n input A\n retrun ["A"]\n\n input ABC\n return ["A","B","C"]\n\n input ABC\n D\n return [["A","B","C"],\n ["D"]]\n """\n if n == 0:\n return [s for s in xsxs()]\n else:\n return [[s for s in xsxs()] for _ in range(n)]\n\n\ndef p_num(a):\n\n if a == 1:\n return [[a, 1]]\n else:\n tmp = 2\n ans = []\n while tmp < np.sqrt(a) + 1:\n n = 0\n p = [tmp]\n\n while a % tmp == 0:\n a = int(a / tmp)\n # p.append(tmp)\n n += 1\n c = 1\n if n != 0:\n p.append(n)\n ans.append(p)\n tmp += 1\n c = 0\n if c == 0 and a != 1:\n ans.append([a, 1])\n return ans\n\n\ndef p_num_edit(n):\n tmp = n\n ans = []\n for i in range(2, int(np.sqrt(n)) + 1):\n cnt = 0\n while tmp % i == 0:\n cnt += 1\n tmp = int(tmp / i)\n if cnt > 0:\n ans.append([i, cnt])\n if tmp != 1:\n ans.append([tmp, 1])\n if ans == []:\n ans.append([n, 1])\n return ans\n\n\nn = xnxn()\n\nif n == 1:\n print(0)\n sys.exit()\nelse:\n a = p_num_edit(n)\n c = 0\n for num in a:\n i = 1\n while num[1] - i > -1:\n num[1] -= i\n i += 1\n c += 1\n print(c)\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s249930019', 's251205634', 's589396541'] | [27128.0, 27096.0, 27168.0] | [1717.0, 112.0, 214.0] | [2622, 591, 3013] |
p02660 | u734195782 | 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\ndef check(n):\n count = 0\n end = int(math.sqrt(n)+1)\n for i in range(2,end):\n if n%i==0:\n count += 1\n n/=i\n if n%i==0:\n l = 2\n count2 = 0\n while n%i==0:\n n/=i\n count2+=1\n if count2==l:\n count+=1\n count2=0\n l+=1\n if n==1:\n return 0\n if count==0:\n return 1\n else:\n return count \nn = int(input())\nans = check(n)\nprint(ans)', 'import math\ndef check(n):\n count = 0\n end = int(math.sqrt(n)+1)\n for i in range(2,end):\n if n%i==0:\n count += 1\n n/=i\n if n%i==0:\n l = 2\n count2 = 0\n while n%i==0:\n n/=i\n count2+=1\n if count2==l:\n count+=1\n count2=0\n l+=1\n if n==1:\n return count\n if n==1:\n return 0\n if count==0:\n return 1\n else:\n return count+1 \nn = int(input())\nans = check(n)\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s308421491', 's925649010'] | [9280.0, 9224.0] | [209.0, 217.0] | [542, 586] |
p02660 | u736729525 | 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. | ['\nanswer = 0\n\ndef prime(N):\n f = []\n c = 0\n r = int(N**0.5)\n for i in range(2, r+2):\n while N % i == 0:\n c+= 1\n N = N //i\n if c != 0:\n f.append((i,c))\n c = 0\n if N!=1:\n f.append((N,1))\n return f\nN = int(input())\nimport sys\nA = []\na = 0\nf = prime(N)\nfor p, c in f:\n for i in range(1, c+1):\n if c > 0 and N >=p**i:\n print(p**i)\n c -= i\n N //= p**i\n A.append(p**i)\n a += 1\nc = 1\nfor x in A:\n c *= x\nprint(a)\n', 'def prime(N):\n f = []\n c = 0\n r = int(N**0.5)\n for i in range(2, r+2):\n while N % i == 0:\n c+= 1\n N = N //i\n if c != 0:\n f.append((i,c))\n c = 0\n if N!=1:\n f.append((N,1))\n return f\n\ndef solve(N):\n import sys\n #print(N, file=sys.stderr)\n org = N\n A = []\n a = 0\n f = prime(N)\n for p, c in f:\n for i in range(1, c+1):\n z = p ** i\n if c > 0 and N >=z and N %z == 0:\n c -= i\n #print(N, p**i)\n N //= z\n A.append(z)\n a += 1\n return a, A\n\ndef primes():\n primes = [2]\n for i in range(3, 10**5+1, 2):\n if all(i % p != 0 for p in primes):\n primes.append(i)\n return primes\n\ndef test():\n def primes():\n with open("primes.txt", "r") as f:\n return [int(x) for x in f.readline().split()]\n primes = primes()\n for N in range(1, 10**5+1):\n org = N\n a0, A = solve(N)\n a1 = 0\n B = []\n for p in primes:\n for i in range(1, 10**16):\n z = p ** i\n if N < z:\n break\n if N % z == 0:\n N //= z\n a1 += 1\n B.append(z)\n if a0 != a1:\n print("NG on", org, "actual=%d"%a0, A, "expect=%d"%a1, B)\n break\n\n#test()\nN = int(input())\nprint(solve(N)[0])\n'] | ['Wrong Answer', 'Accepted'] | ['s273834931', 's478706858'] | [9488.0, 9572.0] | [124.0, 125.0] | [555, 1512] |
p02660 | u752115287 | 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\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\na = collections.Counter(prime_factorize(n))\n\nres = 0\n\nif n != 1:\n for i in a.items():\n print(i)\n if i[1] > 3:\n res += int(i[1]/2)\n elif i[1] == 3:\n res += 2\n else:\n res += 1\nelse:\n res = 1\n\nprint(res) \n\n\n', 'import collections\nimport math\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\na = collections.Counter(prime_factorize(n))\n\nres = 0\n\nfor i in a.items():\n if i[1] > 3:\n x = 2\n y = 3\n while True:\n x += 1\n y = y + x\n if y > i[1]:\n res += x - 1\n break\n elif i[1] == 3:\n res += 2\n else:\n res += 1\n\nprint(res) \n\n\n'] | ['Wrong Answer', 'Accepted'] | ['s017998619', 's206773726'] | [9492.0, 9484.0] | [92.0, 93.0] | [586, 662] |
p02660 | u756311765 | 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\nN = int(input())\nN = factorization(N)\ncount = 0\nfor i in range(0,len(N)):\n print(i)\n t = 0\n for j in range(1,N[i][1]+1):\n t += j\n if N[i][1] == t:\n count += j\n break\n elif N[i][1] < t:\n count += j-1\n break\n else:\n pass\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\nN = int(input())\nN = factorization(N)\ncount = 0\n\nif N[0][0] == 1:\n print(0)\nelse:\n for i in range(0,len(N)):\n t = 0\n for j in range(1,N[i][1]+1):\n t += j\n if N[i][1] == t:\n count += j\n break\n elif N[i][1] < t:\n count += j-1\n break\n else:\n pass\n print(count)\n \n '] | ['Wrong Answer', 'Accepted'] | ['s371306882', 's105488157'] | [9508.0, 9504.0] | [110.0, 111.0] | [675, 773] |
p02660 | u761638117 | 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\nimport 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 \n\nc = collections.Counter(prime_factorize(N))\n\nA = c.keys()\ncount = c.values()\n\nans = 0\n\nfor i in count:\n k = 0\n for j in range(1,i):\n k += j\n if k <= i:\n ans += 1\nprint(ans)', '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 \n\nc = collections.Counter(prime_factorize(N))\n\nA = c.keys()\ncount = c.values()\n\nans = 0\n\nfor i in count:\n k = 0\n for j in range(1,i):\n k += j\n if k <= i:\n ans += 1\nprint(ans)', 'N = int(input())\n\nimport 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 \n\nc = collections.Counter(prime_factorize(N))\n\nA = c.keys()\ncount = c.values()\n\nans = 0\n\nfor i in count:\n k = 0\n for j in range(1,i+1):\n k += j\n if k <= i:\n ans += 1\n \nprint(ans)\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s443698458', 's709177179', 's843311783'] | [9484.0, 9404.0, 9464.0] | [97.0, 24.0, 96.0] | [500, 482, 510] |
p02660 | u762540523 | 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 functools import lru_cache\n\n\ndef PrimeFactorization(m):\n pf = {}\n i = 2\n while i ** 2 < n:\n while n % i == 0:\n pf[i] = pf.get(i, 0) + 1\n n //= i\n i += 1\n if n > 1:\n pf[n] = 1\n return pf\n\n\n@lru_cache(maxsize=100000)\ndef f(x):\n return int((-1 + (1 + 8 * x) ** 0.5) // 2 + 0.001)\n\n\ndef resolve():\n n = int(input())\n d = PrimeFactorization(n)\n ans = 0\n for v in d.values():\n ans += f(v)\n print(ans)\n\n\nif __name__ == '__main__':\n resolve()\n", "from functools import lru_cache\n\n\ndef PrimeFactorization(n):\n pf = {}\n i = 2\n while i ** 2 < n:\n while n % i == 0:\n pf[i] = pf.get(i, 0) + 1\n n //= i\n i += 1\n if n > 1:\n pf[n] = 1\n return pf\n\n\n@lru_cache(maxsize=100000)\ndef f(x):\n return int((-1 + (1 + 8 * x) ** 0.5) // 2 + 0.001)\n\n\ndef resolve():\n n = int(input())\n d = PrimeFactorization(n)\n ans = 0\n for v in d.values():\n ans += f(v)\n print(ans)\n\n\nif __name__ == '__main__':\n resolve()\n"] | ['Runtime Error', 'Accepted'] | ['s444995740', 's100537940'] | [9572.0, 9752.0] | [25.0, 316.0] | [526, 526] |
p02660 | u763534217 | 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\narr = factorization(n) \nprint(arr)\n\ncnt = 0\nfor ar in arr:\n i = 1\n while ar[1]>0:\n cnt+=1\n ar[1]-=i\n i+=1\nprint(cnt)\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\nn = int(input())\n\narr = factorization(n) \nprint(arr)\n\ncnt = 0\nfor ar in arr:\n i = 1\n while 1:\n ar[1]-=i\n if ar[1] < 0:\n break\n cnt += 1\n i+=1\nprint(cnt)\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\nn = int(input())\n\narr = factorization(n) \nprint(arr)\n\ncnt = 0\nif n == 1:\n pass\nelse:\n for ar in arr:\n i = 1\n while 1:\n ar[1]-=i\n if ar[1] < 0:\n break\n cnt += 1\n i+=1\nprint(cnt)\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 \nn = int(input())\n \narr = factorization(n) \n# print(arr)\n \ncnt = 0\nif n == 1:\n pass\nelse:\n for ar in arr:\n i = 1\n while 1:\n ar[1]-=i\n if ar[1] < 0:\n break\n cnt += 1\n i+=1\nprint(cnt)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s368478574', 's586911023', 's657308295', 's768120212'] | [9484.0, 9484.0, 9484.0, 9496.0] | [111.0, 109.0, 109.0, 111.0] | [515, 551, 609, 616] |
p02660 | u763550415 | 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())\nMax = 10**6\ncount = 0\n\ndef sosu(x):\n for i in range(2,int(math.sqrt(n))+1):\n if n % i == 0:\n return False\n return True\n\nif sosu(n):\n print(count +1)\n exit()\n\nalst = [0] * Max\nalst[0] = 2\nalst[1] = 1\nfor i in range(2,Max):\n for j in range(i, Max, i):\n alst[j] += 1\n if alst[j] >= 2:\n alst[j] = 2\n break\n\nPrime = []\nfor i in range(1,Max):\n if alst[i] == 1:\n Prime.append(int(i))\n\np = len(Prime)\nPF = [0]*Max\n\n\nfor i in range(1,p):\n if n%Prime[i] == 0:\n for j in range(20,1,-1):\n if n%Prime[i]**j == 0:\n count += 1\n PF[i] = j\n n = n / Prime[i]\n if sosu(n):\n print(count + 1)\n exit()\n \nprint(count)\n', 'import math\n\nn = int(input())\nMax = 10**6\ncount = 0\n\ndef sosu(x):\n for i in range(2,int(math.sqrt(n))+1):\n if n % i == 0:\n return False\n return True\n\nif sosu(n):\n print(count +1)\n exit()\n\nalst = [0] * Max\nalst[0] = 2\nalst[1] = 1\nfor i in range(2,Max):\n for j in range(i, Max, i):\n alst[j] += 1\n if alst[j] >= 2:\n alst[j] = 2\n break\n\nPrime = []\nfor i in range(1,Max):\n if alst[i] == 1:\n Prime.append(int(i))\n\np = len(Prime)\nPF = [0]*Max\n\n\nfor i in range(1,p):\n if n%Prime[i] == 0:\n for j in range(20,1,-1):\n if n%Prime[i]**j == 0:\n count += 1\n PF[i] = j\n n = n / Prime[i]\n sosu(n)\nprint(count)\n', 'import math\n\nn = int(input())\nMax = 10**6\ncount = 0\n\ndef sosu(x):\n for i in range(2,int(math.sqrt(n))+1):\n if x % i == 0:\n return False\n return True\n\nif sosu(n):\n print(count +1)\n exit()\n\nalst = [0] * Max\nalst[0] = 2\nalst[1] = 1\nfor i in range(2,Max):\n for j in range(i, Max, i):\n alst[j] += 1\n if alst[j] >= 2:\n alst[j] = 2\n break\n\nPrime = []\nfor i in range(1,Max):\n if alst[i] == 1:\n Prime.append(int(i))\n\np = len(Prime)\nPF = [0]*Max\n\n\nfor i in range(1,p):\n if n%Prime[i] == 0:\n for j in range(20,1,-1):\n if n%Prime[i]**j == 0:\n count += 1\n PF[i] = j\n n = n / Prime[i]\n if sosu(n):\n print(count + 1)\n exit()\n \nprint(count)\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**2 <= 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 \ncount = 0\nN = int(input())\n\nif N <= 1:\n print(0)\n exit()\nelse:\n c = collections.Counter(prime_factorize(N))\n\n K = [sum(range(1,i)) for i in range(2,11)]\n # = [1, 3, 6, 10, 15, 21, 28, 36, 45]\n \n for i in c:\n for j in range(1,len(K)):\n if c[i] < K[j]:\n count += j\n break\n\n print(count)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s195985040', 's257937132', 's540858457', 's046941989'] | [44248.0, 44592.0, 44236.0, 9280.0] | [942.0, 914.0, 931.0, 174.0] | [722, 663, 722, 608] |
p02660 | u768896740 | 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())\nn = 16\nif n == 1:\n print(0)\n exit()\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\nx = factorization(n)\nans = 0\n\nfor i, j in x:\n cnt = 1\n while j >= 1:\n if j == 1:\n ans += 1\n j -= 1\n elif j > 1:\n ans += 1\n j -= cnt\n cnt += 1\n if cnt > j:\n break\n\nprint(ans)\n', 'n = int(input())\nif n == 1:\n print(0)\n exit()\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\nx = factorization(n)\nans = 0\n\nfor i, j in x:\n cnt = 1\n while j >= 1:\n if j == 1:\n ans += 1\n j -= 1\n elif j > 1:\n ans += 1\n j -= cnt\n cnt += 1\n if cnt > j:\n break\n\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s269572308', 's150526210'] | [9492.0, 9496.0] | [21.0, 104.0] | [677, 668] |
p02660 | u770558697 | 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 answer = 0\n for factor in factorization(n):\n x = factor[1]\n kouho = int((2*x)**0.5)-1\n if (kouho)*(kouho+1)/2 <=x and x < (kouho+1)*(kouho+2)/2:\n kaisu = kouho\n else:\n kaisu = kouho+1\n answer += kaisu\n\n print(answer)', '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())\nif n == 1:\n print(0)\nelse:\n answer = 0\n for factor in factorization(n):\n x = factor[1]\n kouho = int((2*x)**0.5)-1\n if (kouho)*(kouho+1)/2 <=x and x < (kouho+1)*(kouho+2)/2:\n kaisu = kouho\n else:\n kaisu = kouho+1\n answer += kaisu\n\n print(answer)\n'] | ['Runtime Error', 'Accepted'] | ['s586109340', 's912101949'] | [9188.0, 9500.0] | [25.0, 113.0] | [330, 684] |
p02660 | u773077120 | 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, score = 2, 0\nwhile p ** 2 <= N:\n e = 1\n while N >= (p ** e) and N % (p ** e) == 0:\n N = N // (p ** e)\n score += 1\n e += 1\n else:\n p = p + 1 if p == 2 else p + 2\nelse:\n if N != 1 and score == 0:\n score += 1\nprint(score)', 'N = int(input())\nn, p, score = N, 2, 0\nwhile p ** 2 <= N:\n e = 1\n print(n, p, e)\n while n >= (p ** e) \nand n % (p ** e) == 0:\n n = n // (p ** e)\n score += 1\n e += 1\n else:\n p = p + 1 if p == 2 else p + 2\nelse:\n if n != 1:\n score += 1\nprint(score)', 'N = int(input())\nn, p, score = N, 2, 0\nwhile p ** 2 <= N:\n e = 1\n while n >= (p ** e) and n % (p ** e) == 0:\n n //= (p ** e)\n score += 1\n e += 1\n else:\n while n % p == 0:\n n //= p\n p = p + 1 if p == 2 else p + 2\nelse:\n if n != 1:\n score += 1', 'N = int(input())\nn, p, score = N, 2, 0\nwhile p ** 2 <= N:\n e = 1\n print(n, p, e)\n while n >= (p ** e) and n % (p ** e) == 0:\n n = n // (p ** e)\n score += 1\n e += 1\n else:\n p = p + 1 if p == 2 else p + 2\nelse:\n \n \n if sum([n % i == 0 for i in range(p, n + 1)]) == 1:\n score += 1\nprint(score)', 'N = int(input())\np, score = 2, 0\nwhile p ** 2 <= N:\n e = 1\n while N >= (p ** e) and N % (p ** e) == 0:\n N = N // (p ** e)\n score += 1\n e += 1\n else:\n p = p + 1 if p == 2 else p + 2\nelse:\n if N != 1 and score == 0:\n score += 1\nprint(score)', 'N = int(input())\nn, p, score = N, 2, 0\nwhile p ** 2 <= N and n > 1:\n e = 1\n while n % (p ** e) == 0:\n n //= (p ** e)\n score += 1\n e += 1\n else:\n while n % p == 0:\n n //= p\n p += 2 - (p == 2)\nelse:\n score += n > 1\nprint(score)'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s037046290', 's322387838', 's607194308', 's641315318', 's827515243', 's352057201'] | [9188.0, 8940.0, 9192.0, 252876.0, 9200.0, 9200.0] | [417.0, 23.0, 468.0, 2226.0, 413.0, 369.0] | [257, 266, 268, 400, 257, 249] |
p02660 | u779728630 | 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\np_dic = {}\ni=2\nwhile i < N:\n if N % i == 0:\n p_dic[i] = 0\n while N % i == 0:\n p_dic[i] += 1\n N /= i\n i += 1\n\ndef foo(x):\n r = 0\n base = 1\n while x >= base:\n x -= base\n r+=1\n base += 1\n return r\n\nans = 0\nfor v in p_dic.values():\n# print(v, foo(v))\n ans += foo(v)\n\nprint(ans)', 'N = int(input())\n\np_dic = {}\ni=2\nwhile i ** 2 <= N:\n if N % i == 0:\n p_dic[i] = 0\n while N % i == 0:\n p_dic[i] += 1\n N /= i\n i += 1\n\nif N > 1:\n p_dic[N] = 1\n \ndef foo(x):\n r = 0\n base = 1\n while x >= base:\n x -= base\n r+=1\n base += 1\n return r\n\nans = 0\nfor v in p_dic.values():\n# print(v, foo(v))\n ans += foo(v)\n\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s883474222', 's031287188'] | [9268.0, 9276.0] | [2205.0, 382.0] | [324, 358] |
p02660 | u780698286 | 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 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())\nprint(len(Counter(n)))', '# coding: utf-8\n# Your code here!\n\nfrom collections import Counter\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())\nx = Counter(prime_factorize(n))\nx_keys = list(x.keys())\nx_values = list(x.values())\nans = 0\nfor i in range(len(x_keys)):\n z = x_values[i]\n mai = 1\n while z - mai >= 0:\n z -= mai\n mai += 1\n ans += 1\nprint(ans) \n'] | ['Runtime Error', 'Accepted'] | ['s059159343', 's498865918'] | [9460.0, 9308.0] | [31.0, 102.0] | [348, 608] |
p02660 | u781262926 | 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 numba import njit\n@njit\ndef factorint(n):\n d = {}\n for i in range(2, int(sqrt(n))+1):\n c = 0\n q, r = divmod(n, i)\n while not r:\n c += 1\n n = q\n q, r = divmod(n, i)\n if c:\n d[i] = c\n if n != 1:\n d[n] = 1\n return d\n\nn = int(input())\nif n == 1:\n print(0)\nelse:\n d = factorint(n)\n s = 0\n for v in d.values():\n s += int((sqrt(8*v+1)-1)/2)\n print(s)', 'from math import sqrt\ndef factorint(n):\n d = {}\n for i in range(2, int(sqrt(n))+1):\n c = 0\n q, r = divmod(n, i)\n while not r:\n c += 1\n n = q\n q, r = divmod(n, i)\n if c:\n d[i] = c\n if n != 1:\n d[n] = 1\n return d\n\nn = int(input())\nif n == 1:\n print(0)\nelse:\n d = factorint(n)\n s = 0\n for v in d.values():\n s += int((sqrt(8*v+1)-1)/2)\n print(s)'] | ['Runtime Error', 'Accepted'] | ['s841445862', 's151200070'] | [106244.0, 9228.0] | [1316.0, 155.0] | [461, 454] |
p02660 | u787059958 | 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\nA, B = input().split()\n\nprint(int(math.floor(float(A) * float(B))))\n', 'n = int(input())\n\nd = 2\nans = 0\nwhile d * d <= n:\n if (n % d != 0):\n d += 1\n continue\n z = d\n while n % z == 0:\n n //= z\n z *= d\n ans += 1\n\n while n % d == 0:\n \n n //= d\n\nif (n != 1):\n ans += 1\n\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s158415083', 's891497728'] | [9096.0, 9184.0] | [24.0, 220.0] | [80, 293] |
p02660 | u798260206 | 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\na,b = map(float,input().split())\nans = math.floor(a*b)\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\ndef inc(n):\n ans = 0\n i = 1\n while True:\n if n - i >= 0:\n n -= i\n i += 1\n ans += 1\n else:\n break\n return ans\n\nimport collections\n\nn = int(input())\n\nc = collections.Counter(prime_factorize(n))\n\nnum = c.values()\n\nans = 0\n\nfor i in num:\n ans += inc(i)\n\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s184033935', 's932198139'] | [9092.0, 9460.0] | [25.0, 101.0] | [78, 566] |
p02660 | u798818115 | 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. | ['# coding: utf-8\n# Your code here!\nimport bisect\n\nline=[i*(i+1)//2 for i in range(10**7+1)]\n\nN=int(input())\n\nif N==1:\n print(0)\n exit()\n\ndo=[0 for i in range(10**6+1)]\n\nfor i in range(2,int(N**0.5)+1):\n while N%i==0:\n N/=i\n do[i]+=1\n\nans=0\njudge=True\n\nfor _,item in enumerate(do):\n index=(bisect.bisect_right(line,item))-1\n ans+=index\n if index!=0:\n judge=False\n\nprint(ans+1 if judge else ans)\n\n\n', '# coding: utf-8\n# Your code here!\nimport bisect\n\nline=[i*(i+1)//2 for i in range(10**6+1)]\n\nN=int(input())\n\n\ndo=[0 for i in range(10**6+1)]\n\nfor i in range(2,int(N**0.5)+1):\n while N%i==0:\n N/=i\n do[i]+=1\n\nans=0 if N==1 else 1\n\nfor _,item in enumerate(do):\n index=(bisect.bisect_right(line,item))-1\n ans+=index\n\nprint(ans)\n\n\n'] | ['Time Limit Exceeded', 'Accepted'] | ['s818235565', 's650405967'] | [412636.0, 56560.0] | [2140.0, 804.0] | [434, 348] |
p02660 | u805332733 | 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 resolve():\n N = int(input())\n prime_factors = factorization(N)\n tri_dict = {\n 1 : 1,\n 2 : 1,\n 3 : 2 ,\n 4 : 2 ,\n 5 : 2 ,\n 6 : 3 ,\n 7 : 3 ,\n 8 : 3 ,\n 9 : 3 ,\n 10 : 4 ,\n 11 : 4 ,\n 12 : 4 ,\n 13 : 4 ,\n 14 : 4 ,\n 15 : 5 ,\n 16 : 5 ,\n 17 : 5 ,\n 18 : 5 ,\n 19 : 5 ,\n 20 : 5 ,\n 21 : 6 ,\n 22 : 6 ,\n 23 : 6 ,\n 24 : 6 ,\n 25 : 6 ,\n 26 : 6 ,\n 27 : 6 ,\n 28 : 7 ,\n 29 : 7 ,\n 30 : 7 ,\n 31 : 7 ,\n 32 : 7 ,\n 33 : 7 ,\n 34 : 7 ,\n 35 : 7 ,\n 36 : 8 ,\n 37 : 8 ,\n 38 : 8 ,\n 39 : 8 ,\n 40 : 8\n }\n result = 0\n\n for prime_factor in prime_factors:\n if prime_factor[0] > 1:\n result += tri_dict[prime_factor[1]]\n\n print(result)\n \nif __name__ == "__main__":\n resolve()', '# https://qiita.com/snow67675476/items/e87ddb9285e27ea555f8\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 resolve():\n N = int(input())\n prime_factors = factorization(N)\n result = 0\n\n for prime_factor in prime_factors:\n if prime_factor[0] == 1:\n continue\n\n for count in range(2, 42):\n if prime_factor[1] < (count + 1)*count//2:\n result += count - 1\n break\n print(result)\n\nif __name__ == "__main__":\n resolve()\n'] | ['Runtime Error', 'Accepted'] | ['s450465635', 's450886089'] | [9248.0, 9456.0] | [25.0, 112.0] | [816, 699] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.