Problem:


Score : 300 points

Problem Statement

You are given an integer N.
Find the number of the positive divisors of N!, modulo 10^9+7.

Constraints

1≤N≤10^3

Input

The input is given from Standard Input in the following format:

N

Output

Print the number of the positive divisors of N!, modulo 10^9+7.

Sample Input 1

3

Sample Output 1

4

There are four divisors of 3! =6: 1, 2, 3 and 6. Thus, the output should be 4.

Sample Input 2

6

Sample Output 2

30

Sample Input 3

1000

Sample Output 3

972926972



Sample input:
3


Sample output:
4

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, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
mod = 10**9+7
n=int(input())
prime = [i for i in prime if i <= n]
def count(k):
  m=k
  e=0
  while m<=n:
    e += n // m
    m *= m
  return e
ans=1
for p in prime:
  ans = ans * (1+count(p)) % mod
print(ans % mod)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
num_fac = [0 for _ in range(N + 1)]
MOD = 10 ** 9 + 7

if N == 1:
	print(1)
else:
	for i in range(2, N + 1):
		for j in range(2, math.floor(math.sqrt(i)) + 1):
			while i % j == 0:
				i //= j
				num_fac[j] += 1
			if i == 1:
				break
		if i != 1:
			num_fac[i] += 1
ans = 1		
		
for i in range(len(num_fac)):
	if num_fac[i] != 0:
		ans *= ((num_fac[i] + 1) % MOD)
		ans %= MOD
	
print(ans)

Submission status: Wrong Answer

Solution code:
# わからない

Submission status: Wrong Answer

Solution code:
import math
import collections
import functools

def solve():
    N = int(input())
    P = 10**9+7

    fn = math.factorial(N)

    divisors = prime_factorize(fn)
    if len(divisors) == 0:
        return 0

    c = collections.Counter(divisors)

    ans = functools.reduce(lambda x, y: x * y, map(lambda x: x + 1, c.values()))

    return ans % P


def prime_factorize(n):
    res = []
    while n % 2 == 0:
        res.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            res.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        res.append(n)
    return res


if __name__ == '__main__':
    res = solve()
    print(res)

Submission status: Wrong Answer

Solution code:
def prmry_num_li(mx_int = 10**5):
    li = [True for i in range(mx_int+1)]
    li[0] = False
    li[1] = False

    for i in range(2,int(mx_int**0.5)+1):
        if (li[i]):
            j = 2
            while (i*j <= mx_int):
                li[i*j] = False
                j+= 1
    lis = []
    for i in range(len(li)):
        if li[i]:
            lis.append(i)

    return lis


n = int(input())
li = prmry_num_li(n)
cnt = [0 for _ in range(len(li))]

for i in range(1,n+1):
    num = i
    plc = 0
    while(num!=1):
        if num%li[plc]==0:
            num/=li[plc]
            cnt[plc] += 1
        else:
            plc+=1

mod = 10**9+7
ans = 1 
for j in range(len(cnt)):
    ans *= (cnt[j]+1)%mod

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 1:
    print(1)
    exit()
candidate = [0] * 1001

candidate[2] = 1
candidate[3] = 1
for i in range(4,N + 1):
    tmp = i
    for j in range(2, int(i ** (1/2)) + 1):
        if tmp % j == 0:
            while tmp % j == 0:
                candidate[j] += 1
                tmp = tmp // j
    candidate[tmp] += 1

ans = 1
for i in range(2,len(candidate)):
    if candidate[i] != 0:
       ans = ans * (candidate[i] + 1) % 1000000007
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
candidate = [0] * 1001

candidate[2] = 1
candidate[3] = 1
for i in range(4,N + 1):
    tmp = i
    for j in range(2, int(i ** (1/2)) + 1):
        if tmp % j == 0:
            while tmp % j == 0:
                candidate[j] += 1
                tmp = tmp // j
    candidate[tmp] += 1

ans = 1
for i in range(2,len(candidate)):
    if candidate[i] != 0:
       ans = ans * (candidate[i] + 1) % 1000000007
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict


def trial_division(n):
    '''
    素因数分解する
    '''
    factor = []
    for num in range(2, int(n**0.5)+1):
        while n % num == 0:
            n //= num
            factor.append(num)
    if not factor or n != 1:
        factor.append(n)
    return factor


