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:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import bisect
import collections

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

def LI(): return list(map(int, sys.stdin.readline().split()))
N = int(input())


def factorint(N):

    table = []
    while(N > 1):
        for i in range(2,N+1):
            if N%i == 0:
                while N%i == 0:
                    N = N//i
                    table.append(i)
                break
    # print(table_)
    return table

l = []
for n in range(1,N+1):
    l += factorint(n)
# print(l)
c = collections.Counter(l)
# print(c)
c[1] = 0
ans = 0
com = {74:0,24:0,4:0,2:0,14:0}
for key in c.keys():
    if c[key] >= 74:
        com[74] = +1
    if c[key] >= 24:
        com[24] = +1
    if c[key] >= 14:
        com[14] += 1
    if c[key] >= 4:
        com[4] += 1
    if c[key] >= 2:
        com[2] += 1
# print(com)
ans += com[74]
ans += com[24] * (com[2] - com[24])
ans += com[14] * (com[14] - com[2])
if com[4] >= 2:
    ans += com[4] * (com[4] - 1)//2 * (com[2] - 2)
print(ans)

Submission status: Wrong Answer

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import bisect
import collections

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

def LI(): return list(map(int, sys.stdin.readline().split()))
N = int(input())


def factorint(N):

    table = []
    while(N > 1):
        for i in range(2,N+1):
            if N%i == 0:
                while N%i == 0:
                    N = N//i
                    table.append(i)
                break
    # print(table_)
    return table

l = []
for n in range(1,N+1):
    l += factorint(n)
# print(l)
c = collections.Counter(l)
# print(c)
c[1] = 0
ans = 0
com = {74:0,24:0,4:0,2:0,14:0}
for key in c.keys():
    if c[key] >= 74:
        com[74] = +1
    if c[key] >= 24:
        com[24] = +1
    if c[key] >= 14:
        com[14] += 1
    if c[key] >= 4:
        com[4] += 1
    if c[key] >= 2:
        com[2] += 1
print(com)
ans += com[74]
ans += com[24] * (com[2] - com[24])
ans += com[14] * (com[14] - com[2])
if com[4] >= 2:
    ans += com[4] * (com[4] - 1)//2 * (com[2] - 2)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
prime_number = [2, 3, 5, 7]
prim = [2, 3, 5, 7]

#素数作成
for i in range(2, 101):
	prime_flag = True
	for j in prim:
		if i % j == 0:
			prime_flag = False
			break
			
	if prime_flag:
		prime_number.append(i)
	
prime_factor = [0] * len(prime_number)

for i in range(2, N + 1):
	tmp = i
	for j in range(len(prime_number)):
		while tmp % prime_number[j] == 0:
			prime_factor[j] += 1
			tmp //= prime_number[j]
			
count4 = 0
count2 = 0

for i in prime_factor:
	if i >= 2:
		count2 += 1
		if i >= 4:
			count4 += 1

if count4 >= 2:		
	combination4 = count4 * (count4 - 1) // 2
else:
	combination4 = 0
	
ans = combination4 * (count2 - 2)
print(ans)
#print(prime_factor)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
prime_number = [2, 3, 5, 7]
prim = [2, 3, 5, 7]

#素数作成
for i in range(2, 101):
	prime_flag = True
	for j in prim:
		if i % j == 0:
			prime_flag = False
			break
			
	if prime_flag:
		prime_number.append(i)
	
prime_factor = [0] * len(prime_number)

for i in range(2, N + 1):
	for j in range(len(prime_number)):
		if i % prime_number[j] == 0:
			prime_factor[j] += i // prime_number[j]
			
count4 = 0
count2 = 0

for i in range(len(prime_number)):
	if prime_factor[i] >= 2:
		count2 += 1
		if prime_factor[i] >= 4:
			count4 += 1

if count4 >= 2:		
	combination4 = math.factorial(count4) // math.factorial(count4 - 2) // 2
else:
	combination4 = 0
ans = combination4 * (count2 - 2)
print(ans)
#print(prime_factor)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
prime_number = [2, 3, 5, 7]
prim = [2, 3, 5, 7]

#素数作成
for i in range(2, 101):
	prime_flag = True
	for j in prim:
		if i % j == 0:
			prime_flag = False
			break
			
	if prime_flag:
		prime_number.append(i)
	
