Submission #2071484


Source Code Expand

N = int(input())
div = 10**9+7


# ある自然数未満までのエラトステネスの篩をつくる
def mark(s, x):
    for i in range(x + x, len(s), x):
        s[i] = False


def eratosthenes(n):
    s = [True] * n
    for x in range(2, int(n ** 0.5) + 1):
        if s[x]: mark(s, x)
    return [i for i in range(0, n) if s[i] and i > 1]


primes = eratosthenes(1000)
num_pow = [1] * (N+1)

for n in range(1, N+1):
    for p in primes:
        if p > n:
            break
        while True:
            if n % p == 0:
                n /= p
                num_pow[p] += 1
            else:
                break

ans = 1
for z in num_pow:
    ans *= z

print(ans % div)


Submission Info

Submission Time
Task C - Factors of Factorial
User AT274
Language Python (3.4.3)
Score 300
Code Size 720 Byte
Status AC
Exec Time 38 ms
Memory 3444 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 10
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_certain_01.txt, subtask_1_certain_02.txt, subtask_1_certain_03.txt, subtask_1_certain_04.txt, subtask_1_rand_01.txt, subtask_1_rand_02.txt, subtask_1_rand_03.txt
Case Name Status Exec Time Memory
sample_01.txt AC 38 ms 3444 KB
sample_02.txt AC 17 ms 3064 KB
sample_03.txt AC 26 ms 3064 KB
subtask_1_certain_01.txt AC 18 ms 3064 KB
subtask_1_certain_02.txt AC 18 ms 3064 KB
subtask_1_certain_03.txt AC 26 ms 3064 KB
subtask_1_certain_04.txt AC 28 ms 3064 KB
subtask_1_rand_01.txt AC 20 ms 3064 KB
subtask_1_rand_02.txt AC 21 ms 3064 KB
subtask_1_rand_03.txt AC 20 ms 3064 KB