N = int(input())
divisor_dict = defaultdict(int)
for i in range(2, N+1):
    divisors = trial_division(i)
    for d in divisors:
        divisor_dict[d] += 1
ans = 1
for v in divisor_dict.values():
    ans = ans * (v+1) % (1e9 + 7)
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict


def trial_division(n):
    '''
    素因数分解する
    '''
    factor = []
    for num in range(2, int(n**0.5)+1):
        while n % num == 0:
            n //= num
            factor.append(num)
    if not factor or n != 1:
        factor.append(n)
    return factor


N = int(input())
divisor_dict = defaultdict(int)
for i in range(2, N+1):
    divisors = trial_division(i)
    for d in divisors:
        divisor_dict[d] += 1
ans = 1
for v in divisor_dict.values():
    ans *= (v+1)
print(ans)

Submission status: Wrong Answer

Solution code:
from math import factorial

N = int(input())
mod = 10**9+7
fn = factorial(N)

ans = 1
for i in range(2, N+1):
    print(fn)
    count = 1
    while fn % i == 0:
        count += 1 
        fn //= i 
    ans *= count
print(ans%mod)

Submission status: Wrong Answer

Solution code:
N = int(input())

# Nの階乗を計算する

factorial = [1] * (N+1)
mod = 10 ** 9 + 7
for i in range(1, N+1):
    factorial[i] = i * factorial[i - 1]
    
#print(factorial)

ans = 1
for f in factorial:
    ans = ans * f % mod

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

# Nの階乗を計算する

factorial = [1] * (N+1)
mod = 10 ** 9 + 7
for i in range(1, N+1):
    factorial[i] = i * factorial[i - 1] %mod
    
#print(factorial)

ans = 1
for f in factorial:
    ans = ans * f % mod

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

# Nの階乗を計算する

factorial = [1] * (N+1)
mod = 10 ** 9 + 7
for i in range(1, N+1):
    factorial[i] = i * factorial[i - 1] % mod
    
#print(factorial)

# N!の約数を表示
n = factorial[-1]
#print(n)