prime_factor = [0] * len(prime_number)

for i in range(2, N + 1):
	for j in range(len(prime_number)):
		if i % prime_number[j] == 0:
			prime_factor[j] += i // prime_number[j]
			
count4 = 0
count2 = 0

for i in range(len(prime_number)):
	if prime_factor[i] >= 2:
		count2 += 1
		if prime_factor[i] >= 4:
			count4 += 1

if count4 >= 2:		
	combination4 = math.factorial(count4) // math.factorial(count4 - 2) // 2
else:
	combination4 = 0
ans = combination4 * (count2 - 2)
print(ans)
print(prime_factor)

Submission status: Wrong Answer

Solution code:
d = [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]
def make_divisors(n):
    div = {}
    for i in d:
        if i > n:
            break
        while n % i == 0:
            n /= i
            if i not in div:
                div[i] = 1
            else:
                div[i] += 1
    # divisors.sort()
    return div

N = int(input())
c = {}
for i in range(2,N+1):
    for div,count in make_divisors(i).items():
        if div not in c:
            c[div] = count
        else:
            c[div] += count

#print(c)
ans = 0
four = [key for key in c.keys() if c[key] >= 4]
two = [key for key in c.keys() if c[key] >= 2]
for key1 in four:
    for key2 in four:
        if key1 >= key2:
            continue
        for key3 in two:
            if key3 in [key1, key2]:
                continue
            #print(key1,key2,key3)
            ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
#コピペ！！！
N = int(input())
e = [0]*(N+1)
for i in range(2, N+1):   #N!の素因数分解
    cur = i
    for j in range(2, i+1):
        while cur % j == 0:
            e[j] += 1
            cur //= j
def num(m):              # e の要素のうち m 以上のものの個数
    return len(list(filter(lambda x: x >= m, e)))

