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: Wrong Answer

Solution code:
import math 
  
# A function to print all prime factors of  
# a given number n 
def primeFactors(n): 
      
    # Print the number of two's that divide n 
    while n % 2 == 0: 
        arr[2] = arr[2] + 1 
        n = int(n / 2)
          
    # n must be odd at this point 
    # so a skip of 2 ( i = i + 2) can be used 
    for i in range(3,int(math.sqrt(n))+1,2): 
          
        # while i divides n , print i ad divide n 
        while n % i== 0: 
            arr[i] = arr[i] + 1  
            n = int(n / i)
              
    # Condition if n is a prime 
    # number greater than 2 
    if n > 2: 
        arr[n] = arr[n] + 1  

arr = [0] * 101
wow = [0] * 5
result = 0
n = int(input())

for i in range(2,n+1):
    primeFactors(i)

# count = 0
for i in arr:
    # if i != 0:
    #     print(count, i)
    # count = count + 1
    if i > 1: wow[0] = wow[0] + 1
    if i > 3: wow[1] = wow[1] + 1
    if i > 13: wow[2] = wow[2] + 1
    if i > 23: wow[3] = wow[3] + 1
    if i > 74: wow[4] = wow[4] + 1

# for i in wow:
#     if i != 0:
#         print(i)

result = wow[4] + wow[3] * (wow[0] - 1) + wow[2] * (wow[1] - 1) + wow[1] * (wow[1] - 1) * (wow[0] - 2) // 2
print(result)

Submission status: Wrong Answer

Solution code:
N = int(input())
primes = {}
for p in map(int, '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'.split()):
    primes[p] = 0
factors = {}
for p in primes.keys():
    factors[p] = 0
for i in range(1, N + 1):
    while i > 1:
        for p in primes:
            while i % p == 0:
                factors[p] = factors.get(p, 0)+1
                i //= p
fact3, fact5, fact15, fact25, fact75 = 0, 0, 0, 0, 0
for k, v in factors.items():
    if v >= 75:
        fact75 += 1
    if v >= 24:
        fact25 += 1
    if v >= 14:
        fact15 += 1
    if v >= 4:
        fact5 += 1
    if v >= 2:
        fact3 += 1
