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:
import math

def factorization(n):
    def factor_sub(n, m):
        c = 0
        while n % m == 0:
            c += 1
            n /= m
        return c, n
    #
    buff = []
    c, m = factor_sub(n, 2)
    if c > 0: buff.append((2, c))
    c, m = factor_sub(m, 3)
    if c > 0: buff.append((3, c))
    x = 5
    while m >= x * x:
        c, m = factor_sub(m, x)
        if c > 0: buff.append((x, c))
        if x % 6 == 5:
            x += 2
        else:
            x += 4
    if m > 1: buff.append((m, 1))
    return buff


def divisor_num(n):
    a = 1
    for _, x in factorization(n):
        a *= x + 1
    return a

N = int(raw_input())

s = math.factorial(N)

print divisor_num(s)

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())

    primes = sieve(N)
    print(primes)

    res = 1
    for p in primes:
        n = (N//p)
        print(n)
        res *= (n*(n+1))/2
        res = res % (10**9 + 7)

    print(res)

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

def mark(s, x):
    for i in range(x + x, len(s), x):
        s[i] = False

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
from collections import Counter
def primes(n):
    pp = [True] * (n+10)
    pp[0] = False
    pp[1] = False

    for i in range(2,n+10):
        if pp[i]:
            for j in range(2,(n+10)//i):
                pp[i*j] = False
    result = [i for i in range(n+1) if pp[i]]
    return result



if __name__=="__main__":
    N= int(input())

    pr = primes(N)
    counter = Counter()
    for p in pr:
        x = p
        while x <= N:
            counter[p] += N//x
            x *= p
    result = 1
    for x in counter.values():
        result = (result * (x+1)) % 1000000007
    print(result)

Submission status: Wrong Answer

Solution code:
def SieveOfEratosthenes(n):
    prime = [True for i in range(n + 1)]
    p = 2
    while (p * p <= n):

        if (prime[p] == True):

            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 1
    lis = []
    for i in range(2,n):
        if prime[i]:
            lis.append(i)
    return lis

n = int(input())

lis1 = []

l = SieveOfEratosthenes(n)

for i in l:
    m = n
    z = i
    exp = 0
    while(m>=z):
        exp += m//z
        z*=i
    lis1.append(exp)

mul = 1
for i in lis1:
    mul *= (i+1)


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

Submission status: Wrong Answer

Solution code:
def SieveOfEratosthenes(n):
    prime = [True for i in range(n + 1)]
    p = 2
    while (p * p <= n):

        if (prime[p] == True):

            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 1
    lis = []
    for i in range(2,n):
        if prime[i]:
            lis.append(i)
    return lis

n = int(input())

lis1 = []

l = SieveOfEratosthenes(n)

for i in l:
    m = n
    z = i
    exp = 0
    while(m>=z):
        exp += m//z
        z*=i
    lis1.append(exp)

mul = 1
for i in lis1:
    mul *= (i+1)


print(mul)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = 1
t = 0
for i in range(1, n+1):
  s *= i
for i in range(1, s+1):
  if s % i == 0:
    t += 1
print(t % (10 ** 9 + 7))

Submission status: Time Limit Exceeded

Solution code:
import math
n = int(input())
f = math.factorial(n)
count = 0
mod = 10**9 + 7
for i in range(f, 0, -1):
    if f % i == 0: count += 1
print(count % mod)

Submission status: Time Limit Exceeded

Solution code:
import math
n = int(input())
f = math.factorial(n)
count = 0
mod = 10**9 + 7
for i in range(f, 0, -1):
    if f % i == 0: count += 1
    if count == mod: count -= mod 
print(count)

Submission status: Time Limit Exceeded

Solution code:
import math
num = int(input())
total = 0
fac = math.factorial(num)
for i in range(1, fac+1):
  if(fac % i == 0):
    total += 1
print(total)

Submission status: Time Limit Exceeded

Solution code:
import math
num = int(input())
total = 0
fac = math.factorial(num)
for i in range(1, (fac+1) % (10**9 + 7)):
  if(fac % i == 0):
    total += 1
print(total)

Submission status: Time Limit Exceeded

Solution code:
import math
num = int(input())
total = 0
fac = math.factorial(num)
for i in range(1, fac+1):
  if(fac % i == 0):
    total += 1
print(total%(10**9 + 7))

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
total = 0
fac = 1
for i in range(1, num+1):
  fac *= i
for i in range(1, fac+1):
  if(fac % i == 0):
    total += 1
print(total)

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
f = 1

for i in range(num):
  f = f * (i+1)
  
divisors = 0
  
for i in range(f):
  if f%(i+1) == 0:
    divisors += 1
    
print(divisors)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

import math
N = math.factorial(n)

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

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

factorial = 1
divisor = []
ans = 0

for i in range(1,n+1):
    factorial = factorial * i

for i in range(1,factorial+1):
    if factorial % i == 0:
        divisor.append(i)

# print(divisor)

ans = len(divisor) % (10 ** 9 + 7)

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

def solve(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

def factorial_cor(n):
    fact = 1
    for integer in range(1, n + 1):
        fact *= integer
    return fact

tmp = 1
'''
for i in range(1,N+1):
    tmp *= i
'''

print(len(solve(factorial_cor(N)))%(10**9+7))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

ans = 0
k = 1
for i in range(n):
    k = k*(i+1)

for i in range(k):
    if (k % (i+1) == 0):
        ans += 1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

ans = 0
k = 1
for i in range(n):
    k = k*(i+1)

for i in range(k):
    if (k % (i+1) == 0):
        ans += 1

if (ans < (10**9+7)):
    print(ans)
else:
    print(ans % (10**9+7))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
b=1
for a in range(1,N+1):
    b*=a
count=0
for c in range(1,b+1):
    if b%c==0:
        count+=1
    else:
        pass
print(count%(10**9+7))

Submission status: Time Limit Exceeded

Solution code:
import math

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

kai = math.factorial(N)


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

print(ans % mod)

Submission status: Time Limit Exceeded

Solution code:
import math

N = int(input())
ans = 0

kai = math.factorial(N)

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

print(ans)

Submission status: Time Limit Exceeded

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)

ans =0

# 割り切れる数を探す。
for i in range(1, n+1):
    if n%i ==0:
        ans +=1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
def prm(a):
  if a==1:
    return False
  for i in range(2,int(a**0.5+1)):
    if a%i==0:
      return False
  else:
    return True
x=int(input())
d=[1]*(x+1)
for i in range(1,x+1):
  if prm(i):
    d[i]+=1
  else:
    while not prm(i):
      for j in range(2,i):
        if i%j==0:
          d[j]+=1
          i=i//j
          break
ans=0
for i in range(x+1):
  ans = ans * d[i] % (10**9+7)
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import math
n=int(input())
klist=[]
MOD=10**9+7
ans=1
n=math.factorial(n)
for i in range(2,n+1):
    kaisu=0
    while n%i==0:
        n=n//i
        kaisu+=1
    if kaisu!=0:
        klist.append(kaisu%MOD)
for i in range(len(klist)):
    ans*=((klist[i]+1)%MOD)
ans=ans%MOD
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import math
N = int(input())
d = math.factorial(N)

k, ans = 1, 1
for i in range(1, N + 1):
    while d % i == 0:
        d //= i
        k += 1
    ans *= k
    k = 1
print(ans % (10**9 + 7))

Submission status: Time Limit Exceeded

Solution code:
import math
n=math.factorial(int(input()))
yakusuu=[0 for i in range(1,n+1) if n%i==0]
print(len(yakusuu)%(10**9+7))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import math

n = int(input())

nk = math.factorial(n)

ans_list = []

for i in range(1, nk+1):
    if nk % i == 0:
        ans_list.append(i)

print(len(ans_list))

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
import math

n = input()

N = math.factorial(int(n))

j= 0

for i in range(1, N+1):
    if N % i == 0:
        j += 1
    
print(j % 1000000007)

Submission status: Time Limit Exceeded

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: Time Limit Exceeded

Solution code:
n = int(input())
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)))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())