print(num(74) + num(24) * (num(2) - 1) + (num(4) - 1) * num(14) + (num(2) - 2) * (num(4) - 1)//2*num(4))

Submission status: Wrong Answer

Solution code:
n = int(input())
lis=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
li=[]
a=0
b=0
c=0
d=0
e=0
for i in range(15):
    p=n
    q=0
    while(p>0):
        q+=p//lis[i]
        p=p//lis[i]
    if q>=74:
        e+=1
    if q>=24:
        print(lis[i])
        a+=1
    if q>=14:
        print(lis[i])
        b+=1
    if q>=4:
        print(lis[i])
        c+=1
    if q>=2:
        print(lis[i])
        d+=1
ans=a*(d-1)+b*(c-1)+(c*(c-1))//2*(d-2)+e
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
from math import factorial


def perm(n, r):
    return factorial(n) // factorial(n - r)


def comb(n, r):
    return perm(n, r) // factorial(r)


def get_divisors(n):
    divisors = defaultdict(lambda: 0)
    while n % 2 == 0:
        n //= 2
        divisors[2] += 1
    div = 3
    while n != 1:
        if n % div == 0:
            n //= div
            divisors[div] += 1
        else:
            div += 2
    return divisors


N = int(input())
D = defaultdict(lambda: 0)
for n in range(N, 0, -1):
    for k, v in get_divisors(n).items():
        D[k] += v
keys_four = {k for k, v in D.items() if v >= 4}
keys_two = {k for k, v in D.items() if 2 <= v < 4}
ans = 0
if len(keys_four) >= 3:
    ans += comb(len(keys_four), 2) * comb(len(keys_four) - 2, 1)
if len(keys_four) >= 2 and len(keys_two) >= 1:
    ans += comb(len(keys_four), 2) * comb(len(keys_two), 1)
print(ans)

Submission status: Wrong Answer

Solution code:
import math
from collections import Counter
from scipy.misc import comb
n = int(input())

def primes(m) :
    ps = [2]
    for i in range(3, m) :
        for p in ps :
            if i%p == 0 :
                break
        else :
            ps.append(i)
    return ps

def fdivisor(m) :
    ps = primes(m)
    df = {p:0 for p in ps}
    for i in range(1, m+1) :
        ii = i
        while ii != 1 :
            for p in ps :
                if ii%p == 0 :
                    df[p] += 1
                    ii //= p
    return df

ans = 0
df = fdivisor(n)
over2 = len([v for v in df.values() if v >= 2])
over4 = len([v for v in df.values() if v >= 4])
over14 = len([v for v in df.values() if v >= 14])
over24 = len([v for v in df.values() if v >= 24])
over74 = len([v for v in df.values() if v >= 74])
ans += comb(over4, 2, exact=True)*comb(over2-2, 1)
ans += comb(over14, 1)*comb(over4-1, 1)
ans += comb(over24, 1)*comb(over2-1, 1)
ans += comb(over74, 1)

print(int(ans))

Submission status: Wrong Answer

Solution code:
import math
from collections import Counter
from scipy.misc import comb
n = int(input())

def primes(m) :
    ps = [2]
    for i in range(3, m) :
        for p in ps :
            if i%p == 0 :
                break
        else :
            ps.append(i)
    return ps

def fdivisor(m) :
    ps = primes(m)
    df = {p:0 for p in ps}
    for i in range(1, m+1) :
        ii = i
        while ii != 1 :
            for p in ps :
                if ii%p == 0 :
                    df[p] += 1
                    ii //= p
    return df

ans = 0
df = fdivisor(n)
over2 = len([v for v in df.values() if v >= 2])
over4 = len([v for v in df.values() if v >= 4])
over14 = len([v for v in df.values() if v >= 14])
over24 = len([v for v in df.values() if v >= 24])
over74 = len([v for v in df.values() if v >= 74])
ans += comb(over4, 2)*comb(over2-2, 1)
ans += comb(over14, 1)*comb(over4-1, 1)
ans += comb(over24, 1)*comb(over2-1, 1)
ans += comb(over74, 1)

print(int(ans))

Submission status: Wrong Answer

Solution code:
def factorize(n):
    t = n
    ret = []
    for i in range(2, int(n ** 0.5) + 1):
        while (t % i == 0):
            t //= i
            ret.append(i)
    if t > 1:
        ret.append(t)
    return ret


N = int(input())
d = []
for n in range(1, N + 1):
    d.extend(factorize(n))
d.sort()
ds = set(d)
dn = [0] * 101
for c in ds:
    dn[c] = d.count(c)
ans = 0
t = []
for i in ds:
    for j in ds:
        if i == j:
            continue
        for k in ds:
            if i == k or j == k:
                continue
            for l in [0, 2, 4, 14, 24]:
                if l <= dn[i]:
                    for m in [0, 2, 4, 14, 24]:
                        if m <= dn[j]:
                            for n in [0, 2, 4, 14, 24]:
                                if n <= dn[k]:
                                    c = (l + 1) * (m + 1) * (n + 1)
                                    if c == 75:
                                        e = i ** l * j ** m * k ** n
                                        if not e in t:
                                            ans += 1
                                            t += [e]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

# N!の約数で約数をちょうど75個持つものは何個あるか
primes = []
primes4 = []
primes14 = []

for x in range(2,N//2+1):
    isPrime = True
    for i in range(2, x):
        if x % i == 0:
            isPrime = False
            break
    if isPrime:
        primes.append(x)


for p in primes:
    cnt = 0
    for i in range(1, 7):
        cnt += N // (p ** i)
    if cnt >= 14:
        primes14.append(p)
    if cnt >=4:
        primes4.append(p)



res = 0
n = len(primes)
n4 = len(primes4)
n14 = len(primes14)

# 3,25のパターン
if 28 <= N < 54:
    res += n - 1
elif 54 <= N < 100:
    res += 2 * (n - 1)
elif N == 100:
    res += 3 * (n - 1)

# 75のパターン
if 76 <= N:
    res += 1

# 3,5,5のパターン
if n4 >= 2:
    res += (n - 2) * n4 * (n4 - 1) // 2

# 5, 15 のパターン
if n14 > 0:
    res += (n4-1)*n14

print(res)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
import itertools

N=input()

Parts=defaultdict(lambda: 0)

for i in range(1,N+1):
	num_sqrt=int(i**0.5)+2

	for n in range(2,num_sqrt):
		while i%n==0:
			i/=n
			Parts[n]+=1
	else:
		if i!=1:
			Parts[i]+=1

L=[]
for x in Parts.values():
	L.append( range(x+1) )


K=list(itertools.product(*L))	#Kouho

K=[(4,4,2,0)]

ans=0
for x in K:
	multiple=1
	for v in x:
		multiple*=(v+1)
	if multiple==75:
		ans+=1


print ans

Submission status: Wrong Answer

Solution code:
def isPrime(N):
    if N == 1:
        return False
    elif N == 2:
        return True
    for i in range(2,int(N**0.5+1)):
        if N % i == 0:
            return False
    return True
prime = []
N = int(input())
for i in range(1,N+1):
    if isPrime(i):
        prime.append(i)
cnt2, cnt4, cnt14, cnt24, cnt74 = 0, 0, 0, 0,0
for i in range(len(prime)):
    tmp = prime[i]
    cnt = 0
    while tmp <= N:
        cnt += N//tmp
        tmp = tmp**2
    if 2 <= cnt < 4:
        cnt2 += 1
    elif 4 <= cnt < 14:
        cnt4 += 1
    elif 14 <= cnt < 24:
        cnt14 += 1
    elif 24 <= cnt < 74:
        cnt24 += 1
    elif 74 <= cnt:
        cnt74 += 1
ans = (cnt2*(cnt4+cnt14+cnt24+cnt74)*(cnt4+cnt14+cnt24+cnt74-1))//2 + ((cnt4+cnt14+cnt24+cnt74)*(cnt4+cnt14+cnt24+cnt74-1)*(cnt4+cnt14+cnt24+cnt74-2))//6
ans += cnt4*(cnt14+cnt24+cnt74) + ((cnt14+cnt24+cnt74)*(cnt14+cnt24+cnt74-1))//2
ans += cnt2*(cnt24+cnt74) + (cnt4+cnt14)*(cnt24+cnt74) + ((cnt24+cnt74)*(cnt24+cnt74-1))//2
ans += cnt74
print(ans)

Submission status: Wrong Answer

Solution code:
def isPrime(N):
    if N == 1:
        return False
    elif N == 2:
        return True
    for i in range(2,int(N**0.5+1)):
        if N % i == 0:
            return False
    return True
prime = []
N = int(input())
for i in range(1,N+1):
    if isPrime(i):
        prime.append(i)

cnt2, cnt4, cnt14, cnt24 = 0, 0, 0, 0
for i in range(len(prime)):
    tmp = prime[i]
    cnt = 0
    while tmp <= N:
        cnt += N//tmp
        tmp = tmp**2
    if 2 <= cnt < 4:
        cnt2 += 1
    elif 4 <= cnt < 14:
        cnt4 += 1
    elif 14 <= cnt < 24:
        cnt14 += 1
    elif 24 <= cnt:
        cnt24 += 1

ans = (cnt2*(cnt4+cnt14+cnt24)*(cnt4+cnt14+cnt24-1))//2 + ((cnt4+cnt14+cnt24)*(cnt4+cnt14+cnt24-1)*(cnt4+cnt14+cnt24-2))//6

ans += cnt4*(cnt14+cnt24) + ((cnt14+cnt24)*(cnt14+cnt24-1))//2

ans += cnt2*cnt24 + (cnt4+cnt14)*cnt24 + (cnt24*(cnt24-1))//2
print(ans)

Submission status: Wrong Answer

Solution code:
def isPrime(N):
    if N == 1:
        return False
    elif N == 2:
        return True
    for i in range(2,int(N**0.5+1)):
        if N % i == 0:
            return False
    return True
prime = []
N = int(input())
for i in range(1,N+1):
    if isPrime(i):
        prime.append(i)
cnt2, cnt4, cnt14, cnt24 = 0, 0, 0, 0
for i in range(len(prime)):
    tmp = prime[i]
    cnt = 0
    while tmp <= N:
        cnt += N//tmp
        tmp = tmp**2
    if 2 <= cnt < 4:
        cnt2 += 1
    elif 4 <= cnt < 14:
        cnt4 += 1
    elif 14 <= cnt < 24:
        cnt14 += 1
    elif 24 <= cnt:
        cnt24 += 1
ans = cnt2*(cnt4+cnt14+cnt24)*(cnt4+cnt14+cnt24-1) + (cnt4+cnt14+cnt24)*(cnt4+cnt14+cnt24-1)*(cnt4+cnt14+cnt24-2)
ans += cnt4*(cnt14+cnt24) + (cnt14+cnt24)*(cnt14+cnt24-1)
ans += cnt2*cnt24 + (cnt4+cnt14)*cnt24 + cnt24*(cnt24-1)
print(ans)

Submission status: Wrong Answer

Solution code:
def sol():
    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):
        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)

    ans=0
    for i in range(n+1):
        if e[i]>74: ans+=1


    for i in range(n+1):
        for j in range(n+1):
            if i!=j and e[i]>74 and e[j]>2: ans+=1

    for i in range(n+1):
        for j in range(n+1):
            if i!=j and e[i]>14 and e[j]>4: ans+=1

    for i in range(n+1):
        for j in range(n+1):
            for k in range(n+1):
                if i!=j and i!=k and j!=k and e[i]>4 and e[j]>4 and e[k]>2: ans+=1
    print(ans)

