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: Runtime Error

Solution code:
import math

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

def make_divisors(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)
    return divisors
print(len(make_divisors(fac_n)) % (10**9+7))

Submission status: Runtime Error

Solution code:
import math

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

def make_divisors(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)

    divisors.sort()
    return divisors
print(len(make_divisors(fac_n)) % (10**9+7))

Submission status: Runtime Error

Solution code:
import math

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

def make_divisors(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)

    divisors.sort()
    return divisors
print(len(make_divisors(fac_n)))

Submission status: Runtime Error

Solution code:
from collections import defaultdict

def prime_factorize(N): #素因数分解
    exponent = 0
    while N%2 == 0:
        exponent += 1
        N //= 2
    if exponent: factorization = [[2,exponent]]
    else: factorization = []
    i=1
    while i*i <=N:
        i += 2
        if N%i: continue
        exponent = 0
        while N%i == 0:
            exponent += 1
            N //= i
        factorization.append([i,exponent])
    if N!= 1: factorization.append([N,1])
    assert N != 0, "zero"
    return factorization

N = int(input())

if N <= 2:
    print(N)
else:
    num = defaultdict(int)
    for i in range(2,N+1):
        for n,m in prime_factorize(i):
            num[n] += m


ans = 1
mod = int(1e9+7)
for i in num.values():
    ans = ((i+1)*ans)%mod

print(ans)

Submission status: Runtime Error

Solution code:
import math

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

i = 2 　
num = 1
ans = 1

while N != 1: 
    if N % i == 0:
        N //= i
        num += 1
    else:
        ans *= num
        num = 1
        i += 1
ans *= num
ans %= (10 ** 9) + 7

print(ans)

Submission status: Runtime Error

Solution code:
import math

N = int(input())
N = math.factorial(N) # N!を出してくれる (N=3, 0+1+2+3=6)

i = 2 　#Nを素因数分解するためまずは2で
num = 1
ans = 1

while N != 1: 
    if N % i == 0:
        N //= i
        num += 1
    else:
        ans *= num
        num = 1
        i += 1
ans *= num
ans %= (10 ** 9) + 7

print(ans)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
num = 1
ans = 0
for i in range(1, N + 1):
    num *= i

maxx = int(math.sqrt(num)) + 2