import math
factN=math.factorial(N)
count=0
for i in range(1, factN+1):
    if factN%i==0:
        count+=1
    else:
        count=count

count=count%(10**9+7)
print(count)

Submission status: Time Limit Exceeded

Solution code:
import math
n = int(input())
l = []
mod = 10** 9 + 7

n_fac = math.factorial(n)

for i in range(1,n_fac+1):
    if n_fac % i == 0:
        l.append(i)

print(len(l) % mod)

Submission status: Time Limit Exceeded

Solution code:
import math
N = int(input())
M=math.factorial(N)
ans = 0
for i in range(1,M+1):
  if M%i == 0:
    ans+=1
print(ans%(10**9+7))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import math

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

m = math.factorial(n)

for j in range(1,m+1):
    if m % j == 0:
        count += 1
        
print(count % mod)

Submission status: Time Limit Exceeded

Solution code:
import sys
import math

a = int(input())
num = math.factorial(a)
yakusuu_array = []

for i in range(1,num):
    if num % i == 0:
        yakusuu_array.append(i)
print(len(yakusuu_array)+1)

Submission status: Time Limit Exceeded

Solution code:
import math
from decimal import *
mod = 10 ** 9 + 7


N = int(input())

sosuu = [2,3,5,7, 11, 13, 17]
for i in range(2, N+1):
    if i % 2 == 0 or i % 3 == 0 or i == 5 or i % 7 == 0 or i % 11 == 0 or i%13 == 0 or i%17 == 0:
        continue
    for j in range(2,i+1):
        if j == i:
            sosuu.append(i)
        if i % j == 0:
            break