if __name__=="__main__":
    sol()

Submission status: Wrong Answer

Solution code:
# 75数を列挙して、N!を割り切れるかどうかで判定
from math import factorial, sqrt


def comb(n, r):  # n個からr個選ぶ場合の数
    if n < r:
        return 0
    else:
        return factorial(n)//(factorial(r) * factorial(n-r))


N = int(input())
fact = [0]*(N+1)
# それぞれを素因数分解
for i in range(2, N + 1):
    for j in range(2, i+1):
        while i % j == 0:
            i //= j
            fact[j] += 1
over4 = 0
over2 = 0
over24 = 0
over14 = 0
over75 = 0
for f in fact:
    if f >= 2:
        if f >= 4:
            over4 += 1
            if f >= 14:
                over14 += 1
            if f >= 24:
                over24 += 1
            if f >= 75:
                over75 += 1
        else:
            over2 += 1
ans = (comb(over4, 2) * over2) + comb(over4, 3) * 3 + \
    (over14) * (over4 - 1) + over24 * ((over4 - 1) + (over2))+over75

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
pdic= [0]*(101) #素因数分解
def prime_dic(n):
    p = 2
    while n>1:
        c = 0
        while n%p==0:
            c+=1
            n //= p
            if c>0:
                pdic[p] += c
        p += 1