for i in range(1, (num // 2) + 3):
    if num % i == 0:
        ans += 1
        ans %= (10**9) + 7

print(ans + 1)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
num = 1
ans = 0
for i in range(1, N + 1):
    num *= i

maxx = int(math.sqrt(num)) + 2

print(num)
print(maxx)
for i in range(1, (num // 2) + 3):
    if num % i == 0:
        ans += 1
        ans %= (10**9) + 7

print(ans + 1)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
num = 1
ans = 0
for i in range(1, N + 1):
    num *= i

maxx = int(math.sqrt(num)) + 2


for i in range(1, maxx + 1):
    if num % i == 0:
        ans += 1
        ans %= (10**9) + 7
print(ans + 1)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
num = 1
ans = 0
for i in range(1, N + 1):
    num *= i

maxx = int(math.sqrt(num)) + 2

for i in range(1, maxx + 1):
    if num % i == 0:
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
import math

# nの約数を全て求める
lim = 10 ** 9 + 7

n = int(input())
if (n <= 2):
    ans = n
else:
    fact = math.factorial(n)

    ans = 1
    loop = int(fact/2)
    for i in range(1, loop + 1):
        if (fact % i == 0):
            #check[i] = 1
            ans += 1


#ans = sum(check)
ans %= lim
print(ans)

Submission status: Runtime Error

Solution code:
import math

# nの約数を全て求める
lim = 10 ** 9 + 7

n = int(input())
fact = math.factorial(n)
check = [0] * (fact + 1)
for i in range(1, fact + 1):
    if (fact % i == 0):
        check[i] = 1

ans = sum(check)
ans %= lim
print(ans)

Submission status: Runtime Error

Solution code:
import collections
N = int(input())
num = []
for i in range(2,N+1):
    for j in range(2,i+1):
        #print(j)
        while i%j==0:
            i //= j
            num.append(j)
#print(num)
A = collections.Counter(num)
#print(A)
ans = 1
for v in A.values():
    ans *= (v+1)%mod
print(ans%mod)

Submission status: Runtime Error

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

nn = math.factorial(n)

if n ==1:
    print("1")

elif n ==2:
    print("2")
else:
    sosu =[2]  
   
    for i in range(3,n+1,2):
        judge = 0
        for j in range(2,i):
            if i % j == 0:
                judge = 1
        if judge ==0:
            sosu.append(i)
    
    slist =[0]*len(sosu)
    for k in range(0,len(sosu)):
        m = nn
        count = 0
        while m % sosu[k] ==0:
            m = m //sosu[k]
            count +=1
        slist[k] = count
    
    res = 1
    for l in range(0,len(slist)):
        res =res*(slist[l]+1) % 1000000007

print(res)

Submission status: Runtime Error

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

nn = math.factorial(n)

if n ==1:
    print(1)

elif n ==2:
    print(2)
else:
    sosu =[2]  
   
    for i in range(3,n+1,2):
        judge = 0
        for j in range(2,i):
            if i % j == 0:
                judge = 1
        if judge ==0:
            sosu.append(i)
    
    slist =[0]*len(sosu)
    for k in range(0,len(sosu)):
        m = nn
        count = 0
        while m % sosu[k] ==0:
            m = m //sosu[k]
            count +=1
        slist[k] = count
    
    res = 1
    for l in range(0,len(slist)):
        res =res*(slist[l]+1) % 1000000007

print(res)

Submission status: Runtime Error

Solution code:
N = int(input())
if N == 1:
    print(1)
# calculate primes by sieve
primes = list(range(2, N + 1))
prime_index = 0
n = primes[prime_index]
while n**2 <= N:
    primes = list(filter(lambda x: x == n or x % n != 0, primes))
    prime_index += 1
    n = primes[prime_index]
# calculate exponents
exponents = [0 for _ in range(len(primes))]
for n in range(2, N + 1):
    for prime_index, prime in enumerate(primes):
        exponent = 0
        tmp = n
        while tmp % prime == 0:
            tmp //= prime
            exponent += 1
        exponents[prime_index] += exponent
# calculate answer
const = 10**9 + 7
answer = 1
for e in exponents:
    answer = answer * (e + 1)
    answer %= const
print(answer)

Submission status: Runtime Error

Solution code:
N = int(input())
# calculate primes by sieve
primes = list(range(2, N + 1))
prime_index = 0
n = primes[prime_index]
while n**2 <= N:
    primes = list(filter(lambda x: x == n or x % n != 0, primes))
    prime_index += 1
    n = primes[prime_index]
# calculate exponents
exponents = [0 for _ in range(len(primes))]
for n in range(2, N + 1):
    for prime_index, prime in enumerate(primes):
        exponent = 0
        tmp = n
        while tmp % prime == 0:
            tmp //= prime
            exponent += 1
        exponents[prime_index] += exponent
# calculate answer
const = 10**9 + 7
answer = 1
for e in exponents:
    answer = answer * (e + 1)
    answer %= const
print(answer)

Submission status: Runtime Error

Solution code:
import math

n = int(input())
mod = 10**9+7

def eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]

era = eratosthenes(n)

dict = {}
for i in range(n):
    num = i+1
    while num!=1:
        for j in era:
            while num%j==0:
                num/=j
                if j in dict:
                    dict[j]+=1
                else:
                    dict[j]=1

ans = 1
for i in dict:
    ans = ans*(dict[i]+1)%mod

print(ans)

Submission status: Runtime Error

Solution code:
from collections import defaultdict
n = int(input())

factors = defaultdict(int)
for i in range(2, n + 1):
    for j in range(2, i+1):
        while i % j == 0:
            factors[j] += 1
            i //= j
a = '*'.join(str(value+1) for value in factors.values())
print(eval(a)%(10**9+7))

Submission status: Runtime Error

Solution code:
import math
N = int(input())
prime=[]
count=[]
ans = 1
place = 0
n = math.factorial(N)
tmp = int(math.sqrt(n))+1
for k in range(1,N+1):
    for i in range(2,tmp):
        while k % i == 0:
            k //= i
            if(i in prime):
                count[prime.index(i)] += 1
            else:
                prime.append(i)
                count.append(1)
                place += 1
for j in range(0,place):
    ans *= (count[j]+1)
print(ans)

Submission status: Runtime Error

Solution code:
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import permutations,combinations
from collections import defaultdict,Counter
from math import gcd,ceil,floor,factorial
# from fractions import gcd
from functools import reduce
from pprint import pprint

def myinput():
    return map(int,input().split())

def mylistinput(n):
    return [ list(myinput()) for _ in range(n) ]

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col):
    data.sort(key=lambda x:x[col],reverse=False)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

n = int(input())
mod = 10**9 + 7

# nまでの自然数が素数かどうかを表すリストを返す
# Sieve of Eratosthenes
def makePrimeChecker(n):
    isPrime = [True] * (n + 1)
    isPrime[0] = False
    isPrime[1] = False
    for i in range(2, int(n ** 0.5) + 1):
        if isPrime[i]:
            for j in range(i * i, n + 1, i):
                isPrime[j] = False
    return isPrime

ls = makePrimeChecker(n)
print(ls)

# def make_divisors(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)

#     # divisors.sort()
#     return divisors

ans = 1
for p in range(2,len(ls)):
    if ls[p]:
        i = 0
        count = 0
        while n>=(p**i):
            i += 1
            count += n//(p**i)
        ans *= count + 1
    else:
        pass

# ans2 = make_divisors(factorial(n))
# print(ans2)

print(ans%mod)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(2000)
n = int(input())

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])
    # 上のループを通した後にtempが1じゃなかったら、だけど、nが素数以外にそんなケースある？
    if temp!=1:
        arr.append([temp, 1])
    
    # 素数だったときの処理
    if arr == []:
        arr.append([n,1])

    return arr