soinsuu_num = [0 for i in range(len(sosuu))]

for i in range(1, N+1):
    if i == 1:
        continue
    temp = i
    for j in range(len(sosuu)):
        while temp % sosuu[j] == 0 and temp != 1:
            soinsuu_num[j] += 1
            temp = Decimal(temp) / Decimal(sosuu[j])

ans = 1
for i in soinsuu_num:
    if i != 0:
        ans = ans * (i + 1) % mod

print(ans)

Submission status: Time Limit Exceeded

Solution code:
import math
from decimal import *
mod = 10 ** 9 + 7


N = int(input())

sosuu = [2,3,5, 7]
for i in range(2, N+1):
    if i % 2 == 0 or i % 3 == 0 or i == 5 or i % 7 == 0:
        continue
    for j in range(2,i+1):
        if j == i:
            sosuu.append(i)
        if i % j == 0:
            break

soinsuu_num = [0 for i in range(len(sosuu))]

for i in range(1, N+1):
    if i == 1:
        continue
    temp = i
    for j in range(len(sosuu)):
        while temp % sosuu[j] == 0 and temp != 1:
            soinsuu_num[j] += 1
            temp = Decimal(temp) / Decimal(sosuu[j])

ans = 1
for i in soinsuu_num:
    if i != 0:
        ans = ans * (i + 1) % mod

print(ans)

Submission status: Time Limit Exceeded

Solution code:
import math
from decimal import *
mod = 10 ** 9 + 7


N = int(input())

sosuu = []
for i in range(2, N+1):
    for j in range(2,i+1):
        if j == i:
            sosuu.append(i)
        if i % j == 0:
            break


soinsuu_num = [0 for i in range(len(sosuu))]

for i in range(1, N+1):
    if i == 1:
        continue
    temp = i
    for j in range(len(sosuu)):
        while temp % sosuu[j] == 0 and temp != 1:
            soinsuu_num[j] += 1
            temp = Decimal(temp) / Decimal(sosuu[j])

ans = 1
for i in soinsuu_num:
    if i != 0:
        ans = ans * (i + 1) % mod

print(ans)

Submission status: Time Limit Exceeded

Solution code:
import math

m = int(input())
n = math.factorial(m)
l = []
for i in range(1, n+1, 1):
  if n % i == 0:
    l.append(i)
    i += 1
  else:
      i += 1
      
