Problem:


Score : 400 points

Problem Statement

You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many Shichi-Go numbers (literally "Seven-Five numbers") are there?

Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.

Note

When a positive integer A divides a positive integer B, A is said to a divisor of B.
For example, 6 has four divisors: 1, 2, 3 and 6.

Constraints

1 \leq N \leq 100

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

Print the number of the Shichi-Go numbers that are divisors of N!.

Sample Input 1

9

Sample Output 1

0

There are no Shichi-Go numbers among the divisors of 9! = 1 \times 2 \times ... \times 9 = 362880.

Sample Input 2

10

Sample Output 2

1

There is one Shichi-Go number among the divisors of 10! = 3628800: 32400.

Sample Input 3

100

Sample Output 3

543



Sample input:
9


Sample output:
0

Submission status: Runtime Error

Solution code:
# import bisect
# from collections import Counter, deque # https://note.nkmk.me/python-scipy-connected-components/
# from copy import copy, deepcopy
# from functools import reduce
# from heapq import heapify, heappop, heappush
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np  # Pythonのみ！
# from operator import xor
# import re
# from scipy.sparse.csgraph import connected_components  # Pythonのみ！
# ↑cf.  https://note.nkmk.me/python-scipy-connected-components/
# from scipy.sparse import csr_matrix
# import string
import unittest
from io import StringIO
import sys
sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    N = int(input())
    h = list(map(int, input().split()))

    import math

    # cf. https://qiita.com/suecharo/items/14137fb74c26e2388f1f

    def make_prime_list_2(num):
        if num < 2:
            return []

        # 0のものは素数じゃないとする
        prime_list = [i for i in range(num + 1)]
        prime_list[1] = 0  # 1は素数ではない
        num_sqrt = math.sqrt(num)

        for prime in prime_list:
            if prime == 0:
                continue
            if prime > num_sqrt:
                break

            for non_prime in range(2 * prime, num, prime):
                prime_list[non_prime] = 0

        return [prime for prime in prime_list if prime != 0]

    def prime_factorization_2(num, dict_counter):
        """numの素因数分解
        素因数をkeyに乗数をvalueに格納した辞書型dict_counterを返す"""

        if num <= 1:
            # 例えば1を食ったときの対処の仕方は問題によって違うと思うのでそのつど考える。
            # cf. https://atcoder.jp/contests/abc110/submissions/12688244
            return False
        else:
            num_sqrt = math.floor(math.sqrt(num))
            prime_list = make_prime_list_2(num_sqrt)

            # 何度もこの関数を呼び出して辞書を更新したい時はこれを引数にして
            # cf. https://atcoder.jp/contests/arc034/submissions/12251452

            for prime in prime_list:
                while num % prime == 0:
                    if prime in dict_counter:
                        dict_counter[prime] += 1
                    else:
                        dict_counter[prime] = 1
                    num //= prime
            if num != 1:
                if num in dict_counter:
                    dict_counter[num] += 1
                else:
                    dict_counter[num] = 1

            return dict_counter
    dict_counter = {}
    for i in range(1, N+1):
        prime_factorization_2(i, dict_counter)

    l = list(dict_counter.values())
    ll = len(l)

    num, sum = [0] * (ll+1), [0] * 76

    # dp[i][j]:i-1番目までの素因数を使うと約数の個数がj個になる数が何個あるか
    dp = [[0] * 76 for _ in range(ll + 1)]
    dp[0][1] = 1

    for i in range(ll):
        for j in range(200):# dp[i][j]はdp[i+1][...]にどう寄与するか？
            dp[i+1][j*(l[i]+1)] += dp[i][j]

    print(dp[ll][75])