def factorial(n):
    if n == 1:
        return 1
    return n * factorial(n-1)
F = factorial(n)
factor_ls = factorization(F)
ls = [factor[1] for factor in factor_ls]
num_factor = 1
for i in ls:
    num_factor *= (i + 1)
print(num_factor % (10**9 + 7))

Submission status: Runtime Error

Solution code:
mod=10**9+7
N=int(input())
M=1
y=[1 for k in range(N)]
for k in range(2,N+1):
    for j in range(2,k+1):
        if k=1:
            break
        if k%j ==0:
            count=0
            while k%j==0:
                k=k//j
                count+=1
            y[j-1]+=count
ans=1
for k in range(len(y)):
    ans=ans*y[k]%mod
print(ans)

Submission status: Runtime Error

Solution code:
import math
from functools import reduce
N=int(input())
MOD=10**9+7

def all_multiple(a):
    return reduce(lambda a,b:a*b,a)

def is_prime(n):
    if n==1: return False
    for k in range(2,int(math.sqrt(n))+1):
        if n%k==0:
            return False
    return True


A=[1]*(N+1)#indexと割られる数を合わせる
ans=1
for N_t in range(2,N+1):
    for num in range(1,N_t+1):
        if is_prime(num):
            cnt=0
            while N_t%num==0:
                N_t=N_t//num
                cnt+=1
            A[num]+=cnt 

print(all_multiple_mod(A,MOD)%MOD)

Submission status: Runtime Error

Solution code:
mod=10**9+7
import math
n=int(input())
ans=1
l=[0]*n
for ii in range(n,2,-1):
  i=ii
  for j in range(2,int(math.sqrt(i))+1):
    if i%j==0:
      cnt=0
      while  i%j==0:
        snt+=1;i//=j
      l[i-1]+=cnt
  if i!=1:
    l[i-1]+=1
for i in l:
  ans+=(i+1)
  ans%=mod
print(ans)

Submission status: Runtime Error

Solution code:
mod=10***9+7
import math
n=int(input())
ans=1
l=[0]*n
for ii in range(n,2,-1):
  i=ii
  for j in range(2,int(math.sqrt(i))+1):
    if i%j==0:
      cnt=0
      while  i%j==0:
        snt+=1;i//=j
      l[i-1]+=cnt
  if i!=1:
    l[i-1]+=1
for i in l:
  ans+=(i+1)
  ans%=mod
print(ans)

Submission status: Runtime Error

Solution code:
k=int(input()) 
def kai(n): 
	if n==1: return 1 
	else : return n*kai(n-1) % (10**9+1) 
print(kai(k))

Submission status: Runtime Error

Solution code:
n=int(input())
import math
mod=10**9+7
ans = math.factorial(n)
x=0
k = ans
for i in range(1,int(k**0.5)+1):
    if k%i==0:
        x+=1
        if i!=n//i:
            x+=1
print(x%mod)

Submission status: Runtime Error

Solution code:
n = int(input())

def divisors(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)

    # divisors.sort()
    return divisors

ans = 1
MOD = 10**9+7
for i in range(1,n+1):
    ans = ans*i

k = divisors(ans)
print(len(k)%MOD)

Submission status: Runtime Error

Solution code:
import math
def get_prime(n):
    if n<= 1:
        return[]
    prime = [2]
    limit = int(math.sqrt(n))
    
    data = [i + 1 for i in range(2,n,2)]
    while limit > data[0]:
        prime.append(data[0])
        data = [j for j in data if j % data[0] != 0]
    return prime + data