count = len(l)  #正の約数の個数
ans = count % (10**9+7)
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import math

def getPrimeFactorsList(num):
  pn = 2 #素数は2から
  pflist = [] #素因数のリスト
  while pn * pn <= num: #√numまで調べる
    while num % pn == 0: #現在の素数で割り切れる範囲でループ
      num = num / pn
      pflist.append(pn)
    pn += 1 #割り切れなくなったら次の素数へ
  if num > 1:
    pflist.append(int(num))
    
  return pflist
mod = (10 ** 9 + 7)
N = int(input())
ans = 0
num = math.factorial(N)
#print(num)
for i in range(1, num+1):
  count = 1
  pflist = getPrimeFactorsList(i)
  pfset = set(pflist)
  for j in pfset:
    count *= (pflist.count(j) + 1)
  #print("-----")
  #print(count)
  #print("-----")
  ans += count
  
print(count % mod)

Submission status: Time Limit Exceeded

Solution code:
sosu=[1, 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]
n=int(input())
ans=1
p=10**9+7
for i in sosu:
  if i<=n:
    stack=0
    num=i
    while num<=n:
      stack+=n//num
      num*=i
    ans*=(stack+1)
    ans%=p
print(ans)

Submission status: Time Limit Exceeded

Solution code:
def check_sosu(x):
  for i in range(2,x//2+1):
    if x%i==0:
      return False
  return True
sosu=[]
for i in range(1,10**3+1):
  if check_sosu(i):
    sosu.append(i)
n=int(input())
ans=1
p=10**9+7
for i in sosu:
  if i<=n:
    stack=0
    num=i
    while num<=n:
      stack+=n//num
      num*=i
    ans*=(stack+1)
    ans%=p
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
mod = 10**9+7
ans=[1]*12
prime=[2,3,5,7,11,13,17,19,23,27,29,31]
for i in range(1,n+1):
    j=i
    while j>1:
        for k in range(12):
            if j%prime[k]==0:
                ans[k]=(ans[k]+1)%mod
                j=j//prime[k]
A=1
for m in range(12):
    A = (A*ans[m])%mod
print(A)

Submission status: Time Limit Exceeded

Solution code:
import math

N = int(input())
a = math.factorial(N)
ans = 0

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
fact = 1
mod = 10**9 + 7

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]]


for i in range(1,N+1):
    fact *= i

s = 0
R = primes(N)
I = fact

soinsu = []
tmp = 1
cnt = 1
ans = 1
while s==0:
    for i in R:

        if I%i==0:
            I=I//i
            if I==1:
                s=1
#            soinsu.append(i)
            if i == tmp:
                cnt += 1
            else:
                ans *= (cnt + 1)
                ans %= mod
                cnt  = 1
                tmp = i
            break

#dic = collections.Counter(soinsu)
# ans = 1
# for v in dic.values():
#     ans *= v + 1
#     ans %= mod


print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
fact = 1
mod = 10**9 + 7

for i in range(1,N+1):
    fact *= i

s = 0
R = fact
I = fact

tmp = 1
cnt = 1
ans = 1
while s==0:
    for i in range(2,R+1):

        if I%i==0:
            I=I//i
            if I==1:
                s=1
#            soinsu.append(i)
            if i == tmp:
                cnt += 1
            else:
                ans *= (cnt + 1)
                ans %= mod
                cnt  = 1
                tmp = i
            break

#dic = collections.Counter(soinsu)
# ans = 1
# for v in dic.values():
#     ans *= v + 1
#     ans %= mod


print(ans)

Submission status: Time Limit Exceeded

