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:
#!/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
        for x in a:
            d[x] += (tmp >= x)
    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(int(ans), end="")
    return

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

Submission status: Wrong Answer

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
        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(int(ans), end="")
    return

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

Submission status: Wrong Answer

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
        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(int(ans))
    return

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

Submission status: Wrong Answer

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

Solution code:
#D問題
import math
N = int(input())

prime = []
for i in range(2,N+1):
    n = math.ceil(math.log2(i))
    flag = 0
    for j in range(2,n+1):
        if i%j == 0:
            flag = 1
            break
    if flag == 0:
        if i != 49:
            prime.append(i)

count = 0
plen = len(prime)
#(74)
for i in range(plen):
    p = prime[i]
    pc = 0
    while p <= N:
        pc+=(N//p)
        p*=p
    if pc >= 74:
        count+=1
#(2,24)
for i in range(plen):
    for j in range(plen):
        if i == j:
            continue
        p1 = prime[i]
        p2 = prime[j]
        pc1 = 0
        while p1 <= N:
            pc1+=(N//p1)
            p1*=p1
        pc2 = 0
        while p2 <= N:
            pc2+=(N//p2)
            p2*=p2
        if pc1 >= 2 and pc2 >= 24:
            count+=1
#(4,14)
for i in range(plen):
    for j in range(plen):
        if i == j:
            continue
        p1 = prime[i]
        p2 = prime[j]
        pc1 = 0
        while p1 <= N:
            pc1+=(N//p1)
            p1*=p1
        pc2 = 0
        while p2 <= N:
            pc2+=(N//p2)
            p2*=p2
        if pc1 >= 4 and pc2 >= 14:
            count+=1
#(2,4,4)
c = 0
for i in range(plen):
    for j in range(plen):
        if i == j:
            continue
        for k in range(plen):
            if i == k or j == k or j < k:
                continue
            p1 = prime[i]
            p2 = prime[j]
            p3 = prime[k]
            pc1 = 0
            while p1 <= N:
                pc1+=(N//p1)
                p1*=p1
            pc2 = 0
            while p2 <= N:
                pc2+=(N//p2)
                p2*=p2
            pc3 = 0
            while p3 <= N:
                pc3+=(N//p3)
                p3*=p3
            if pc1 >= 2 and pc2 >= 4 and pc3 >= 4:
                c+=1
            
count+=c

print(count)
#print(prime)

Submission status: Wrong Answer

Solution code:
#D問題
import math
N = int(input())

prime = []
for i in range(2,N+1):
    n = math.ceil(math.log2(i))
    flag = 0
    for j in range(2,n+1):
        if i%j == 0:
            flag = 1
            break
    if flag == 0:
        if i != 49:
            prime.append(i)

count = 0
plen = len(prime)
#(74)
for i in range(plen):
    p = prime[i]
    pc = 0
    while p <= N:
        pc+=(N//p)
        p*=p
    if pc >= 74:
        count+=1
#(2,24)
for i in range(plen):
    for j in range(plen):
        if i == j:
            continue
        p1 = prime[i]
        p2 = prime[j]
        pc1 = 0
        while p1 <= N:
            pc1+=(N//p1)
            p1*=p1
        pc2 = 0
        while p2 <= N:
            pc2+=(N//p2)
            p2*=p2
        if pc1 >= 2 and pc2 >= 24:
            count+=1
#(4,14)
for i in range(plen):
    for j in range(plen):
        if i == j:
            continue
        p1 = prime[i]
        p2 = prime[j]
        pc1 = 0
        while p1 <= N:
            pc1+=(N//p1)
            p1*=p1
        pc2 = 0
        while p2 <= N:
            pc2+=(N//p2)
            p2*=p2
        if pc1 >= 4 and pc2 >= 14:
            count+=1
#(2,4,4)
c = 0
for i in range(plen):
    for j in range(plen):
        if i == j:
            continue
        for k in range(plen):
            if i == k or j == k:
                continue
            p1 = prime[i]
            p2 = prime[j]
            p3 = prime[k]
            pc1 = 0
            while p1 <= N:
                pc1+=(N//p1)
                p1*=p1
            pc2 = 0
            while p2 <= N:
                pc2+=(N//p2)
                p2*=p2
            pc3 = 0
            while p3 <= N:
                pc3+=(N//p3)
                p3*=p3
            if pc1 >= 2 and pc2 >= 4 and pc3 >= 4:
                c+=1
            
count+=(c//2)

print(count)
#print(prime)

Submission status: Wrong Answer

Solution code:
#D問題
import math
N = int(input())
fact = 1
for i in range(1,N+1):
    fact*=i
prime = []
for i in range(2,N+1):
    n = math.ceil(math.log2(i))
    flag = 0
    for j in range(2,n+1):
        if i%j == 0:
            flag = 1
            break
    if flag == 0:
        prime.append(i)

count = 0
plen = len(prime)
#(74)
for p in prime:
    np = N//p
    pc = 0
    while p <= N:
        pc+=(N//p)
        p*=p
    if pc >= 74:
        count+=1
#(2,24)
for i in range(plen):
    for j in range(plen):
        if i == j:
            continue
        p1 = prime[i]
        p2 = prime[j]
        np1 = N//p1
        np2 = N//p2
        pc1 = 0
        while p1 <= N:
            pc1+=(N//p1)
            p1*=p1
        pc2 = 0
        while p2 <= N:
            pc2+=(N//p2)
            p2*=p2
        if pc1 >= 2 and pc2 >= 24:
            count+=1
#(4,14)
for i in range(plen):
    for j in range(plen):
        if i == j:
            continue
        p1 = prime[i]
        p2 = prime[j]
        np1 = N//p1
        np2 = N//p2
        pc1 = 0
        while p1 <= N:
            pc1+=(N//p1)
            p1*=p1
        pc2 = 0
        while p2 <= N:
            pc2+=(N//p2)
            p2*=p2
        if pc1 >= 4 and pc2 >= 14:
            count+=1
#(2,4,4)
c = 0
for i in range(plen):
    for j in range(plen):
        if i == j:
            continue
        for k in range(plen):
            if i == k or j == k:
                continue
            p1 = prime[i]
            p2 = prime[j]
            p3 = prime[k]
            np1 = N//p1
            np2 = N//p2
            np3 = N//p3
            pc1 = 0
            while p1 <= N:
                pc1+=(N//p1)
                p1*=p1
            pc2 = 0
            while p2 <= N:
                pc2+=(N//p2)
                p2*=p2
            pc3 = 0
            while p3 <= N:
                pc3+=(N//p3)
                p3*=p3
            if pc1 >= 2 and pc2 >= 4 and pc3 >= 4:
                c+=1
            
count+=(c//2)

print(count)

Submission status: Wrong Answer

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(100)
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: Wrong Answer

Solution code:
N = int(input())

# 素数^a, 素数^b, 素数^c
# print((a+1)*(b+1)*(c+1) = 約数の数)

primes = [2]
for i in range(3, N+1):
    if all(i % prime != 0 for prime in primes):
        primes.append(i)

count = 0
l = [0]*100
for i in range(N):
    for j in primes:
        if i % j == 0:
            l[j] += 1
    a = 1
    for j in l:
        a *= j+1
    if a == 75:
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n == 1 or n == 2 or n == 3:
    ans = 0
else:
    prime = [2,3]
    fac = [0] * (n+1)
    fac[2] = 1
    fac[3] = 1
    for i in range(4,n+1):
        ii = i
        for j in range(2,i+1):
            det = 0
            if j in prime:
                if ii % j == 0:
                    det = 1
                while ii % j == 0:
                    fac[j] += 1
                    ii = ii // j
            if det == 0:
                prime.append(ii)
    
    #print(fac)
    c = [0] * 5
    for k in range(2,n+1):
        if fac[k] >= 74:
            c[4] += 1
        if fac[k] >= 24:
            c[3] += 1
        if fac[k] >= 14:
            c[2] += 1
        if fac[k] >= 4:
            c[1] += 1
        if fac[k] >= 2:
            c[0] += 1
    #print(c)
    pos = [0] * 4
    pos[0] = (c[1]*(c[1]-1)*(c[1]-2))//6 + (c[1]*(c[1]-1)*(c[0]-c[1]))//2
    pos[1] = c[4]
    pos[2] = (c[2]*(c[2]-1))//2 + c[2]*(c[1]-c[2])
    pos[3] = (c[3]*(c[3]-1))//2 + c[3]*(c[0]-c[3])
    ans = sum(pos)

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n == 1 or n == 2 or n == 3:
    ans = 0
else:
    prime = [2,3]
    fac = [0] * (n+1)
    fac[2] = 1
    fac[3] = 1
    for i in range(4,n+1):
        ii = i
        for j in range(2,i+1):
            det = 0
            if j in prime:
                if ii % j == 0:
                    det = 1
                while ii % j == 0:
                    fac[j] += 1
                    ii = ii // j
            if det == 0:
                prime.append(ii)
    
    print(fac)
    c = [0] * 5
    for k in range(2,n+1):
        if fac[k] >= 74:
            c[4] += 1
        if fac[k] >= 24:
            c[3] += 1
        if fac[k] >= 14:
            c[2] += 1
        if fac[k] >= 4:
            c[1] += 1
        if fac[k] >= 2:
            c[0] += 1
    print(c)
    pos = [0] * 4
    pos[0] = (c[1]*(c[1]-1)*(c[1]-2))//6 + (c[1]*(c[1]-1)*(c[0]-c[1]))//2
    pos[1] = c[4]
    pos[2] = (c[2]*(c[2]-1))//2 + c[2]*(c[1]-c[2])
    pos[3] = (c[3]*(c[3]-1))//2 + c[3]*(c[0]-c[3])
    ans = sum(pos)

print(ans)

Submission status: Wrong Answer

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

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

Solution code:
n = int(input())
prime_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]
divider_list = []
for i in range(1,n+1):
    while i > 1:
        for j in prime_list:
            if i % j == 0:
                divider_list.append(j)
                i = i // j
                break
            else:
                continue
divider_dic = {}
for k in divider_list:
    if k in divider_dic:
        divider_dic[k] = divider_dic[k] + 1
    else:
        divider_dic[k] = 1

key_list = []
for k in divider_dic:
    key_list.append(divider_dic[k])
a, b, c, d, e = 0, 0, 0, 0, 0
for k in key_list:
    if k == 1:
        continue
    elif k < 4:
        a += 1
    elif k < 14:
        b += 1
    elif k < 24:
        c += 1
    elif k < 74:
        d += 1
    else:
        e += 1

def nCr(n, r):
    if n < r:
        return 0
    r = min(r, n - r)
    if r == 0: return 1;
    if r == 1: return n;
    numerator = [n - r + i + 1 for i in range(r)]
    denominator  = [i + 1 for i 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 *= numerator[k]
    return result
print(key_list)
print(a, b, c, d, e)
ans = int(a*nCr(b+c+d+e,2)+nCr(b+c+d+e,2)*(b+c+d+e-2)+b*(c+d+e)+(c+d+e)*(c+d+e-1)+(a+b+c)*(d+e)+(d+e)*(d+e-1)+e)
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
from collections import deque
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()
pr = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]
arr = [0] * 5
num = 1
for i in range(1, n+1):
    num *= i
for n in pr:
    tmp = num
    ct = 0
    while True:
        if tmp % n == 0:
            ct += 1
            tmp //= n
        else:
            break
    if ct >= 74:
        arr[0] += 1
    if ct >= 24:
        arr[1] += 1
    elif ct >= 14:
        arr[2] += 1
    elif ct >= 4:
        arr[3] += 1
    elif ct >= 2:
        arr[4] += 1
#print(*arr)
ans = 0
if arr[0] == 1:
    ans += 1
if sum(arr[0:2]) >= 1:
    ans += ((sum(arr[0:2]) * (sum(arr) - 1)))
if sum(arr[0:3]) >= 1:
    ans += ((sum(arr[0:3]) * (sum(arr[0:4]) - 1)))
if sum(arr[0:4]) >= 2 and arr[4] >= 1:
    s = sum(arr[0:4])
    ans += (s * (s-1) * (s-2) // 2)
    ans += (arr[4] * s * (s-1) // 2)
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
from collections import deque
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()
pr = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]
arr = [0] * 5
num = 1
for i in range(1, n+1):
    num *= i
for n in pr:
    tmp = num
    ct = 0
    while True:
        if tmp % n == 0:
            ct += 1
            tmp //= n
        else:
            break
    if ct >= 74:
        arr[0] += 1
    if ct >= 24:
        arr[1] += 1
    elif ct >= 14:
        arr[2] += 1
    elif ct >= 4:
        arr[3] += 1
    elif ct >= 2:
        arr[4] += 1
print(*arr)
ans = 0
if arr[0] == 1:
    ans += 1
if sum(arr[0:2]) >= 1:
    ans += ((sum(arr[0:2]) * (sum(arr) - 1)))
if sum(arr[0:3]) >= 1:
    ans += ((sum(arr[0:3]) * (sum(arr[0:4]) - 1)))
if sum(arr[0:4]) >= 2 and arr[4] >= 1:
    s = sum(arr[0:4])
    ans += (s * (s-1) * (s-2) // 2)
    ans += (arr[4] * s * (s-1) // 2)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

import math


def isPrime(x):
  if x == 2:
    return True
  if x % 2 == 0:
    return False
  for i in range(3, int(math.sqrt(x)) + 1, 2):
    if x % i == 0:
      return False
  return True

# primes=[]
# for i in range(2,100):
#   if isPrime(i):
#     primes.append(i)


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]

pows = {}
for p in primes:
  if p > n:
    break
  pows[p] = 0
  pp = p
  while n // pp >= 1:
    pows[p] += n // pp
    pp *= p

e = []
for x in pows.values():
  e.append(x + 1)
print(e)

import itertools
ans = 0

for x in e:
  if x >= 75:
    ans += 1

for (x, y) in itertools.combinations(e, 2):
  #print(x, y)
  for a, b in [(25, 3), (15, 5), (5, 15), (3, 25)]:
    if x >= a and y >= b:
      ans += 1

for (x, y, z) in itertools.combinations(e, 3):
  #print(x, y, z)
  for a, b, c in [[5, 5, 3], [5, 3, 5], [3, 5, 5]]:
    if x >= a and y >= b and z >= c:
      ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
import math
def Prime(n):
    num = int(math.sqrt(n))
    ls = []
    for i in range(2,num+1):
        while 1:
            if n%i == 0:
                n = n//i
                ls.append(i)
            else:
                break
    if n!=1:
        ls.append(n)
    return ls

def main():
    n = int(input())
    dc = defaultdict(int)
    for i in range(2,n+1):
        ls = Prime(i)
        for j in ls:
            dc[j] += 1
    ls = list(dc.values())
    lenth = len(ls)
    ans = 0
    #case1 a^74
    for i in range(lenth):
        if ls[i]>=74:
            ans +=1
    #case2 a^24 b^2
    for i in range(lenth):
        for j in range(i+1,lenth):
            if ls[i]>=24 and ls[j]>=2:
                ans +=1
    #case3 a^14 b^4
    for i in range(lenth):
        for j in range(i+1,lenth):
            if ls[i]>=14 and ls[j]>=4:
                ans +=1
    #case4 a^4 b^4 c^2
    for i in range(lenth):
        for j in range(i+1,lenth):
            for k in range(j+1,lenth):
                if ls[i]>=4 and ls[j]>=4 and ls[k]>=2:
                    ans += 1
    print(ans)
if __name__ == "__main__":
    main()

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
    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,14:0,4:0,2: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] - 1)
ans += com[14] * (com[4] - 1)
# 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
    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,14:0,4:0,2: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] - 1)
ans += com[14] * (com[4] - 1)
if com[4] >= 2:
    ans += com[4] * (com[4] - 1)//2 * (com[2] - 2)
print(ans)