print(fact75 + fact25 * (fact3 - 1) + fact15 *
      (fact5 - 1) + fact5 * (fact5 - 1) * (fact3 - 2) // 2)

Submission status: Wrong Answer

Solution code:
def prf(m):
    pf = {}
    for i in range(2,int(m**0.5)+1):
        while m % i == 0:
            pf[i] = pf.get(i,0)+1
            m //= i
    if m>1:pf[m] = 1
    return pf
import bisect
from collections import defaultdict
Pr = defaultdict(lambda: -1)

m = int(input())
for i in range(1,m+1):
    j = prf(i)
    for k, l in j.items():
        Pr[k] -= l
A = list(Pr.values())
a = dict() 
for i in [3,5,15,25,75]:
    a[i] = bisect.bisect_right(A,-i)
print(a[3]*a[5]*(a[5]-1)//2+(a[15]-a[5])*(a[5]-1)+(a[3]-1)*a[25]+a[75])

Submission status: Wrong Answer

Solution code:
fact = []
prime = set()
def init():
  fact.append(0)
  for i in range(1,101):
    fact.append(0)

def solve(n):
  cnt = 0
  for i in range(1,n+1):
    tp = i
    di = 2
    while tp != 1:
      if tp % di == 0:
        prime.add(di)
        fact[di] += 1
        cnt += 1
        tp /= di
      else:
        di += 1
  sf = []
  tf = [] 
  ft = []
  f = []
  t = []
  for i in prime:
    if fact[i] >= 74:
      sf.append(i)
    if fact[i] >= 24:
      tf.append(i)
    if fact[i] >= 15:
      ft.append(i)
    if fact[i] >= 4:
      f.append(i)
    if fact[i] >= 2:
      t.append(i)
  ans = len(sf)
  for i in tf:
    for j in t:
      if i != j:
        ans += 1
  for i in ft:
    for j in f:
      if i != j:
        ans += 1
  for i in f:
    for j in f:
      if i < j:
        for k in t:
          if i != k and j != k:
            ans += 1  
  return ans

n = int(input())
init()
print(solve(n))

Submission status: Wrong Answer

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

def add(a, b):
    res = copy.deepcopy(a)
    for i in b:
        if i in res:
            res[i] = res[i] + b[i]
        else:
            res[i] = b[i]
    return res

N = int(input())
cnt = {}
for i in range(1, N+1):
    cnt = add(cnt, getPrimes(i))

num = []
for i in cnt:
    num.append(cnt[i])
num.sort()
print(num)
ans  = 0
for i in range(len(num)):
    for j in range(len(num)):
        for k in range(j + 1, len(num)):
            if i == j or i == k:
                continue
            if num[i] >= 2 and num[j] >= 4 and num[k] >= 4:
                ans = ans + 1
                
for i in range(len(num)):
    for j in range(len(num)):
        if i != j and num[i] >= 2 and num[j] >= 24:
            ans = ans + 1
            
for i in range(len(num)):
    for j in range(len(num)):
        if i != j and num[i] >= 4 and num[j] >= 14:
            ans = ans + 1
            
for i in range(len(num)):
    if num[i] >= 74:

        
        ans = ans + 1
print(ans)

Submission status: Wrong Answer

Solution code:
import collections
import itertools

yakusuu = {}
for j in range(2, 101):
    I = j
    s = 0
    R = int(I)
    L = []
    while s == 0:
        for i in range(2, R + 1):
            if I % i == 0:
                I = I / i
                if I == 1:
                    s = 1
                L.append(i)
                break
    if len(L) == 1:
        yakusuu[R] = [R]
    else:
        yakusuu[R] = L

n = int(input())

cnt = 0

for num in range(1, n + 1):
    tmp = []
    if n == 1:
        print(0)
        exit()
    for i in range(2, num + 1):
        tmp += yakusuu[i]
tmp = dict(collections.Counter(tmp))
tmp_array = sorted(list(tmp.keys()))

cnt = 0

for i in tmp_array:
    if tmp[i] >= 74:
        cnt += 1

for i in tmp_array:
    for j in tmp_array:
        if i == j:
            continue
        elif (tmp[i] >= 14 and tmp[j] >= 4) or (tmp[i] >= 4 and tmp[j] >= 14):
            cnt += 1

for i in tmp_array:
    for j in tmp_array:
        if i == j:
            continue
        elif (tmp[i] >= 24 and tmp[j] >= 2) or (tmp[i] >= 2 and tmp[j] >= 24):
            cnt += 1

res_array = list(itertools.combinations(tmp_array, 3))
for i, j, k in res_array:
    if (tmp[i] >= 2 and tmp[j] >= 4 and tmp[k] >= 4) or \
            (tmp[i] >= 4 and tmp[j] >= 2 and tmp[k] >= 4) or \
            (tmp[i] >= 4 and tmp[j] >= 4 and tmp[k] >= 2):
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
import collections
import itertools

yakusuu = {}
for j in range(2, 101):
    I = j
    s = 0
    R = int(I)
    L = []
    while s == 0:
        for i in range(2, R + 1):
            if I % i == 0:
                I = I / i
                if I == 1:
                    s = 1
                L.append(i)
                break
    if len(L) == 1:
        yakusuu[R] = [R]
    else:
        yakusuu[R] = L

n = int(input())

cnt = 0

for num in range(1, n + 1):
    tmp = []
    if n == 1:
        print(0)
        exit()
    for i in range(2, num + 1):
        tmp += yakusuu[i]
tmp = dict(collections.Counter(tmp))
tmp_array = sorted(list(tmp.keys()))
print(tmp_array)

cnt = 0

for i in tmp_array:
    if tmp[i] >= 74:
        cnt += 1

for i in tmp_array:
    for j in tmp_array:
        if i == j:
            continue
        elif (tmp[i] >= 14 and tmp[j] >= 4) or (tmp[i] >= 4 and tmp[j] >= 14):
            cnt += 1

for i in tmp_array:
    for j in tmp_array:
        if i == j:
            continue
        elif (tmp[i] >= 24 and tmp[j] >= 2) or (tmp[i] >= 2 and tmp[j] >= 24):
            cnt += 1

res_array = list(itertools.combinations(tmp_array, 3))
for i, j, k in res_array:
    if (tmp[i] >= 2 and tmp[j] >= 4 and tmp[k] >= 4) or \
            (tmp[i] >= 4 and tmp[j] >= 2 and tmp[k] >= 4) or \
            (tmp[i] >= 4 and tmp[j] >= 4 and tmp[k] >= 2):
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
from math import sqrt
N = int(input())
e = [0]*101

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

ans = 0
ov75, ov24, ov14, ov4, ov2 = 0,0,0,0,0
for ei in e:
    if ei>=2: ov2 += 1
    if ei>=4: ov4 += 1
    if ei>=14: ov14 += 1
    if ei>=24: ov24 += 1
    if ei>=75: ov75 += 1

ans += ov24*(ov2-1)
ans += ov4*(ov4-1)*(ov2-2)//2
ans += ov14*(ov4-1)
ans += ov75
# print(e)
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter as c

def fact(n):
  d=[]
  for i in range(2,int(n**0.5)+1):
    while n%i==0:
      n//=i
      d.append(i)
  if n!=1:d.append(n)
  return c(d)

n=int(input())
d=c()
for i in range(1,n+1):
  d+=fact(i)

f=lambda n:len(list(filter(lambda x:x>=n-1,d.values())))
print(f(74)+f(25)*(f(3)-1)+f(15)*(f(5)-1)+f(5)*(f(5)-1)*(f(3)-2)//2)

Submission status: Wrong Answer

Solution code:
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n;

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p;
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result;

a = int(input())

b = [0 for i in range(15)]
j = 0
c = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
d = [0 for i in range(101)]
p = 0
pp = 0
g = 0
gg = 0
ggg = 0
co = 0
for i in range(1,101):
  k = i
  while True:
    if k % c[j] == 0 and k >= c[j]:
      b[j] += 1
      k //= c[j]
    else:
      j += 1
      if j == 15:
        j = 0
        break
  for k in range(15):
    if b[k] >= 74:
      g += 1
    if b[k] >= 24:
      gg += 1
    if b[k] >= 14:
      ggg += 1
    if b[k] >= 4:
      p += 1
    if b[k] >= 2:
      pp += 1
  if i >= 10:
    d[i] = cmb(p, 2)*cmb((pp-2), 1) + cmb(g, 1) + cmb(gg, 1)*cmb((pp-1), 1) + cmb(ggg, 1)*cmb((p-1), 1)
  p = 0
  pp = 0
  g = 0
  gg = 0
  ggg = 0
print(d[a])

Submission status: Wrong Answer

Solution code:
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n;

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p;
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result;

a = int(input())

b = [0 for i in range(15)]
j = 0
c = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
d = [0 for i in range(101)]
p = 0
pp = 0
g = 0
gg = 0
ggg = 0
co = 0
for i in range(1,101):
  k = i
  while True:
    if k % c[j] == 0 and k >= c[j]:
      b[j] += 1
      k //= c[j]
    else:
      j += 1
      if j == 15:
        j = 0
        break
  for k in range(15):
    if b[k] >= 74:
      g += 1
    if b[k] >= 24:
      gg += 1
    if b[k] >= 14:
      ggg += 1
    if b[k] >= 4:
      p += 1
    if b[k] >= 2:
      pp += 1
  print(g,gg,ggg,p,pp)
  if i >= 10:
    d[i] = cmb(p, 2)*cmb((pp-2), 1) + cmb(g, 1) + cmb(gg, 1)*cmb((pp-1), 1) + cmb(ggg, 1)*cmb((p-1), 1)
  p = 0
  pp = 0
  g = 0
  gg = 0
  ggg = 0
print(d)

Submission status: Wrong Answer

Solution code:
n = int(input())

def factorial(n):
    a = 1
    for i in range(1, n+1):
        a *= i
    return a

def comb(n,r):
    if r <= 0:
        return 1
    return factorial(n) // (factorial(n-r) * factorial(r))

ans = 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 1, 0], [88, 44, 21, 14, 8, 7, 5, 4, 4, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [88, 45, 21, 14, 8, 7, 5, 4, 4, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [89, 45, 21, 14, 8, 7, 5, 4, 4, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [89, 45, 22, 14, 8, 7, 5, 5, 4, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [94, 46, 22, 14, 8, 7, 5, 5, 4, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [94, 46, 22, 14, 8, 7, 5, 5, 4, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [95, 46, 22, 16, 8, 7, 5, 5, 4, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [95, 48, 22, 16, 9, 7, 5, 5, 4, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [97, 48, 24, 16, 9, 7, 5, 5, 4, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]

p = ppp[n-1]

i2, i4, i14, i24, i74 = 0,0,0,0,0
for x in p:
    if 2 <= x < 4:
        i2 += 1
    elif 4 <= x < 14:
        i4 += 1
    elif 14 <= x < 24:
        i14 += 1
    elif 24 <= x < 74:
        i24 += 1
    elif 74 < x:
        i74 += 1
    else:
        pass

ans = 0
#1
ans += comb(i4+i14+i24+i74, 3) * 3
ans += comb(i4+i14+i24+i74, 2) * i2

#2
ans += comb(i14+i24+i74, 2) * 2
ans += (i14+i24+i74) * i4

#3
ans += comb(i24+i74, 2) * 2
ans += (i24+i74) * (i2+i4+i14)

#4
ans += i74

print(ans)

Submission status: Wrong Answer

Solution code:
a = int(input())

k = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 4, 4, 7, 7, 7, 7, 10, 10, 16, 16, 16, 16, 16, 16, 22, 22, 22, 22, 28, 28, 28, 28, 28, 28, 40, 40, 50, 50, 50, 50, 50, 50, 65, 65, 65, 65, 65, 65, 80, 80, 80, 80, 95, 95, 95, 95, 95, 95, 119, 119, 119, 119, 119, 119, 140, 140, 168, 168, 168, 168, 168, 168, 196, 196, 196, 196, 224, 224, 224, 224, 224, 224, 264, 264, 300, 300, 300, 300, 300, 300, 300]

print(k[a])

Submission status: Wrong Answer

Solution code:
N = int(input())

prime = [0] * 101

for i in range(2, N + 1):
    temp = i

    for j in range(2, N + 1):
        while temp % j == 0:
            prime[j] += 1
            temp //= j

        if temp == 1:
            break

ans = 0

for i in range(2, N + 1):
    temp1 = prime[i]

    if temp1 == 0:
        continue
    
    if temp1 >= 74:
        ans += 1
    
    for j in range(i + 1, N + 1):
        temp2 = prime[j]

        if temp2 == 0:
            continue
        
        temp_list = [temp1, temp2]
        temp_list.sort()
        
        if temp_list[0] >= 4 and temp_list[1] >= 14:
            ans += 1

        if temp_list[0] >= 2 and temp_list[1] >= 24:
            ans += 1
        
        for k in range(j + 1, N + 1):
            temp3 = prime[k]

            if temp3 == 0:
                continue
            
            temp_list = [temp1, temp2, temp3]
            temp_list.sort()
            
            if temp_list[0] >= 2 and temp_list[1] >= 4 and temp_list[2] >= 4:
                ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())


def prime_factorize(num):
    """
    This function performs prime factorization on the input natural number.
    The result is returned in the form of a dictionary with the prime number as the key
    and its number as the value.
    :param num:
    :return prime_factor: Dictionary with the prime number as the key and its number as the value.
    """
    prime_factor = {}
    i = 2
    while i ** 2 <= num:
        while num % i == 0:
            num //= i
            if i in prime_factor.keys():
                prime_factor[i] += 1
            else:
                prime_factor[i] = 1
        i += 1
    if num > 1:
        prime_factor[num] = 1
    return prime_factor


import math

fac = math.factorial(N)
prime_fac = prime_factorize(fac)

count = 0
upper_two = {}
upper_four = {}
upper_15 = {}
upper_24 = {}
upper_74 = {}


for k, v in prime_fac.items():
    if v >= 2:
        upper_two[k] = v
    if v >= 4:
        upper_four[k] = v
    if v >= 14:
        upper_15[k] = v
    if v >= 24:
        upper_24[k] = v
    if v >= 74:
        upper_74[k] = v


if len(upper_four) <= 2:
    print(0)
    exit()
upper_two = len(upper_two)
upper_four = len(upper_four)
upper_15 = len(upper_15)
upper_24 = len(upper_24)
upper_74 = len(upper_74)


ans = upper_four*(upper_four - 1) * (upper_two-2)//2 \
     + upper_74 + upper_24 * (upper_two-1) + upper_15 * (upper_four-1)


print(ans)