Solution code:
import math
class MathAlgo(object):
    
    @classmethod
    def make_primes(cls, size):
        primes = []
        flag = [True for i in range(size)]
        limit = int(math.sqrt(size))

        for i in range(2, limit):
            if flag[i]:
                primes.append(i)
                for j in range(i, size, i):
                    flag[j] = False

        for i in range(limit, size):
            if flag[i]:
                primes.append(i)

        cls.primes = primes
        cls.prime_flag = flag
        return cls.primes

    @classmethod
    def prime_div(cls, N, primes):
        m = {1:1}
        while True:
            ok = False
            for i in range(len(primes)):
                if N%primes[i] == 0:
                    if primes[i] in m:
                        m[primes[i]] += 1
                    else:
                        m[primes[i]] = 1
                    N = N // primes[i]
                    break
                if primes[i] > N:
                    ok = True
                    break
            if ok:
                break
        cls.pd = m
        return cls.pd


N = int(input())
pd = {}
primes = MathAlgo.make_primes(N+1)
for i in range(1,N+1):
    pdi = MathAlgo.prime_div(i,primes)
    for k in pdi.keys():
        if k in pd:
            pd[k] += pdi[k]
        else:
            pd[k] = pdi[k]
del pd[1]
ans = 1
for k in pd.keys():
    ans = (ans*(pd[k]+1)) % 1000000007
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import collections

N = int(input())
fact = 1
mod = 10**9 + 7

for i in range(1,N+1):
    fact *= i

s = 0
R = fact
I = fact

soinsu = []
tmp = 1
cnt = 1
ans = 1
while s==0:
    for i in range(2,R+1):

        if I%i==0:
            I=I//i
            if I==1:
                s=1
#            soinsu.append(i)
            if i == tmp:
                cnt += 1
            else:
                ans *= (cnt + 1)
                ans %= mod
                cnt  = 1
                tmp = i
            break

#dic = collections.Counter(soinsu)
# ans = 1
# for v in dic.values():
#     ans *= v + 1
#     ans %= mod


print(ans)

Submission status: Time Limit Exceeded

Solution code:
import collections

N = int(input())
fact = 1
mod = 10**9 + 7

for i in range(1,N+1):
    fact *= i

s = 0
R = fact
I = fact

soinsu = []
while s==0:
    for i in range(2,R+1):
        if I%i==0:
            I=I//i
            if I==1:
                s=1
            soinsu.append(i)
            break

dic = collections.Counter(soinsu)

ans = 1
for v in dic.values():
    ans *= v + 1
    ans %= mod


print(ans)

Submission status: Time Limit Exceeded

Solution code:
import math
n = int(input())
k = math.factorial(n)

li = []
for i in range(1, k + 1):
    if k % i == 0:
        li.append(i)

print(len(li))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
import math
a = math.factorial(N)

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
import math
a = math.factorial(N)

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = []
num = 1
res = 0
#make n!
for i in range(1,n+1):
    num *= i
#main calc
for j in range(num):
    if num%(j+1) == 0:
        res += 1

print(res)

Submission status: Time Limit Exceeded

Solution code:
import math
n=int(input())
mod=10**9+7
v=math.factorial(n)
ans=[i for i in range(1,v+1) if v%i==0]
print(len(ans)%mod)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
mod=10**9+7
import math
v=math.factorial(n)
ans=[]
for i in range(1,v+1):
    if v%i==0:
        ans.append(i)
print(len(ans)%mod)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
mod=10**9+7
import math
v=math.factorial(n)
ans=[]
for i in range(1,v+1):
    if v%i==0:
        ans.append(i)
print(len(ans))

Submission status: Time Limit Exceeded

Solution code:
# -*- coding:utf-8 -*-

# input N
n = int(input())

# N!を求める
nk = 1
for i in range(2, n+1):
    nk *= i

# nkの約数の個数を求める
x = 0
for i in range(1, nk+1):
    if nk % i == 0:
        x += 1

# xを10^9 + 7で割った余りを出力
x2 = x % (pow(10, 9) + 7)
print(x2)

Submission status: Time Limit Exceeded

Solution code:
import math
n = math.factorial(int(input()))
factors = [x for x in range(1, n + 1) if n % x == 0]
print(int(len(factors) % (10E9 + 7)))

Submission status: Time Limit Exceeded

Solution code:
import sys

sys.setrecursionlimit(10000)