for i in range(1,n+1):
    prime_dic(i)
def num(m):
    return len(list(filter(lambda x:x>=m-1,pdic)))
print(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)+num(5)*(num(5)-1)*(num(3)-2)//2)

Submission status: Wrong Answer

Solution code:
N = int(input())

elem = [0 for _ in range(N+1)]

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

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

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

Submission status: Wrong Answer

Solution code:
from math import factorial
from math import sqrt
from math import ceil
from itertools import permutations
from heapq import *
from collections import defaultdict
from copy import deepcopy
from math import log

N=int(input())
def nCr(n,r):
    if n<r:
        return 0
    a=factorial(n)
    b=factorial(n-r)
    c=factorial(r)
    return a//(b*c)
f=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
a=0
b=0
c=0
d=0
e=0
for F in f:
    s=sum([N/(F**i) for i in range(1,7)])
    if s>=74:
        e+=1
    elif s>=24:
        d+=1
    elif s>=14:
        c+=1
    elif s>=4:
        b+=1
    elif s>=2:
        a+=1
print(nCr(b+c+d+e,2)*a+nCr(b+c+d+e,3)*3+(c+d+e)*(max(b+c+d+e-1,0))+(e+d)*(max(0,a+b+c+d+e-1))+e)

Submission status: Wrong Answer

Solution code:
from math import factorial
from math import sqrt
from math import ceil
from itertools import permutations
from heapq import *
from collections import defaultdict
from copy import deepcopy
from math import log

N=int(input())
def nCr(n,r):
    if n<r:
        return 0
    a=factorial(n)
    b=factorial(n-r)
    c=factorial(r)
    return a//(b*c)
f=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
a=0
b=0
c=0
d=0
e=0
for F in f:
    s=sum([N/(F**i) for i in range(1,7)])
    if s>=74:
        e+=1
    elif s>=24:
        d+=1
    elif s>=14:
        c+=1
    elif s>=4:
        b+=1
    elif s>=2:
        a+=1