divisors = []
for i in range(1, int(n**0.5)+1):
    if n % i == 0:
        divisors.append(i)
        if i != n // i:
            divisors.append(n//i)

print(len(divisors))

Submission status: Wrong Answer

Solution code:
N = int(input())

# Nの階乗を計算する

factorial = [1] * (N+1)
mod = 10 ** 9 + 7
for i in range(1, N+1):
    factorial[i] = i * factorial[i - 1] % mod
    
print(factorial)

# N!の約数を表示
n = factorial[-1]
print(n)

divisors = []
for i in range(1, int(n**0.5)+1):
    if n % i == 0:
        divisors.append(i)
        if i != n // i:
            divisors.append(n//i)

print(len(divisors))

Submission status: Wrong Answer

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

    for i in range(2, n+1):
        if is_prime[i-1]:
            j = 2 * i
            while j <= n:
                is_prime[j-1] = False
                j += i
    table = [ i for i in range(1, n+1) if is_prime[i-1]]
    return is_prime, table
N=int(input())
_, table = sieve(N)
d={}
for p in table:
    sum_=0
    calc=p
    while calc < N:
        sum_ += N//calc
        calc *= p
    d[p] = sum_
    
lim = 10**9+7
ans=1
for i in d.values():
    ans = (ans * (i+1)) % lim
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

def prime(n):
    ret = True
    for i in range(1, int(n**0.5) + 1):
        if i != 1 and n % i == 0:
            ret = False
            break
    return ret

def factors(p, n):
    ret = 0
    while p <= n:
        ret += n // p
        p *= p
    return ret

ans = 1
for i in range(2, n+1):
    if prime(i):
        ans = ans * (factors(i, n) + 1) % (10**9 + 7)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
e = 10**9 + 7
ans = 1
for i in range(1,N+1):
    ans = (ans * i) % e
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
d=math.factorial(n)
k=1
ans=1
for i in range(2,n+1):
  while d%i==0:
    d//=i
    k+=1
  ans*=k
  k=1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
k=0
for i in range(2,n+1):
  for j in range(2,i+1):
    while i%j==0:
      i//=j
      k+=1
print((2**k)%(10**9+7))

Submission status: Wrong Answer

Solution code:
N = int(input())


def fac(n):
    att = []
    t = n
    for i in range(2, int(-(-n ** 0.5 // 1) + 1)):
        c = 0
        while (t % i == 0):
            c += 1
            t //= i
        if c:
            att += [[i, c]]
    if att == []:
        att += [[t, 1]]
    return att


MOD = 10 ** 9 + 7
t = 0
memo = {}
t1, t2 = 0, 1
for i in range(2, N + 1):
    fl = fac(i)
    for f in fl:
        if f[0] in memo:
            memo[f[0]] += f[1]
        else:
            memo[f[0]] = f[1]
for m in memo:
    t2 = (t2 * (memo[m] + 1)) % MOD
t += t1 + t2
t %= MOD
print(t)

Submission status: Wrong Answer

Solution code:
N = int(input())
mod = 10**9+7
ans = 1
num = [0]*N
for i in range(1,N+1):
    for j in range(2,i+1):
        while i % j == 0:
            i //= j
            num[j-1] += 1
for i in range(N):
    if num[i] == 0:
        continue
    else:
        ans *= (num[i]+1) % mod
print(ans)

Submission status: Wrong Answer

Solution code:
import math
mod = int(1e9+7)

N = int(input())
n = math.factorial(N)

count_of_prime_factors = {}
while True:
    if n > 1:
        count = 0
        while n % 2 == 0:
            n //= 2
            count += 1
        if count != 0:
            count_of_prime_factors.update({2: count})
        if n == 1: 
            break 

        for i in range(3, N+1, 2):
            count = 0
            while n % i == 0:
                n //= i 
                count += 1
            if count != 0:
                count_of_prime_factors.update({i: count})
            if n == 1: 
                break
        else:        
            count_of_prime_factors.update({n: 1})
        break 
    else:
        print(1)
        exit()

ans = 1
for prime_factor, count in count_of_prime_factors.items():
    ans *= count + 1

print(ans % mod)
print(count_of_prime_factors)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
from functools import reduce
INF = int(1e9+7)


def primeFactor(n, pf):
    # 素因数分解
    if n == 1:
        return
    f = 2
    while (f * f <= n):
        if (n % f == 0):
            pf[f] += 1
            n = n // f
        else:
            f += 1
    pf[n] += 1


def main():
    N = int(input())
    d = defaultdict(lambda: 0)
    for i in range(1, N + 1):
        primeFactor(i, d)
    print(reduce(lambda x, y : x * (y + 1), d.values(), 1))
    return


main()

Submission status: Wrong Answer

Solution code:
import math
from collections import defaultdict


def make_prime_list(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+1, prime):
            prime_list[non_prime] = 0

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


num = int(input())
div_sum = defaultdict(int)

p = make_prime_list(num)
print(p)
for j in range(2, num+1):

    div_num = defaultdict(int)

    for i in p:
        n = j
        while n % i == 0:
            div_num[i] += 1
            n //= i

    for k, v in div_num.items():
        div_sum[k] += v

ans = 1
for k, v in div_sum.items():
    ans *= (v + 1)
print(ans % (10**9 + 7))

Submission status: Wrong Answer

Solution code:
import math
from collections import defaultdict


def make_prime_list(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]


num = int(input())
div_sum = defaultdict(int)

p = make_prime_list(num)
for j in range(2, num+1):

    div_num = defaultdict(int)

    for i in p:
        n = j
        while n % i == 0:
            div_num[i] += 1
            n //= i

    for k, v in div_num.items():
        div_sum[k] += v

ans = 1
for k, v in div_sum.items():
    ans *= (v + 1)
print((ans // 2) % (10**9 + 7))

Submission status: Wrong Answer

Solution code:
import math
from collections import defaultdict


def make_prime_list(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]


num = 1000
div_sum = defaultdict(int)

p = make_prime_list(num)
print(p)
for j in range(2, num+1):

    div_num = defaultdict(int)

    for i in p:
        n = j
        while n % i == 0:
            div_num[i] += 1
            n //= i

    for k, v in div_num.items():
        div_sum[k] += v

print(dict(div_sum))
ans = 1
for k, v in div_sum.items():
    ans *= (v + 1)
print((ans // 2) % (10**9 + 7))

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=1
mod=10**7+1
m=1
for i in range(n):
    m*=(i+1)
for j in range(2,n+1):
    b=1
    while m%j==0:
        m=m//j
        b+=1
    ans*=b
ans=ans%mod
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n==1:
    print(1)
    exit()
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr
so=[]
ka=[]
for i in range(2,n+1):
    a=factorization(i)
    for j in a:
        if not j[0] in so:
            so.append(j[0])
            ka.append(j[1])
        else:
            ka[so.index(j[0])]+=j[1]
ans=1
for i in ka:
    ans*=(i+1)
print(ans)

Submission status: Wrong Answer

Solution code:
import math
import collections
import sys
sys.setrecursionlimit(500000)

def f(n,x,i):
    if i == x:
        return a
    while n % i == 0:
        a.append(i)
        n //= i

    return f(n,x,i+1)
a = []
n = int(input())
c = collections.Counter(f(math.factorial(n),n,2))
d = [i[1]+1 for i in c.items()]
ans = 1
for i in range(len(d)):
    ans = (ans * d[i]) % 1000000007
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
P=[2,3,5,7,11,13,17,19,23,29,31]
p=[1]*11
for i in range(1,n+1):
  for j in range(11):
    x=i
    c=0
    while(x%P[j]==0):
      x//=P[j]
      c+=1
    p[j]+=c
a=1
for x in p:
  a*=x
print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())
mod = 10 ** 9 + 7
res = 1
for i in range(1, N + 1):
  res = (res * i) % mod
print(res)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())

def div(m):
  d = {}
  temp = math.ceil(math.sqrt(m))+1
  for i in range(2, temp):
    while m%i== 0:
      m /= i
      if i in d:
        d[i] += 1
      else:
        d[i] = 1
  if d == {}:
    d[m] = 1
  return d

from collections import Counter

d = {}
for i in range(2, n+1):
  d = dict(Counter(d)+Counter(div(i)))
#print(d)
ans = 1
for i in d.values():
  ans *= (i+1)
print(ans%(10**9+7))

Submission status: Wrong Answer

Solution code:
n = int(input())
mod = 10**9 + 7
def factorial(x):
    count=1
    for i in range(2,x+1):
        count *= i
    return count
def primeCheck(x):
    count = 0
    for i in range(1,x+1):
        if x%i==0:
            count+=1
    return count

a = factorial(n)
i = n
cnt = 1


print(primeCheck(factorial(n))/mod)

Submission status: Wrong Answer

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
from collections import defaultdict
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)


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 search_divisor_num_of_factorial_num(num):
    if num <= 0:
        return 0
    elif num == 1 or num == 2:
        return 1
    else:
        # 素数とその個数を入れていく
        dict_counter = defaultdict(int)
        # メモ用のdict
        dict_memo = defaultdict(list)

        for a_num in range(2, num + 1):
            num_sqrt = math.ceil(math.sqrt(a_num))
            prime_list = make_prime_list_2(num_sqrt)

            # メモ用のdictに入れるためのkeyを残しておく
            now_num = a_num

            for prime in prime_list:
                while a_num % prime == 0:
                    # メモ内にある場合、そこから全部移して、移し終わったらループを抜ける
                    if a_num in dict_memo:
                        for memo in dict_memo[a_num]:
                            dict_counter[memo] += 1
                            dict_memo[now_num].append(memo)

                        a_num = 1

                    else:
                        dict_counter[prime] += 1
                        dict_memo[now_num].append(prime)
                        a_num //= prime

            if a_num != 1:
                dict_counter[a_num] += 1
                dict_memo[now_num].append(a_num)

        divisor_num = 1
        dict_fact = dict(dict_counter)
        for value in dict_fact.values():
            divisor_num *= (value + 1)

        return divisor_num
print(search_divisor_num_of_factorial_num(_I())%mod)

Submission status: Wrong Answer

Solution code:
n = int(input())
p = [2,3,5,7,11,13,17,19,23,29,31]
ll = [[0]*len(p) for _ in [0]*(n+1)]
for i in range(1,n+1):
  for j in range(len(p)):
    ll[i][j] = ll[i-1][j]
    tmp = i
    while True:
      if tmp%p[j] == 0:
        ll[i][j] += 1
        tmp = tmp//p[j]
      else:
        break
ans = 1
for i in ll[-1]:
  ans*=(i+1)%(10**9+7)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
p = [2,3,5,7,11,13,17,19,23,29,31]
ll = [[0]*len(p) for _ in [0]*(n+1)]
for i in range(1,n+1):
  for j in range(len(p)):
    ll[i][j] = ll[i-1][j]
    tmp = i
    while True:
      if tmp%p[j] == 0:
        ll[i][j] += 1
        tmp = tmp//p[j]
      else:
        break
  print(ll[i])
ans = 1
for i in ll[-1]:
  ans*=(i+1)%(10**9+7)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
g = 10 ** 9 + 7
def add(a, b):
  return (a + b) % g

d = []
DP = [0] * (max(2,N)+1)
DP[1] = 0
DP[2] = 1
for i in range(2, N+1):
  for j in (x for x in d if x * x <= N):
    if i % j == 0:
      DP[i] = DP[j] + DP[i//j]
      break
  else:
    d.append(i)
    DP[i] = 1

print(DP[N]+1)

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():
    a, b, c, d = LI()
    print(max(a * b, c * d))
    return

#B
def B():
    _ = II()
    s = S()
    d = {}
    d["I"] = 1
    d["D"] = -1
    ans = 0
    now = 0
    for i in s:
        now += d[i]
        ans = max(ans, now)
    print(ans)
    return

#C
def C():
    def primes2(n):
        """https://stackoverflow.com/questions/2068372/fastest-way-to-list-all-primes-below-n/3035188#3035188"""
        """ Input n>=6, Returns a list of primes, 2 <= p < n """
        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]]
    n = II()
    prime = primes2(n)
    d = defaultdict(int)
    for i in prime:
        b = n
        while b:
            b = b // i
            d[i] += b
            d[i] %= mod
    ans = 1
    for i in d.values():
        ans *= (i + 1)
        ans %= mod
    print(ans)
    return

#D
def D():
    return

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

Submission status: Wrong Answer

Solution code:
INF = 10**9+7

def main():
	n = int(input())
	ans = 1
	for i in range(n):
		ans *= yaku(i+1)
	print(ans)

def yaku(s):
	count = 0
	for i in range(s):
		if(s%(i+1)==0):
			count+=1
	return  count


main()

Submission status: Wrong Answer

Solution code:
import math
n = int(input())

def make_prime_list_2(num):
    if num < 2:
        return []
    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 search_divisor_num(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        divisor_num = 1
        for prime in prime_list:
            count = 1
            while num % prime == 0:
                num //= prime
                count += 1
            divisor_num *= count

        if num != 1:
            divisor_num *= 2

        return divisor_num
print(search_divisor_num(n) % (pow(10,9) + 7))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
N = int(input())
MOD = 10 ** 9 + 7

def prime_factor(n):
    d = defaultdict(int)
    for i in range(2, n + 1):
        if i * i > n:
            break
            
        while n % i == 0:
            d[i] += 1
            n //= i
            
    if n != 1:
        d[n] = 1
            
    return d

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

ans = 1
for v in d.values():
    ans *= v + 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
from collections import defaultdict

N = int(input())

d = defaultdict(int)

def division(n,d):
    flag = True
    tmp = n // 2 + 1
    for num in range(2, tmp):
        while n % num == 0:
            flg = False
            n //= num
            d[num] += 1

    if flg:
        d[n] += 1

    return

ans = 1
for i in d.values():
    ans *= (i+1)

print(ans%(10**9+7))

Submission status: Wrong Answer

Solution code:
import math
from collections import defaultdict

N = int(input())

# 素数列挙
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 + 1, prime):
            prime_list[non_prime] = 0

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

# 階乗の約数の個数を求める
def search_divisor_num_of_factorial_num(num):
    if num <= 0:
        return 0
    elif num == 1 or num == 2:
        return 1
    else:
        # 素数とその個数を入れておく
        dict_counter = defaultdict(int)

        # メモ用のdict
        dict_memo = defaultdict(list)

        for a_num in range(2, num + 1):
            num_sqrt = math.ceil(math.sqrt(a_num))
            prime_list = make_prime_list_2(num_sqrt)

            # メモ用のdictに入れるためのkeyを残しておく
            now_num = a_num

            for prime in prime_list:
                while a_num % prime == 0:
                    # メモ内にある場合、そこから全部移して、移し終わったらループを抜ける
                    if a_num in dict_memo:
                        for memo in dict_memo[a_num]:
                            dict_counter[memo] += 1
                            dict_memo[now_num].append(memo)

                        a_num = 1

                    else:
                        dict_counter[prime] += 1
                        dict_memo[now_num].append(prime)
                        a_num //= prime

            if a_num != 1:
                dict_counter[a_num] += 1
                dict_memo[now_num].append(a_num)
        
        divisor_num = 1
        dict_fact = dict(dict_counter)
        for value in dict_fact.values():
            divisor_num *= (value + 1)

        return divisor_num

mod =  10 ** 9 + 7
print(search_divisor_num_of_factorial_num(N) % mod)

Submission status: Wrong Answer

Solution code:
import math
from collections import defaultdict

N = int(input())

# 素数列挙
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 search_divisor_num_of_factorial_num(num):
    if num <= 0:
        return 0
    elif num == 1 or num == 2:
        return 1
    else:
        # 素数とその個数を入れておく
        dict_counter = defaultdict(int)

        # メモ用のdict
        dict_memo = defaultdict(list)

        for a_num in range(2, num + 1):
            num_sqrt = math.ceil(math.sqrt(a_num))
            prime_list = make_prime_list_2(num_sqrt)

            # メモ用のdictに入れるためのkeyを残しておく
            now_num = a_num

            for prime in prime_list:
                while a_num % prime == 0:
                    # メモ内にある場合、そこから全部移して、移し終わったらループを抜ける
                    if a_num in dict_memo:
                        for memo in dict_memo[a_num]:
                            dict_counter[memo] += 1
                            dict_memo[now_num].append(memo)

                        a_num = 1

                    else:
                        dict_counter[prime] += 1
                        dict_memo[now_num].append(prime)
                        a_num //= prime

            if a_num != 1:
                dict_counter[a_num] += 1
                dict_memo[now_num].append(a_num)
        
        divisor_num = 1
        dict_fact = dict(dict_counter)
        for value in dict_fact.values():
            divisor_num *= (value + 1)

        return divisor_num

mod =  10 ** 9 + 7
print(search_divisor_num_of_factorial_num(N) % mod)

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

# Factoring by trial split
def getPrimeList(n):
  l=[]
  t=int(math.sqrt(n))+1
  
  for a in range(2,t):
    while n%a==0:
      n//=a
      l.append(a)
  
  if n!=1:
    l.append(n)
  
  return l

def main():
  l=[0]*1001

  n=I()

  for i in range(2,n+1):
    x=getPrimeList(i)
    for j in x:
      l[j]+=1

  sm=1
  for i in l:
    sm*=i+1

  return sm

print(main())

Submission status: Wrong Answer

Solution code:
import math
import copy

def trial_division(n):
    check = 0
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割っていく
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp+1):
        while n % num == 0:
            n /= num
            factor.append(num)
            check = 1
    #素数チェック
    if check == 0:
        factor.append(n)
    return factor

n = int(input())
ans = 0

div = []
for i in range(1,n+1):
    for j in trial_division(i):
        div.append(j)
        div = list(set(div))

for i in div:
    x = 0
    if i == 1:
        ans += 1
        continue
    for j in range(i,n+1):
        num = j
        while num % i == 0:
            x += 1
            num /= i
    ans = (ans*(x+1))%(10**9+7)

print(ans)

Submission status: Wrong Answer

Solution code:
import math
k=int(input())
def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

pl=primes(k)
ans=[]
print(pl)
m=math.factorial(k)
for i in range(len(pl)):
    tmp=0
    while m%pl[i]==0:
        m=m//pl[i]
        tmp+=1
    ans.append(tmp)
a=1
for i in range(len(ans)):
    a=a*(ans[i]+1)%(10**9+7)
print(a)

Submission status: Wrong Answer

Solution code:
N=int(input())
pList={}
mod = 10**9+7
def soinsuu(x):
    if x==1:return
    for p in pList:
        if x%p==0:
            pList[p] += 1
            return soinsuu(x//p)
        if p*p>x:break
    pList[x] = pList.get(x,0)+1
for n in range(2,N+1):
    soinsuu(n)
ans = 1
for i in pList.values():
    ans = ans*(i+1)%mod
print(ans)