n = int(input())
ans = 1
a = 1
for i in range(1,n+1):
    a *= i
ans = len(get_prime(a))

    
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
mod = 10**9+7
s = [0] * (n+1)

for i in range(2, n+1):
    p = 2
    while i>1:
        while i%p==0:
            i //= p
            s[p] += 1
        p += 1

print(s)
ans = 1
for i in s:
    ans *= i+1
    ans %= mod

print(ans)

Submission status: Runtime Error

Solution code:
for i in range(1, n+1):
    while i % 2 == 0:
        if not 2 in divisor_dic:
            divisor_dic[2] = 1
        else:
            divisor_dic[2] += 1
        i //= 2
    f = 3
    while f*f <= i:
        if i % f ==0:
            if not f in divisor_dic:
                divisor_dic[f] = 1
            else:
                divisor_dic[f] += 1
        
            i //= f
        
        else:
            f += 2
    
    if i != 1:
        if not i in divisor_dic:
            divisor_dic[i] = 1
        else:
            divisor_dic[i] += 1
                
c = 1          
for v in divisor_dic.values():
    c *= (v+1)
    c %= 10**9+7

print(c)

Submission status: Runtime Error

Solution code:
def factorial(x):
  if x == 1: return 1
  else: return x*factorial(x-1)
 
n = int(input())
n_bikkuri = factorial(n)
 
total = 1
 
for i in range(2, n_bikkuri+1):
  n_b = n_bikkuri
  while(n_b % i == 0):
    total += 1
    n_b /= i
  
print(total % int(1e9+7))

Submission status: Runtime Error

Solution code:
def factorial(x):
  if x == 1: return 1
  else: return x*factorial(x-1)
 
n = int(input())
n_bikkuri = factorial(n)
 
total = 1
 
for i in range(2, n_bikkuri+1):
  n_b = n_bikkuri
  while(not n_b % i):
    total += 1
    n_b /= i
  
print(total % int(1e9+7))

Submission status: Runtime Error

Solution code:
def factorial(x):
  if x == 1: return 1
  else: return x*factorial(x-1)
 
n = int(input())
n_bikkuri = factorial(n)
 
total = 1
 
for i in range(2, n_bikkuri+1):
  n_b = n_bikkuri
  while(not n_b % i):
    total += 1
    n_b /= i
  
print(total % (1e9+7))

Submission status: Runtime Error

Solution code:
def factorial(x):
  if x == 1: return 1
  else: return x*factorial(x-1)
 
n = int(input())
n_bikkuri = factorial(n)
 
total = 1
 
for i in range(2, n_bikkuri+1):
  n_b = n_bikkuri
  while(not n_b % i):
    total += 1
    n_b /= i

Submission status: Runtime Error

Solution code:
def factorial(x):
  if x == 1: return 1
  else: return x*factorial(x-1)
 
n = int(input())
n_bikkuri = factorial(n)
 
total = 1
 
for i in range(2, n+1):
  n_b = n_bikkuri
  while(not n_b % i):
    total += 1
    n_b /= i
 
print(total % (10e9 + 7))

Submission status: Runtime Error

Solution code:
def factorial(x):
  if x == 1: return 1
  else: return x*factorial(x-1)

n = int(input())
n_bikkuri = factorial(n)

total = 1

for i in range(2, n+1):
  n_b = n_bikkuri
  while(not n_b % i):
    total += 1
    n_b /= i

print(total)

Submission status: Runtime Error

Solution code:
n,f,ans=int(input()),1,0
for p in range(1,n+1):
    f*=p
for i in range(1,int(f**0.5)+1):
    if f%i==0:
        ans+=1
        if i!=f//i:
              ans+=1
print(ans%1000000007)

Submission status: Runtime Error

Solution code:
N=int(input())
b=1
for a in range(1,N+1):
    b*=a
numbers=[2]
for c in range(3,N+1):
    count=0
    for d in numbers:
        if not c%d==0:
            count+=1
        else:
            pass
    if count==len(numbers):
        numbers.append(c)
    else:
        pass
answers=[]
while b>1:
    for e in numbers:
        kazu=0
        while b%e==0:
            b=b/e
            kazu+=1
        answers.append(kazu)
kotae=1
for f in answers:
    kotae*=(f+1)
print(kotae%(10**9+7))

Submission status: Runtime Error

Solution code:
N=int(input())
b=1
for a in range(1,N+1):
    b*=a