print(nCr(b+c+d+e,2)*a+nCr(b+c+d+e,3)*3+(c+d+e)*(b+c+d+e-1)+(e+d)*(a+b+c+d+e-1)+e)

Submission status: Wrong Answer

Solution code:

from collections import defaultdict

def get_yakusuu(num):
    yakusuu_dic = defaultdict(int)
    seed_primes = [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]
    for now_num in range(1, num + 1):
        for num_ele in seed_primes:
            if now_num < num_ele:
                break
            while now_num % num_ele == 0:
                yakusuu_dic[num_ele] += 1
                now_num = now_num // num_ele
    return list(yakusuu_dic.values())

def calc(yakusuu_dic, lim):
    count = 0
    for num in yakusuu_dic:
        if num >= lim:
            count += 1
        else:
            break
    return count

def main():
    num = int(input())
    yakusuu_dic = get_yakusuu(num)
    yakusuu_dic.sort(reverse=True)

    up_4 = calc(yakusuu_dic, 4)
    up_2 = calc(yakusuu_dic, 2)
    ans1 = max(up_4 * (up_4 - 1) * (up_2 - 2) // 2, 0)

    up_24 = calc(yakusuu_dic, 24)
    ans2 = max(up_24 * (up_2 - 1), 0)

    up_14 = calc(yakusuu_dic, 14)
    ans3 = max(up_14 * (up_4 - 1), 0)

    up_75 = calc(yakusuu_dic, 75)
    ans4 = up_75

    ans = ans1 + ans2 + ans3 + ans4

    print(ans)




if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
import math
p=math.factorial(n)
q=int(math.sqrt(p)//1)
count=0
for i in range(1,q+1):
  if p % (i**2) == 0:
    a=0
    for j in range(1,i):
      if i % j == 0:
        a+=1
    if a==37:
      count+=1
print(count)

Submission status: Wrong Answer

Solution code:
import bisect
from math import factorial as fact
import sys
input = sys.stdin.readline

N = int(input())
prime = []
p_flag = [False] * (101)
p_flag[0] = p_flag[1] = True

for i in range(2, 101):
    if not p_flag[i]:
        prime.append(i)
        for j in range(2*i, 101, i):
            p_flag[j] = True

M = len(prime)
factor = [0]*M

for i in range(2, N+1):
    for j in range(M):
        tmp = prime[j]
        while i % tmp == 0:
            factor[j] += 1
            tmp *= tmp

factor = factor[::-1]
point74 = M - bisect.bisect_left(factor, 74)
point24 = M - bisect.bisect_left(factor, 24)
point14 = M - bisect.bisect_left(factor, 14)
point4 = M - bisect.bisect_left(factor, 4)
point2 = M - bisect.bisect_left(factor, 2)

if N < 10:
    ans = 0
else:
    ans = fact(point4)//(fact(point4-2)*fact(2)) * (point2-2)
    if point14 > 0:
        ans += point14 * (point4-1)
    if point24 > 0:
        ans += point24 * (point2-1)
    if point74 > 0:
        ans += point74

print(ans)

Submission status: Wrong Answer

Solution code:
primes = [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]

def get_prime(n, count = {p: 0 for p in primes}):
    for p in primes:
        cp = n
        while cp != 0 and cp % p == 0:
            count[p] += 1
            cp = cp // p
    return count

cnt = {p: 0 for p in primes}
for i in range(1, int(input())+1):
    get_prime(i, cnt)

res = 0
for p1 in primes:
    if cnt[p1] >= 4:
        for p2 in primes:
            if cnt[p2] >= 4 and p1 > p2:
                for p3 in primes:
                    if cnt[p3] >= 2 and p3 != p1 and p3 != p2:
                        res += 1

for p1 in primes:
    if cnt[p1] >= 14:
        for p2 in primes:
            if cnt[p2] >= 4 and p1 != p2:
                res += 1

for p1 in primes:
    if cnt[p1] >= 24:
        for p2 in primes:
            if cnt[p2] >= 2 and p1 != p2:
                res += 1

for p1 in primes:
    if cnt[p1] >= 75:
        res += 1

print(res)

Submission status: Wrong Answer

Solution code:
from math import*
from collections import*
def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b += 1
    if n > 1:
        fct.append(n)
    if len(fct)==0:
        fct.append(1)
    return fct
    
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

l=[]
for i in range(1,int(input())+1):
    l.extend(factorize(i))
    
x=[v for k,v in Counter(l).items() if v>=2] #ここからどう3,5,5選べるか
#print(x)
s=[i for i in x if 3>=i>=2]
t=[i for i in x if i>=4]
r=[i for i in x if i>=24]
p=[i for i in x if 13>=i>=4]
e=[i for i in x if i>=14]
m=[i for i in x if i>=74]

#print(s,t)
ans=0
if len(s)==0 or len(t)<2:
    print(0)
else:
    if len(t)>1:
        ans+=len(s)*cmb(len(t),2)
    if len(t)>2:
        ans+=cmb(len(t),3) #3,5,5
    if len(r)>1:
        ans+=len(s)*len(r)+cmb(len(r),2) #3,25
    if len(e)>1:
        ans+=len(e)*len(p)+cmb(len(e),2) #15,5
    if len(m)>0:
        ans+=len(m) #75
    print(ans)

Submission status: Wrong Answer

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

for i in range(1,N+1):
    j=2
    while i!=1:
        if i%j==0:
            i//=j
            div[j]+=1
        else: j+=1

a,b,c,d,e=0,0,0,0,0
for i in range(N+1):
    if div[i]>74: e+=1
    if div[i]>24:
        a+=1
        b+=1
        c+=1
        d+=1
    elif div[i]>14: 
        a+=1
        b+=1
        c+=1
    elif div[i]>=4:
        a+=1
        b+=1
    elif div[i]>=2:
        a+=1

if a<3 or b<2: print(0)
else:
    ans=b*(b-1)*(a-2)//2
    ans+=d*(a-1)
    ans+=c*(b-1)
    ans+=e
    print(ans)

Submission status: Wrong Answer

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

for i in range(1,N+1):
    j=2
    while i!=1:
        if i%j==0:
            i//=j
            div[j]+=1
        else: j+=1

print(div)

a,b,c,d,e=0,0,0,0,0
for i in range(N+1):
    if div[i]>74: e+=1
    if div[i]>24:
        a+=1
        b+=1
        c+=1
        d+=1
    elif div[i]>14: 
        a+=1
        b+=1
        c+=1
    elif div[i]>=4:
        a+=1
        b+=1
    elif div[i]>=2:
        a+=1



print(a,b,c,d,e)

if a<3 or b<2: print(0)
else:
    ans=b*(b-1)*(a-2)//2
    ans+=d*(a-1)
    ans+=c*(b-1)
    ans+=e
    print(ans)

Submission status: Wrong Answer

Solution code:
import math
from collections import Counter
import itertools

def prime_factors(n):
  i = 2
  factors = []
  while i * i <= n:
    if n % i==0:
      n //= i
      factors.append(i)
    else:
      i += 1
  if n > 1:
    factors.append(n)
  return factors

n=int(input())
num=math.factorial(n)
factors=prime_factors(num)
es=list(Counter(factors).values())
m=len(es)
ans=0

for i in range(m):
  if es[i]>74:
    ans+=1

for i in range(m):
  for j in range(m):
    if i!=j and es[i]>=24 and es[j]>=2:
      ans+=1

for i in range(m):
  for j in range(m):
    if i!=j and es[i]>=14 and es[j]>=4:
      ans+=1

for i in range(m):
  for j in range(i+1,m):
    for k in range(m):
      if i!=k and j!=k and es[i]>=4 and es[j]>=4 and es[k]>=2:
        ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
primes = [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]

def div_count(n,prime):
    div = prime
    ans = 0
    while n//div > 0:
        ans += n // div
        div *= prime
    return ans

divisor = [div_count(N,p) for p in primes]
ans = 0
k = len([i for i in divisor if i >=2])
l = len([i for i in divisor if i >=4])
if k>=3 and l>=2:
    ans += l*(l-1) * (k-2)

k = len([i for i in divisor if i >=4])
l = len([i for i in divisor if i >=14])
if k>=2 and l>=1:
    ans += l * (k-1)

k = len([i for i in divisor if i >=2])
l = len([i for i in divisor if i >=24])
if k>=2 and l>=1:
    ans += l * (k-1)

k = len([i for i in divisor if i >=74])
if k>=1:
    ans += k

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
print("YES" if N == 3 or N == 5 or N == 7 else "NO")

Submission status: Wrong Answer

Solution code:
n = int(input())
import math
ans = 0
fn = math.factorial(n)
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]


for i in prime:
    for j in prime:
        for k in prime:
            if j != k and i != k and i > j:
                if fn%((i**4)*(j**4)*(k**2)) == 0:
                    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import itertools
# import sympy
N = int(input())


def f(N):
    ans = []
    primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]
    INF = 10**9
    counter = 0
    for a, b, c in itertools.combinations(primes, 3):
        # Nまでにaの倍数
        aa = int(N/a)
        aa = int(aa*(aa+1)/2)
        if aa < 5:
            continue
        bb = int(N/b)
        bb = int(bb*(bb+1)/2)
        if bb < 5:
            continue
        cc = int(N/c)
        cc = int(cc*(cc+1)/2)
        if cc < 3:
            continue

        if cc >= 5:
            counter += 3
            # print("{0}^4 x {1}^4 x {2}^2".format(a, b, c))
            # print("{0}^4 x {1}^4 x {2}^2".format(c, b, a))
            # print("{0}^4 x {1}^4 x {2}^2".format(a, c, b))
            ans.append(a**4*b**4*c**2)
            ans.append(c**4*b**4*a**2)
            ans.append(a**4*c**4*b**2)
        else:
            counter = 1
            # print("{0}^4 x {1}^4 x {2}^2".format(a, b, c))
            ans.append(a**4*b**4*c**2)
    return ans