N = int(input())


x = 0

def fact_iter(n, res):
    if n == 0:
        return res
    else:
        return fact_iter(n-1, n*res)

s = fact_iter(N, 1)

for i in range(1,s+1):
	if (s % i) == 0:
		x = x + 1

ans = x % (1000000000 + 7)

print(ans)

Submission status: Time Limit Exceeded

Solution code:
def kaijo(a):
    if a == 0:
        return 1
    return a*kaijo(a-1)

def sosu_num(a):
    count = 0
    for i in range(1, a+1):
        if a % i == 0:
            count += 1
    return count % (10**9 + 7)

N = int(input())
print(sosu_num(kaijo(N)))

Submission status: Memory Limit Exceeded

Solution code:
import sys
from collections import defaultdict
from bisect import bisect_right as bi_r

U = 2 * 10 ** 6
def sieve_of_eratosthenes(n=U):
  if n == 1: return set()
  sieve = set(range(2, n + 1))
  for p in sieve_of_eratosthenes(int(n ** 0.5)):
    sieve -= set(range(p * 2, n + 1, p))
  return sieve

prime_numbers = sieve_of_eratosthenes()
soted_prime_numbers = sorted(prime_numbers)

def is_prime(n): return n in prime_numbers

def prime_factorize(n):
  res = defaultdict(int)
  if n < 2: return res
  for p in soted_prime_numbers[:bi_r(soted_prime_numbers, int(n ** 0.5))]:
    while n % p == 0:
      res[p] += 1
      n //= p
    if n == 1:
      return res
  res[n] = 1
  return res

def prime_factorize_factorial(n):
  res = defaultdict(int)
  for i in range(2, n + 1):
    for p, c in prime_factorize(i).items():
      res[p] += c
  return res

MOD = 10 ** 9 + 7

n = int(sys.stdin.readline().rstrip())

def main():
    res = 1
    for c in prime_factorize_factorial(n).values():
        res *= c + 1; res %= MOD
    print(res)

if __name__ ==  '__main__':
    main()

Submission status: Memory Limit Exceeded

Solution code:
import sys
from collections import defaultdict
from bisect import bisect_right as bi_r

U = 4 * 10 ** 6
def sieve_of_eratosthenes(n=U):
  if n == 1: return set()
  sieve = set(range(2, n + 1))
  for p in sieve_of_eratosthenes(int(n ** 0.5)):
    sieve -= set(range(p * 2, n + 1, p))
  return sieve

prime_numbers = sieve_of_eratosthenes()
soted_prime_numbers = sorted(prime_numbers)

def is_prime(n): return n in prime_numbers

def prime_factorize(n):
  res = defaultdict(int)
  if n < 2: return res
  for p in soted_prime_numbers[:bi_r(soted_prime_numbers, int(n ** 0.5))]:
    while n % p == 0:
      res[p] += 1
      n //= p
    if n == 1:
      return res
  res[n] = 1
  return res

def prime_factorize_factorial(n):
  res = defaultdict(int)
  for i in range(2, n + 1):
    for p, c in prime_factorize(i).items():
      res[p] += c
  return res

MOD = 10 ** 9 + 7

n = int(sys.stdin.readline().rstrip())

def main():
    res = 1
    for c in prime_factorize_factorial(n).values():
        res *= c + 1; res %= MOD
    print(res)

if __name__ ==  '__main__':
    main()

Submission status: Memory Limit Exceeded

Solution code:
import sys
from collections import defaultdict
from bisect import bisect_right as bi_r

U = 5 * 10 ** 6
def sieve_of_eratosthenes(n=U):
  if n == 1: return set()
  sieve = set(range(2, n + 1))
  for p in sieve_of_eratosthenes(int(n ** 0.5)):
    sieve -= set(range(p * 2, n + 1, p))
  return sieve

prime_numbers = sieve_of_eratosthenes()
soted_prime_numbers = sorted(prime_numbers)

def is_prime(n): return n in prime_numbers