numbers=[2]
for c in range(3,N+1):
    count=0
    for d in numbers:
        if not c%d==0:
            count+=1
        else:
            pass
    if count==len(numbers):
        numbers.append(c)
    else:
        pass
answers=[]
while b>1:
    for e in numbers:
        kazu=0
        while b%e==0:
            b=b/e
            kazu+=1
        answers.append(kazu)
kotae=1
for f in answers:
    kotae*=(f+1)
print(kotae)

Submission status: Runtime Error

Solution code:
n = int(input())
for i in range(1, n+1):
    num = 2
    while i != 1:
        if i % num==0:
            i //= num
            l.append(num)
        else:
            num += 1
ans = 1
for i in set(l):
    ans *= (l.count(i) + 1) % (10**9+7)
print(ans)

Submission status: Runtime Error

Solution code:
def prime(p):
  if p == 2:
    return True
  else:
    flg = False
    count = 0
    for i in range(1, int(p ** 0.5)):
      if p % i == 0:
        count += 1
    if count == 1:
      flg = True
    return flg
N = int(input())
if N == 1:
  print(1)
else:
  p_list = []
  for j in range(2, N + 1):
    if prime(j):
      p_list.append(j)
  l = []
  for p in p_list:
    k = 1
    add = 0
    while N // (p ** k):
      add += N // (p ** k)
      k += 1
    l.append(add + 1)
  for r in l:
    ans *= r % (10 ** 9 + 7)
  print(ans)

Submission status: Runtime Error

Solution code:
def prime(p):
  if p == 2:
    return True
  else:
    count = 0
    for i in range(1, int(p ** 0.5), 2):
      if p % i == 0:
        count += 1
    if count == 1:
      return True
    else:
      return False
N = int(input())
if N == 1:
  print(1)
else:
  p_list = []
  for j in range(2, N + 1):
    if prime(j):
      p_list.append(j)
  l = []
  for p in p_list:
    k = 1
    add = 0
    while N // (p ** k):
      add += N // (p ** k)
      k += 1
    l.append(add + 1)
  for r in l:
    ans *= r % (10 ** 9 + 7)
  print(ans)

Submission status: Runtime Error

Solution code:
import math

def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append([b, e])
        b, e = b + 1, 0
    if n > 1:
        fct.append([n, 1])
    return fct

n = int(input())
mod = 10 ** 9 + 7

l = [0] * (n + 1)

for i in ranfge(1, n + 1):
  soi = factorize(i)
  for j in range(len(soi)):
    l[soi[j][0]] += soi[j][1]

ans = 1
for i in range(1, n + 1):
  ans = ans * (l[i] + 1) % mod

print(ans)

Submission status: Runtime Error

Solution code:
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
from fractions import gcd
from copy import deepcopy
import math
import queue
import numpy as np
#import sympy as syp(素因数分解とか)
Mod = 1000000007
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000) 
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

def factorial(i):
    if i == 1:
        return 1
    else:
        return i*factorial(i-1)
 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)




def main(): #startline--------------------------------------------
    n = int(input())
    p = sieve_of_eratosthenes(n)
    ansdict = defaultdict(int)
    for i in range(1,n+1):
        for j in p:
            subans = 0
            while i % j == 0:
                ansdict[j] += 1
                i //= j
    ans = 1
    for i in ansdict.values():
        ans *= i+1
        ans %= Mod

    print(ans)
if __name__ == "__main__":
    main() 
    
#endline===============================================

Submission status: Runtime Error

Solution code:
N = int(input())