ans = sorted(f(N))
print(len(ans))

Submission status: Wrong Answer

Solution code:
import numpy as np
def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if num % i == 0:
                divisor_list.append(i)
        divisor_list.append(num)

        return divisor_list
def divisor_len(n):
    table = [0] * (n + 1)# nまでのテーブルを作る
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    return np.sum(np.array(table) == 75)
  
n = int(input())
import math 



a = make_divisor_list(math.factorial(n))[-1]
print(divisor_len(a))

Submission status: Wrong Answer

Solution code:
prime=[2,3,5,7,11,13,17,19,23,29,31]
s=[0 for i in range(11)]
N=int(input())
for i in range(11):
  j=1
  while N//(prime[i]**j)>0:
    s[i]+=N//(prime[i]**j)
    j+=1
o3,o5,o15,o25,o75=0,0,0,0,0
for item in s:
  if item>=2:
    o3+=1
    if item>=4:
      o5+=1
      if item>=14:
        o15+=1
        if item>=24:
          o25+=1
          if item>=74:
            o75+=1
ans=[0,0,0,0]
if o75>0:
  ans[0]+=1
if o25>0:
  ans[1]+=o25*(o3-1)
if o15>0:
  ans[2]+=o15*(o5-1)
if o5>1 and o3>2:
  ans[3]+=o5*(o5-1)*(o3-2)
print(sum(ans))

Submission status: Wrong Answer

Solution code:
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]
print(len(prime))

Submission status: Wrong Answer

Solution code:
N=int(input())

def IsPrime(A):
    prime=[2]
    for a in range(3,A+1):
        for p in prime:
            if a%p==0:
                break
        else:
            prime.append(a)
    return prime


prime=IsPrime(N)
#print(prime)
pcount={}
for p in prime:
    pcount[p]=0
for nn in range(2,N+1):
    for p in prime:
        n=nn
        if n<p:
            break
        while n%p==0:
            n//=p
            pcount[p]+=1
#print(pcount)
mcount={}
for i in [75,25,15,5,3]:
    mcount[i]=0
for p in prime:
    for i in [75,25,15,5,3]:
        if pcount[p]>=i-1:
            mcount[i]+=1
print(mcount)
print(mcount[75]+\
        mcount[25]*(mcount[3]-1)+\
        mcount[15]*(mcount[5]-1)+\
        mcount[5]*(mcount[5]-1)//2*(mcount[3]-2))
#75/25*3/15*5/5*5*3