# resolve()


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """9"""
        output = """0"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """10"""
        output = """1"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """100"""
        output = """543"""
        self.assertIO(input, output)


if __name__ == "__main__":
    unittest.main()

Submission status: Runtime Error

Solution code:
from itertools import permutations

n=int(input())
np=factorial(n)
p_list=[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]

ans=[]
for s,t,u in permutations(p_list,3):
  num1=(s**4)*(t**4)*(u**2)
  num2=(s**14)*(t**4)
  num3=(s**24)*(t**2)
  num4=s**74
  for z in [num1,num2,num3,num4]:
    if np%z==0:
      ans.append(z)

print(len(set(ans)))

Submission status: Runtime Error

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

N = int(input())

e = [0] * (N+1)

for i in range(2, N+1):
    cur = i
    for j in range(2, i+1):
        while cur % j == 0:
            e[j] += 1
            cur //= j

def num(n):
    return len(list(filter(lambda x: x >= n-1, e)))

# num(3)-1はnum(25)で3以上のものを一個使っているので、一つ引いている。//2は、例えばa^4 * b^4 * c^2 と b^4 * a^4 * c^2がかぶって計上されるため。
print(num(75) + num(25)*(num(3)-1) + num(15)*(num(5)-1) + num(5)*(num(5)-1)*(num(3)-2)//2)

Submission status: Runtime Error

Solution code:
N = int(input())

n = [0]*(N+1)
for i in range(2, N+1):
    for j in range(2, i+1):
        while i%j == 0:
            i//=j
            n[j] += 1

def num(m):
    return len(list(filter(lambda x: x>=m-1, n)))

print(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)14+num(5)*(num(5)-1)*(num(3)-2)//2)

Submission status: Runtime Error

Solution code:
N = int(input())

n = [0]*(N+1)
for i in range(2, N+1):
    x = i
    for j in range(2, i+1):
        while x%j == 0:
            x//=j
            n[j] += 1

def num(m):
return len(list(filter(lambda x: x>=m-1, n)))

print(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)14+num(5)*(num(5)-1)*(num(3)-2)//2)

Submission status: Runtime Error

Solution code:
N = int(input())

n = [0]*(N+1)
for i in range(2, N+1):
    for j in range(2, i+1):
        while i%j == 0:
            i//=j
            n[j] += 1

def num(m):
return len(list(filter(lambda x: x>=m-1, n)))

print(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)14+num(5)*(num(5)-1)*(num(3)-2)//2)

Submission status: Runtime Error

Solution code:
N = int(input())

n = [0]*(N+1)
for i in range(2, N+1):
    for j in range(2, i+1):
        while i%j == 0:
            i//=j
            n[j] += 1

def num(m):
return len(list(filter(lambda x: x>=m-1, e)))

print(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)14+num(5)*(num(5)-1)*(num(3)-2)//2)

Submission status: Runtime Error

Solution code:
from collections import defaultdict as dd
from itertools import permutations as p

def factorize(n):
    d = dd(int)
    for i in range(2, int(n**0.5)+1):
        while n%i==0:
            d[i] += 1
            n //= i
        if not n:
            break
    if n>1:
        d[n] += 1
    return d

N = int(input())
d = defaultdict(int)
for i in range(1, N+1):
    e = factorize(i)
    for i,j in e.items():
        d[i] += j

ans = 0
for i, j, k in p(d.values(), 3):    
    if i>=2 and j>=4 and k>=4:
        ans += 1
ans //= 2

for i, j in p(d.values(), 2):
    if i>=2 and j>=24:
        ans += 1
    if i>=4 and j>=14:
        ans += 1

for i in d.values():
    if i>=74:
        ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
import math

N = int(input())

prime = [0 for _ in range(47 + 1)]
lst = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]

for i in range(2, N + 1):
	num = i
	# 素因数分解
	for p in lst:
		while True:
			if num % p == 0:
				num //= p
				prime[p] += 1
			else: break
			if num == 1: break
		

_75 = 0
_25 = 0
_15 = 0
_5 = 0
_3 = 0

for i in range(len(prime)):
	if prime[i] >= 2:
		_3 += 1
	if prime[i] >= 4:
		_5 += 1
	if prime[i] >= 14:
		_15 += 1
	if prime[i] >= 24:
		_25 += 1
	if prime[i] >= 74:
		_75 += 1
		
def comb(a, b):
	return math.factorial(a) / (math.factorial(b) * math.factorial(a - b))
		
ans = 0
ans += _75
ans += (_3 - 1) * _25 # かけられている数で1引いているのは、かける数で使っているものをかけられる数でも使う場合を除くため
ans += (_5 - 1) * _15
ans += (_3 - 2) * comb(_5, 2)

print(int(ans))

Submission status: Runtime Error

Solution code:
n=int(input())
div=[0]*(n+1)
for i in range(1,n+1):
  k=i
  for j in range(1,int(i**0.5)+1):
    cnt=0
    while k%(j+1)==0:
      k//=(j+1)
      cnt+=1
    div[j+1]+=cnt
  if k>1:
    div[k]+=1
ans=0
d=dict()
for i,j,k in [[4,4,2],[24,2,1000],[14,4,1000],[74,1000,1000]]:
  cnti,cntj,cntk=0,0,0
  for l in range(2,n+1):
    if j==1000 and k==1000:
      if div[l]>=i:
        ans+=1
    for m in range(2,n+1):
      if l!=m and j!=1000 and k==1000:
        if div[l]>=i and div[m]>=j:
            ans+=1
      for o in range(2,n+1):
        if (m,l) not in d:
          if l!=o and l!=m and m!=o:
            if i!=1000 and j!=1000 and k!=1000:
              if div[l]>=i and div[m]>=j and div[o]>=k:
                ans+=1
                d[(l,m)]=0
print(ans)

Submission status: Runtime Error

Solution code:
def p_d():
    from collections import Counter
    N = int(input())
    li = []
    for i in range(1, N + 1):
        li.extend(prime_factorize(i))
    prime_list = Counter(li).values()

    def num(m):
        return len(list(filter(lambda x: x >= m - 1, prime_list)))

    print(num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1) + num(5) * (num(5) - 1) * (num(3) - 2) // 2)


if __name__ == '__main__':
    p_d()

Submission status: Runtime Error

Solution code:
import sys
from bisect import bisect_right as br
input = sys.stdin.readline
N = int(input())

def check(x):
  i = 2
  res = []
  while i * i <= x:
    while x % i == 0:
      x //= i
      res.append(i)
    i += 1
  if x > 1:
    res.append(x)
  return res
table = [0] * (N + 1)
for i in range(2, N + 1):
  for p in check(i):
    table[p] += 1
  #print(check(i))
t = []
#print(table)
for p in table:
  if p > 0: t.append(p)
t.sort()
#print(t)
k = len(t)
#print(k)
res = t[-1] >= 74
for i in range(k - 1):
  for j in range(i + 1, k):
    if t[i] + 1 >= 3 and (t[j] + 1 >= 25):
      res += 1
    if t[i] + 1 >= 5 and (t[j] + 1 >= 15):
      res += 1
    if t[i] + 1 >= 15 and (t[j] + 1 >= 5):
      res += 1
    if t[i] + 1 >= 25 and (t[j] + 1 >= 3):
      res += 1
#print(k, res)
for i in range(k - 2):
  for j in range(i + 1, k - 1):
    for l in range(j + 1, k):
      if (t[i] + 1) >= 3 and (t[j] + 1 >= 5) and (t[l] + 1 >= 5):
        res += 1
      if (t[i] + 1) >= 5 and (t[j] + 1 >= 3) and (t[l] + 1 >= 5):
        res += 1
      if (t[i] + 1) >= 5 and (t[j] + 1 >= 5) and (t[l] + 1 >= 3):
        res += 1
print(res)

Submission status: Runtime Error

Solution code:
from collections import defaultdict

N = int(input())
prime = [2,3,5,7,11,13,17,19,23,29,31,37,41,
        43,47,53,59,61,67,71,73,79,83,89,97]
ans = 0
factor = defaultdict(int)
for i in range(1,N+1):
    for j in prime:
        while i != 1:
            if i % j == 0:
                factor[j] += 1
                i = i // j
            else:
                break

fact_l = list(dict(factor).items())
for i, x in enumerate(fact_l):
    if x[1] >= 74:
        n_74 = i + 1
    if x[1] >= 24:
        n_24 = i + 1
    if x[1] >= 14:
        n_14 = i + 1
    if x[1] >= 4:
        n_4 = i + 1
    if x[1] >= 2:
        n_2 = i + 1

print(n_74+n_24*(n_2-1)+n_14*(n_4-1)+n_4*(n_4-1)*(n_2-2)//2)

Submission status: Runtime Error

Solution code:
n=int(input())
e=[0]*(n+1)
for i in range(2,n+1):
    cur=i
    for j in range(2,i+1):
        while cuur%j==0:
            e[j]+=1
            cur//=j
def num(m):
    return len(list(filter(lambda  x: x>=m-1,e)))

print(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)+num(5)*(num(5)-1)*(num(3)-2)//2)

Submission status: Runtime Error

Solution code:
N = int(input())
e = [0] * (N+1)

for i in range(2, N+1):
    cur = i
    for j in range(2, i+1):
        while cur % j == 0:
            e[j] += 1
            cur //= j

def num(m): # eの要素のうち m-1 以上のものの個数
    return len(list(filter(lambda x: x >= m-1, e)))

answer = num(75) + num(25) * (num(3)-1) + num(15) * (num(5) - 1)
    + num(5) * (num(5) - 1) * (num(3) - 2) // 2)

Submission status: Runtime Error

Solution code:
def prime_factor(n):
    p = {}
    for i in range(2,n):
        if n % i == 0:
            p[i] = 0
        while n % i == 0:
            n //= i
            p[i] += 1
        if i * i > n: break
    if n != 1:
        p[n] = 1
    return p

N = int(input())
pN = {}
for i in range(2,N+1):
    p = prime_factor(i)
    for x in p:
        if x not in pN:
            pN[x] = p[x]
        else:
            pN[x] += p[x]

# 75 = 3 * 5 * 5
res = 0
for x in pN:
    for y in pN:
        for z in pN:
            if (x < y and y < z):
                if(pN[x]>=2 and pN[y]>=4 and pN[z]>=4):
                    res+=1
                if(pN[x]>=4 and pN[y]>=2 and pN[z]>=4):
                    res+=1
                if(pN[x]>=4 and pN[y]>=4 and pN[z]>=2):
                    res+=1

# 75 = 3 * 25
for x in pN:
    for y in pN:
        if x < y:
            if(pN[x]>=24 and pN[y]>= 2):
                res+=1
            if(pN[x]>= 2 and pN[y]>=24):
                res+=1

# 75 = 15 * 5
for x in pN:
    for y in pN:
        if x < y:
            if(pN[x]>=14 and pN[y]>= 4):
                res+=1
            if(pN[x]>= 4 and pN[y]>=14):
                res+=1

if pN[2] >= 74:
    res += 1
    
print(res)

Submission status: Runtime Error

Solution code:
def slove():
    import sys
    import collections
    input = sys.stdin.readline

    n = int(input().rstrip('\n'))
    ls = []

    for i in range(1, n + 1):
        t = i
        for j in range(2, int(t ** 0.5) + 1):
            while True:
                if t % j == 0:
                    t //= j
                    ls.append(j)
                else:
                    break
        if t > 1:
            ls.append(t)

    ls = collections.Counter(ls)
    ls2 = []

    for k, v in ls.items():
        if v >= 74:
            ls2.append(75)
        if v >= 24:
            ls2.append(25)
        if v >= 14:
            ls2.append(15)
        if v >= 4:
            ls2.append(5)
        if v >= 2:
            ls2.append(3)

    ls2 = collections.Counter(ls2)
    cnt = 0s2[3]-1, 0))
    cnt += (ls2[15] * max(ls2[5]-1, 0))
    cnt += (ls2[5] * max(ls2[5]-1, 0) * max(ls2[3]-2, 0) // 2)
    print(cnt)


if __name__ == '__main__':
    slove()

Submission status: Runtime Error

Solution code:
n=int(input())
data=[0]*(n+1)
for i in range(2,n+1):
    for j in range(2,int(i**(1/2))+1):
        if i%j==0:
            break
    else:
        count=0
        for j in range(i,n+1):
            k=j
            while k%i==0:
                k//=i
                data[i]+=1
if data[2]>=74:
    ans=1
else:
    ans=0
count3=0
count5=0
count15=0
count25=0
for i in range(n+1):
    if data[i]>=2:
        count3+=1
for i in range(n+1):
    if data[i]>=4:
        count5+=1
for i in range(n+1):
    if data[i]>=14:
        count15+=1
for i in range(n+1):
    if data[i]>=24:
        count25+=1
ans+=count25*(count3-1)
ans+=count15*(count5-1)
ans+=(count3-2)*count5*(count5-1)//2
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
e=[0]*(n+1)
count=0
ijklist={}
for i in range(2, n+1):
    cur = i
    for j in range(2, i + 1):
        while cur % j == 0:
            e[j] += 1
            cur //= j
for i in range(n+1):
    for j in range(i+1,n+1):
        for k in range(j+1,n+1):
            if e[i]>=4 and e[j]>=4 and e[k]>=2:
                if i+j+k  not in ijklist:
                    ijklist.add(i+j+k)
                    count += 1
            elif e[i]>=14 and e[j]>=4 and e[k]==0:
                if i+j+k  not in ijklist:
                    ijklist.add(i+j+k)
                    count += 1
            elif e[i]>=24 and e[j]>=2 and e[k]==0:
                if i+j+k  not in ijklist:
                    ijklist.add(i+j+k)
                    count += 1
            elif e[i]>=74 and e[j]==0 and e[k]==0:
                if i+j+k  not in ijklist:
                    ijklist.add(i+j+k)
                    count += 1
print(count)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    n = II()
    a = [7,5,3]
    if n in a:
        print("YES")
    else:
        print("NO")
    return

#B
def B():
    s = S()
    ans = inf
    for i in range(len(s) - 2):
        ans = min(ans, abs(753-int("".join(s[i:i + 3]))))
    print(ans)
    return

#C
def C():
    s = II()
    n = len(str(s))
    ans = 0
    for i in range(3,n+1):
        c = itertools.product(["3", "5", "7"], repeat=i)
        for ci in c:
            if len(set(ci)) < 3:
                continue
            if int("".join(ci)) <= s:
                ans += 1
    print(ans)

        
    return

#D
def D():
    n = II()
    def primes(n):
        """ Input n>=6, Returns a list of primes, 2 <= p < n """
        """ 6以上の数であれば p (素数) <= n のlistを返す """
        n, correction = n - n % 6 + 6, 2 - (n % 6 > 1)
        sieve = [True] * (n // 3)
        for i in range(1, int(n ** 0.5) // 3 + 1):
            if sieve[i]:
                k = 3 * i + 1 | 1
                sieve[k * k                     // 3::2 * k] = [False] * ((n // 6 - k * k                     // 6 - 1) // k + 1)
                sieve[k * (k - 2 * (i & 1) + 4) // 3::2 * k] = [False] * ((n // 6 - k * (k - 2 * (i & 1) + 4) // 6 - 1) // k + 1)
        return [2, 3] + [3 * i + 1 | 1 for i in range(1, n // 3 - correction) if sieve[i]]
    primelis = primes(100)
    d = defaultdict(int)
    a = [2, 4, 14, 24, 74]
    for i in primelis:
        b = n
        tmp = 0
        while b // i:
            tmp += b // i
            b = b // i
        if tmp == 0:
            break
        for i in a:
            d[i] += (tmp >= i)
    num = list(d.values())
    ans = (num[0] - 1) * num[3] + (num[1] - 1) * num[2] + num[4] + (num[0] - 2) * (num[1] - 1) * num[1] // 2
    print(ans)
    return

#Solve
if __name__ == '__main__':
    D()

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    n = II()
    a = [7,5,3]
    if n in a:
        print("YES")
    else:
        print("NO")
    return

#B
def B():
    s = S()
    ans = inf
    for i in range(len(s) - 2):
        ans = min(ans, abs(753-int("".join(s[i:i + 3]))))
    print(ans)
    return

#C
def C():
    s = II()
    n = len(str(s))
    ans = 0
    for i in range(3,n+1):
        c = itertools.product(["3", "5", "7"], repeat=i)
        for ci in c:
            if len(set(ci)) < 3:
                continue
            if int("".join(ci)) <= s:
                ans += 1
    print(ans)

        
    return

#D
def D():
    n = II()
    def primes(n):
        """ Input n>=6, Returns a list of primes, 2 <= p < n """
        """ 6以上の数であれば p (素数) <= n のlistを返す """
        n, correction = n-n%6+6, 2-(n%6>1)
        sieve = [True] * (n//3)
        for i in range(1,int(n**0.5)//3+1):
            if sieve[i]:
                k=3*i+1|1
                sieve[      k*k//3      ::2*k] = [False] * ((n//6-k*k//6-1)//k+1)
                sieve[k*(k-2*(i&1)+4)//3::2*k] = [False] * ((n//6-k*(k-2*(i&1)+4)//6-1)//k+1)
        return [2, 3] + [3 * i + 1 | 1 for i in range(1, n // 3 - correction) if sieve[i]]
    primelis = primes(100)
    d = defaultdict(int)
    a = [2, 4, 14, 24, 74]
    for i in primelis:
        b = n
        tmp = 0
        while b // i:
            tmp += b // i
            b = b // i
        if tmp == 0:
            break
        for i in a:
            d[i] += tmp >= i
    num = list(d.values())
    ans = (num[0] - 1) * num[3] + (num[1] - 1) * num[2] + num[4] + (num[0] - 2) * (num[1] - 1) * num[1] // 2
    print(ans)
    return

#Solve
if __name__ == '__main__':
    D()

Submission status: Runtime Error

Solution code:
import collections


def eratosthenes(n):
    sieve = [True for _ in range(n + 1)]
    sieve[0] = False
    sieve[1] = False

    def _update(p):
        if sieve[p]:
            for i in range(p * 2, n + 1, p):
                sieve[i] = False

    _update(2)
    p = 3
    while p * p <= n:
        _update(p)
        p += 2
    return sieve


n = int(input())
sieve = eratosthenes(n)
primes = [i for i in range(n + 1) if sieve[i]]
counter = collections.Counter()
for i in range(2, n + 1):
    for p in primes:
        while i % p == 0:
            counter[p] += 1
            i //= p
        if i == 1:
            break

counter2 = collections.Counter()
for i in [2, 4, 14, 24, 74]:
    for p in primes:
        if counter[p] >= i:
            counter2[i] += 1

c0 = counter2[74]
c1 = counter2[24] * (counter2[2] - 1)
c2 = counter2[14] * (counter2[4] - 1)
c3 = (counter2[4] * (counter2[4] - 1) * (counter2[2] - 2)) // 2
print(c0 + c1 + c2 + c3)

Submission status: Runtime Error

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LIM(): return list(map(lambda x:int(x) - 1, sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
mod = 1000000007



q = I()

def sieve(r):
    not_prime = [0] * r
    not_prime[0] = 1
    not_prime[1] = 1
    for i in range(2, r):
        if not_prime[i] == 0:
            for j in range(i*2, r, i):
                not_prime[j] = 1
    return [k for k in range(r) if not not_prime[k]]



primes = sieve(q)
n = len(primes)
multiple_cnt = [0] * n
for m in range(len(primes)):
    ret = q
    p = primes[m]
    while ret:
        ret //= p
        multiple_cnt[m] += ret


multiple_cnt.sort()
ans = 0
ans += (n - bisect_left(multiple_cnt, 75))
ans += (n - bisect_left(multiple_cnt, 24)) * (n - bisect_left(multiple_cnt, 2) - 1)
ans += (n - bisect_left(multiple_cnt, 14)) * (n - bisect_left(multiple_cnt, 4) - 1)
ans += (n - bisect_left(multiple_cnt, 4)) * (n - bisect_left(multiple_cnt, 4) - 1) // 2 * (n - bisect_left(multiple_cnt, 2) - 2)


print(ans)

Submission status: Runtime Error

Solution code:
def main():
    N = int(input())
    def prime_list(n):
        prime = [True for _ in range(n+1)]
        prime[0] = False
        prime[1] = False
        for i in range(2,int(n**0.5)+1):
            if not prime[i]:
                continue
            for j in range(i*2,n+1,i):
                prime[j] = False
        return [i for i in range(n+1) if prime[i]]

    prime_list = prime_list(N//2)
    cnt_list = [0 for _ in range(len(prime_list))]
    for i in range(len(prime_list)):
        count = 0
        d = N
        while d >= 1:
            count += d//(prime_list[i])
            d //= prime_list[i]
        cnt_list[i] = count

    def num(X):
        return len(list(filter(lambda x:x>=X-1,cnt_list)))

    print(num(75)+num(15)*(num(5)-1)+num(25)*(num(3)-1)+\
        num(5)*(num(5)-1)*(num(3)-2)//2)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:

from math import sqrt, ceil

primes = [2]
for n in range(3, 101):
    if any(n % i == 0 for i in range(2, n)):
        continue
    primes.append(n)

def fact(n):
    p = 1
    for i in range(2, n+1):
        p *= i
    return p

def calc_factors(n):
    factors = {}
    for p in primes:
        while n % p == 0:
            factors[p] = factors.get(p, 0)+1
            n //= p
    return factors

def solve(N):
    n = fact(N)
    factors = calc_factors(n)

    nums = {}
    for p, c in factors.items():
        if c >= 2:
            nums[3] = nums.get(3,0)+1
        if c >= 4:
            nums[5] = nums.get(5,0)+1
        if c >= 14:
            nums[15] = nums.get(15,0)+1
        if c >= 24:
            nums[25] = nums.get(25,0)+1
        if c >= 74:
            nums[75] = nums.get(75,0)+1
    print(sum([
            nums[5] * (nums[5] - 1) * (nums[3]-2) // 2,
            nums[15] * (nums[5] - 1) ,
            nums[25] * (nums[3] - 1) ,
            nums[75] ]))
N = int(input())
solve(N)

Submission status: Runtime Error

Solution code:

from math import sqrt, ceil

primes = [2]
for n in range(3, 101):
    if any(n % i == 0 for i in range(2, n)):
        continue
    primes.append(n)

def fact(n):
    p = 1
    for i in range(2, n+1):
        p *= i
    return p

def calc_factors(n):
    factors = {}
    for p in primes:
        while n % p == 0:
            factors[p] = factors.get(p, 0)+1
            n //= p
    return factors

def solve(N):
    n = fact(N)
    factors = calc_factors(n)
    print("fact(%d)=%d" % (N, n))
    print("factors=", factors)
    #print("factors=", calc_factors(32400))
    print((2**8)*(3**4)*(5**2)*7)

    nums = {}
    for p, c in factors.items():
        if c >= 2:
            nums[3] = nums.get(3,0)+1
        if c >= 4:
            nums[5] = nums.get(5,0)+1
        if c >= 14:
            nums[15] = nums.get(15,0)+1
        if c >= 24:
            nums[25] = nums.get(25,0)+1
        if c >= 74:
            nums[75] = nums.get(75,0)+1
    print(sum([
            nums[5] * (nums[5] - 1) * (nums[3]-2) // 2,
            nums[15] * (nums[5] - 1) ,
            nums[25] * (nums[3] - 1) ,
            nums[75] ]))
N = int(input())
solve(N)

Submission status: Runtime Error

Solution code:
n = int(input())

l = [0]*(n+1)
for i in range(2, n+1):
  cur = i
  for j in range(2, i+1):
    while cur % j == 0:
      cur //= j
      l[j] == 1

def num(s):
  return len(list(filter(lambda x: x >= m-1, l)))

print(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)+num(5)*(num(5)-1)*(num(3)-2)//2)

Submission status: Runtime Error

Solution code:
n = int(input())

l = [0]*(n+1)
for i in range(2, n+1):
  cur = i
  for j in range(2, i+1):
    while cur % j == 0:
      cur //= j
      l[j] == 1

def num(s):
  return len(list(filter(lambda x: x >= m-1, l)))

print(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)+(num(5)*(num(5)-1)*(num(3)-2))//2)

Submission status: Runtime Error

Solution code:
n = int(input())

l = [0]*(n+1)
for i in range(2, n+1):
  cur = i
  for j in range(2, i+1):
    while cur % j == 0:
      cur //= j
      l[j] == 1

def num(s):
  return len(list(filter(lambda x: m-1 =< x, l)))

print(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)+(num(5)*(num(5)-1)*(num(3)-2))//2)

Submission status: Runtime Error

Solution code:
n = int(input())

l = [0]*(n+1)
for i in range(2, n+1):
  cur = i
  for j in range(2, i+1):
    while cur % j == 0:
      cur //= j
      l[j] == 1

def num(s):
  return len(list(filter(lambda x: m-1 > x, l)))

print(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)+(num(5)*(num(5)-1)*(num(3)-2))//2)

Submission status: Runtime Error

Solution code:
N = int(input())

prime_number = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]

a = 0
_count = []
ans = 0

for g in range(len(prime_number)):
	if prime_number[g] > N:
		break
	for i in range(1, 100):
		a += N//prime_number[g]**i
		if  prime_number[g]**i > N:
			_count.append(a)
			a=0
			break

if _count[0] >= 74:
	ans+=1

c_24 = []
c_14 = []
c_4 = []
c_2 = []
for n in range(len(_count)):
	if _count[n]>=24:
		c_24.append(_count[n])
	if _count[n]>=14:
		c_14.append(_count[n])
	if _count[n]>=4:
		c_4.append(_count[n])
	if _count[n]>=2:
		c_2.append(_count[n])

ans += len(c_14)*(len(c_4)-1)
ans += len(c_24)*(len(c_2)-1)
ans += (len(c_4)-1)*len(c_4)*(len(c_2)-2)/2

print(int(max(ans,0)))

Submission status: Runtime Error

Solution code:
#%%
N =int(input())

import sympy

l = [0] * (N+1)

for i in range(1,N+1):
    a = sympy.factorint(i)
    for k, v in a.items():
        l[k] += v

#print(l)

l_2 = []
l_4 = []
l_14 = []
l_24 = []
l_74 = []

for i in range(len(l)):
    if l[i]>=2:
        l_2.append(i)
    if l[i]>=4:
        l_4.append(i)
    if l[i]>=14:
        l_14.append(i)
    if l[i]>=24:
        l_24.append(i)
    if l[i]>=74:
        l_74.append(i)

#print(l_2)
#print(l_4)
#print(l_14)
#print(l_24)
#print(l_74)

count_2_4_4 = 0
count_4_14 = 0
count_2_24 = 0
count_74 = 0

for i in range(len(l_2)):
    for j in range(len(l_4)):
        for k in range(j,len(l_4)):
            if l_2[i] != l_4[j] and l_2[i] != l_4[k] and l_4[j] != l_4[k]:
                count_2_4_4 += 1

for i in range(len(l_4)):
    for j in range(len(l_14)):
        if l_4[i] != l_14[j] :
            count_4_14 += 1

for i in range(len(l_2)):
    for j in range(len(l_24)):
        if l_2[i] != l_24[j]:
            count_2_24 += 1

count_74 += len(l_74)


#print(count_2_4_4)
#print(count_4_14)
#print(count_2_24)
#print(count_74)

ans = count_2_4_4 + count_4_14 + count_2_24 + count_74
print(ans)











#%%