def make_div(n):
  div = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      div.append(i)
    elif i != n // i:
      div.appned(n//i)
  
  div.sort()
  return div

print(len(make_div(N)) % 1000000007)

Submission status: Runtime Error

Solution code:
n = int(input())

import math

f = math.factorial(n)

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

def make_divisors(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)
  return divisors

d = make_divisors(f)

print(len(d))

Submission status: Runtime Error

Solution code:
n=int(input())
def factorization(n):
  primend = []
  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
      primend.append([i,cnt])
  if temp!=1:
    primend.append([temp,1])
  if primen==[]:
    primend.append([n,1])
  return primend#primen,degree
pn=[0]*(n+1)
for i in range(1,n+1):
  for j in factorization(i):
    pn[j[0]]+=j[1]
ans = 1
for k in range(2,n+1):
  ans*=(pn[k]+1)%(10**9+7)
print(ans%(10**9+7))

Submission status: Runtime Error

Solution code:
n=int(input())
def factorization(n):
  primen = []
  degree = []
  primend = []
  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
      primen.append(i)
      degree.append(cnt)
      primend.append([i,cnt])
  if temp!=1:
    primen.append(temp)
    degree.append(1)
    primend.append([temp,1])
  if primen==[]:
    primen.append(n)
    degree.append(1)
    primend.append([n,1])
  return primend#primen,degree
pn=[0]*(n+1)
for i in range(1,n+1):
  for j in factorization(i):
    pn[j[0]]+=j[1]
ans = 1
for k in range(2,n+1):
  ans*=(pn[k]+1)%(10**9+7)
print(pn%(10**9+7))

Submission status: Runtime Error

Solution code:
import math

N = int(input())
ans = 0
mod = 10**9+7

kai = math.factorial(N)
i = 2

while kai == 0:
    if kai % i == 0:


#for i in range(1,kai+1):
#    if kai % i == 0:
#        ans += 1

print(ans % mod)

Submission status: Runtime Error

Solution code:
import math
import collections
import functools

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

    fn = math.factorial(N)

    c = collections.Counter(prime_factorize(fn))
    
    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: Runtime Error

Solution code:
import math 

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

Submission status: Runtime Error

Solution code:
def memoize(f): #メモ化関数
  table = {}
  def func(*args):
    if not args in table:
      table[args] = func(*args)
    return table[args]
  return func
  
@memoize
def fac(x):
  if x==0:
    return 1
  else:
    return x*fac(x-1)

N=int(input())

def divisor(n): #nの約数を全て求める
    i = 1
    while i * i < n:
        if n%i == 0:
            table.append(i)
            
        i += 1
    table = list(set(table))
    return table

def make_divisors(n):
    cnt=0
    i=1
    while i * i < n:
      if n%i == 0:
        cnt+=2            
        i += 1
    if i*i==n:
      cnt+=1
    return cnt
ans1=fac(N)
ans2=make_divisors(ans1)%(10**9+7)
print(ans2)

Submission status: Runtime Error

Solution code:
@memoize
def fac(x):
  if x==0:
    return 1
  else:
    return x*fac(x-1)

N=int(input())
ans=fac(N)%(10**9+7)
print(ans)

Submission status: Runtime Error

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

def make_divisors(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)

    # divisors.sort()
    return divisors

# n = 10
fact = math.factorial(n)

print(len(make_divisors(fact)) // (10 ** 9 + 7))

Submission status: Runtime Error

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

def make_divisors(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)

    # divisors.sort()
    return divisors

# n = 10
fact = math.factorial(n)

print(len(make_divisors(fact)) // (10 ** 9 + 7))

Submission status: Runtime Error

Solution code:
import sys

args = sys.argv
n = args[0]
import math

def make_divisors(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)

    # divisors.sort()
    return divisors

# n = 10
fact = math.factorial(n)

print(len(make_divisors(fact)) // (10 ** 9 + 7))

Submission status: Runtime Error

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)

n = factorial[-1]
#print(n)

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""
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])

#print(arr)
# 素因数の出現回数をカウントする
ans = 0
for i,j in arr:
    #print(i**j)
    ans += i**j
    
print(ans)

Submission status: Runtime Error

Solution code:
import math


def sieve_of_eratosthenes(n):
    max_prime = int(math.sqrt(n))
    targets = [i for i in range(2, n + 1)]
    primes = []
    while targets[0] <= max_prime:
        p = targets[0]
        primes.append(p)
        targets = [i for i in targets if i % p != 0]
    primes.extend(targets)
    return primes


n = int(input())
p = sieve_of_eratosthenes(n)
ans = 1
for i in p:
    cnt = 0
    for j in range(2, n + 1):
        while j % i == 0:
            j //= i
            cnt += 1
    ans *= cnt + 1
    ans %= 10 ** 9 + 7
print(ans)

Submission status: Runtime Error

Solution code:
P=[0]*1000
x=1
N=int(input())
for i in range(2,N+1):
  A=PF(i)
  for j in range(len(A)):
    P[A[j][0]]=P[A[j][0]]+A[j][1]
P.remove(0)
for i in range(len(P)):
  x=(x*(P[i]+1))%(10**9+7)
print(x)

Submission status: Runtime Error

Solution code:
g

Submission status: Runtime Error

Solution code:
def count_divisor(n):
    if n == 1:
        return 1
    return (count_divisor(n - 1) - 1) * 2 + 1 + 1

n = int(input())
print(count_divisor(n))