def prime_factorize(n):
  res = defaultdict(int)
  if n < 2: return res
  for p in soted_prime_numbers[:bi_r(soted_prime_numbers, int(n ** 0.5))]:
    while n % p == 0:
      res[p] += 1
      n //= p
    if n == 1:
      return res
  res[n] = 1
  return res

def prime_factorize_factorial(n):
  res = defaultdict(int)
  for i in range(2, n + 1):
    for p, c in prime_factorize(i).items():
      res[p] += c
  return res

MOD = 10 ** 9 + 7

n = int(sys.stdin.readline().rstrip())

def main():
    res = 1
    for c in prime_factorize_factorial(n).values():
        res *= c + 1; res %= MOD
    print(res)

if __name__ ==  '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

MOD = 1000000007  # type: int


def solve(N: int):
    from itertools import chain
    from collections import Counter
    from functools import reduce
    pu = PrimeUtil(N+1)
    c = Counter(chain.from_iterable(pu.factor_iter(i) for i in range(2, N+1)))
    return reduce(lambda a,b: a*(b+1)%MOD, c.values(), 1)

class PrimeUtil:

    def __init__(self, size):
        self.size = size
        self._init_table()
  
    def _init_table(self):
        from itertools import takewhile
        self._is_prime = [True] * self.size
        self._is_prime[0] = False
        self._is_prime[1] = False
        for i in takewhile(lambda x: x*x<=self.size, range(self.size)):
            if not self._is_prime[i]:
                continue
            for j in range(i+i, self.size, i):
                self._is_prime[j] = False

    def prime_iter(self):
        return filter(lambda x: self._is_prime[x], range(self.size))

    def primes(self):
        return tuple(self.prime_iter())

    def factor_iter(self, n):
        from itertools import takewhile
        m = n
        for p in self.prime_iter():
            while m % p == 0:
                yield p
                m //= p
            if m == 1:
                return
    
    def factors(self, n):
        return tuple(self.factor_iter(n))

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    print(solve(N))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 30 01:24:22 2020

@author: liang
"""

MOD = 10**9 + 7
N = int(input())
data = [i for i in range(2,N+1)]
table = list()

#素数リスト
while data:
    tmp = data[0]
    table.append(tmp)
    data = [i for i in data if i%tmp != 0]
    
#print(table)
res = dict()
for i in range(2,N+1):
    for t in table:
        if i%t == 0:
            if t not in res:
                res[t] = 1
            tmp = i
            while tmp%t == 0:
                res[t] += 1
                tmp //= t                
                
ans = 1
for r in res.values():
    ans *= r
    ans %= MOD
#print(res)
print(ans)

Submission status: Accepted

Solution code:
import collections
n = int(input())
x = []
def factorization(n):
    d = []
    while n % 2 == 0:
        d.append(2)
        n /= 2
    f = 3
    while f*f <= n:
        if n % f == 0:
            d.append(int(f))
            n /= f
        else:
            f += 2
    if n != 1:
        d.append(n)
    return d

for i in range(n, 1, -1):
    x += factorization(i)

c = collections.Counter(x)
l = list(c.values())
ans = 1

for i in range(len(l)):
    ans *= 1 + l[i]

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

Submission status: Accepted

Solution code:
import collections
import numpy
n = int(input())
x = []
def factorization(n):
    d = []
    while n % 2 == 0:
        d.append(2)
        n /= 2
    f = 3
    while f*f <= n:
        if n % f == 0:
            d.append(int(f))
            n /= f
        else:
            f += 2
    if n != 1:
        d.append(n)
    return d

for i in range(n, 1, -1):
    x += factorization(i)

c = collections.Counter(x)
l = list(c.values())
ans = 1

for i in range(len(l)):
    ans *= 1 + l[i]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = [1] * n
ans = 1

for i in range(1,n+1):
    b = 2
    
    while i != 1:
        if i % b == 0:
            i //= b
            a[b-1] += 1
        else:
            b += 1
            
for i in a:
    if 1 < i:
        ans *= i
        ans %= 10**9 + 7
            
print(ans)