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

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

e=get_sieve_of_eratosthenes(n)
l=len(e)

co=1
for i in range(l):
    k=e[i]
    co_sub=1
    l_sub=int(math.log(n,k))
    for j in range(1,l_sub+1):
        co_sub+=n//(k**j)
    co*=co_sub
    co%=(10**9+7)
    #print(co_sub)
print(co)

Submission status: Runtime Error

Solution code:
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

li = prime_factorize(total)
lin = []
for key, value in groupby(li):
    lin.append(len(list(value)))

point = 1

for i in lin:
    point *= i+1
    point %= 10**9+7

print(point)

Submission status: Runtime Error

Solution code:
def factori(N):
  if N == 1:
    return 1
  return factori(N-1)*N

def factor(Num):
  return Num%(10**9+7)

N = int(input())
factor(factori(N))

Submission status: Runtime Error

Solution code:
import sys
from functools import reduce
import copy
import math
from pprint import pprint
import collections
import bisect
import itertools


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    N = int(inputs[0])
    SSSS = 1000000007
    count = collections.Counter()

    for i in range(1, N+1):
        target = i
        is_end = False
        while not is_end:
            is_end = True
            for j in range(2, int(math.sqrt(target)+1)):
                if target % j == 0:
                    count[j] += 1
                    target = target // j
                    is_end = False
                    break
            if is_end and target != 1:
                count[target] += 1
    c = 1
    for k, v in count.items():
        c *= (v + 1)
        c = c % SSSS
    return c


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    N = int(input())
    ret = solve(inputs(N-1))
    for r in ret:
        print(r)

Submission status: Runtime Error

Solution code:
import math
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])

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

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

    return arr

L = factorization(math.factorial(n))

out = 1
for i in range(len(L)):
  out = out * (L[i][1] + 1)
out = out % (pow(10,9)+7)
print(out)

Submission status: Runtime Error

Solution code:
import math
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])

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

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

    return arr

L = factorization(math.factorial(n))

out = 1
for i in range(len(L)):
  out = out * (L[i][1] + 1)
print(out)

Submission status: Runtime Error

Solution code:
def prime_factrization(n):
    a=[]
    for i in range(2,int(n**0.5)+1):
        while n%i==0:
            n//=i
            a.append(i)
    if a==[]:
        a.append(n)
    else:
        if n!=1:
            a.append(n)
    return a
    
n=int(input())
if n==1:
    print(1%(10**9+7))
else:
    L=[]
    for i in range(2,n+1):
        L+=prime_factrization(i)
    LC=Counter(L)
    r=1
    for v in LC.values():
        r*=(v+1)
    print(r%(10**9+7))

Submission status: Runtime Error

Solution code:
num = int(input())
div_sum = defaultdict(int)

p = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31]

for j in range(1, 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: Runtime Error

Solution code:
import collections
import itertools
import functools
import math

s = set([])
if __name__ == "__main__":
    n = math.factorial(int(input()))
    prims = (n + 1) * [0]
    p = 2
    while n >= p*p:
        if n % p == 0:
            prims[p] += 1
            n = n // p
        else:
            p += 1
    prims[n] += 1
    print(functools.reduce(lambda x, y: x * (y + 1), prims, 1) % (10**9 + 7))

Submission status: Runtime Error

Solution code:
import collections
import itertools
import functools
import math

s = set([])
if __name__ == "__main__":
    n = math.factorial(int(input()))
    prims = (n + 1) * [0]
    p = 2
    while n >= p*p:
        if n % p == 0:
            prims[p] += 1
            n = n // p
        else:
            p += 1
    prims[n] += 1
    print(functools.reduce(lambda x, y: x * (y + 1), prims, 1) % 10**9 + 7)

Submission status: Runtime Error

Solution code:
import collections
import itertools
import functools
import math

s = set([])
if __name__ == "__main__":
    n = math.factorial(int(input()))
    prims = (n + 1) * [0]
    p = 2
    while n >= p*p:
        if n % p == 0:
            prims[p] += 1
            n = n // p
        else:
            p += 1
    prims[n] += 1
    print(functools.reduce(lambda x, y: x * (y + 1), prims, 1))

Submission status: Runtime Error

Solution code:
n=int(input())

import numpy as np

def seachPrimeNum(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum

if n=1:
  print("1")
else:
  f=len(seachPrimeNum(n))
  g=seachPrimeNum(n)
  c=1
  
  for j in range(f):
    e=g[j]
    a=0
    b=n
    h=0
    while b>=e:
      b=b//e
      h=h+b
      a=a+1
    c=c*(h+1)
  print(c%(10**9+7))

Submission status: Runtime Error

Solution code:
n=int(input())

import numpy as np

def seachPrimeNum(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum

f=len(seachPrimeNum(n))
g=seachPrimeNum(n)
c=1

for j in range(f):
  e=g[j]
  a=0
  b=n
  h=0
  while b>=e:
    b=b//e
    h=h+b
    a=a+1
  c=c*(h+1)
print(c%(10**9+7))

Submission status: Runtime Error

Solution code:
def make_prime(n):
    prime = []
    temp = n
    for i in range(2, int(n**0.5) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            prime.append([i, cnt])
    if temp!=1:
        prime.append([temp, 1])
    if prime==[]:
        prime.append([n, 1])

    return prime
def factional_for(n):
    result = 1
    for i in range(n, 0, -1):
        result *= i
    return result
num = int(input())
w=10**9+7
s=1
prime_num_list = make_prime(factional_for(num))
for i in range(len(prime_num_list)):
    s *= (prime_num_list[i][1]+1)%w
print(s)

Submission status: Runtime Error

Solution code:
def make_prime(n):
    prime = []
    temp = n
    for i in range(2, int(n**0.5) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            prime.append([i, cnt])
    if temp!=1:
        prime.append([temp, 1])
    if prime==[]:
        prime.append([n, 1])

    return prime
def factional_for(n):
    result = 1
    for i in range(n, 0, -1):
        result *= i
    return result
num = int(input())
w=10**9+7
s=0
prime_num_list = make_prime(factional_for(num))
for i in range(len(prime_num_list)):
    s += (prime_num_list[i][1]+1)%w
print(s)

Submission status: Runtime Error

Solution code:
def make_prime(n):
    prime = []
    temp = n
    for i in range(2, int(n**0.5) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            prime.append([i, cnt])
    if temp!=1:
        prime.append([temp, 1])
    if prime==[]:
        prime.append([n, 1])

    return prime
def factional_for(n):
    result = 1
    for i in range(n, 0, -1):
        result *= i
    return result
num = int(input())
s=0
prime_num_list = make_prime(factional_for(num))
print(prime_num_list)
for i in range(len(prime_num_list)):
    s += prime_num_list[i][1]+1
print(s)

Submission status: Runtime Error

Solution code:
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

def make_factorial(n):
    if n <= 1:
        return 1
    else:
        return n*make_factorial(n-1)
num = int(input())
print(len(make_divisors(make_factorial(num))))

Submission status: Runtime Error

Solution code:
import math
import sympy

n = int(input())

nk = math.factorial(n)
ans = sympy.divisor_count(nk)

print(ans)

Submission status: Runtime Error

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*=(ka+1)
print(ans)

Submission status: Runtime Error

Solution code:
import collections
import functools
DIVISOR = 10 ** 9 + 7
n = int(input())

prime_factor = collections.defaultdict(int)

for i in range(1, n + 1):
    tmp = i
    for j in range(2, int(n ** 0.5) + 1):
        while tmp % j == 0:
            prime_factor[j] += 1
            tmp //= j

    if tmp > 1:
        prime_factor[tmp] += 1

# print(prime_factor)
prime_factor_num = [prime_factor[key] + 1 for key in prime_factor]

print((functools.reduce(lambda x, y: (x % DIVISOR) * y, prime_factor_num)) % DIVISOR)

Submission status: Runtime Error

Solution code:
#include<iostream>
#include<map>
using namespace std;
const int mo=1e9+7;
main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    int n;
    cin>>n;
    map<int,int>m;      
    for(int i=2;i<=n;i++)
    {
        int x=i;
        for(int j=2;j*j<=x;j++)
        {
            while(x%j==0)
            {
                m[j]++;
                x/=j;
            }
        }
        if(x!=1)m[x]++;
    }
    long long ans=1;
    for(auto it:m)ans=(ans*(it.second+1)%mo);
    cout<<ans;
    return 0;
}

Submission status: Runtime Error

Solution code:
import math
from sympy import sieve
N=int(input())

num = math.factorial(N)
primeNum=[]

for i in range(2,1000):
  flag=False  
  for j in range(2,i):
    if i%j==0:
      flag=True
      break
  if flag==False:
    primeNum.append(i)
    

# primeNum = [i for i in sieve.primerange(1,1000)]
# print(primeNum)
resulNum=[0]*len(primeNum)
result=1

j=0
flag=False
for i in primeNum:
  while num % i == 0 :
    num = num // i
    resulNum[j]+=1
    flag=True
  
  if flag==True:
    result*=(resulNum[j]+1)
    result %= 10**9+7
  j+=1
  flag=False

print(result)

Submission status: Runtime Error

Solution code:
import math
from sympy import sieve
N=int(input())

num = math.factorial(N)
primeNum = [i for i in sieve.primerange(1,10000000)]
# print(primeNum)
resulNum=[0]*len(primeNum)
result=1

j=0
for i in primeNum:
  while num % i == 0 :
    num = num // i
    resulNum[j]+=1
  j+=1

for i in resulNum:
  if i>0:
    result*=(i+1)
    result %= 10**9+7

print(result)

Submission status: Runtime Error

Solution code:
from math import sqrt
N = int(input())
mod = 10 ** 9 + 7 
divs = [0] * (N + 1)
for i in range(1, N + 1):
  for j in range(1, sqrt(i)):
    if i % j == 0:
      divs[j] += 1
print(sum(divs))

Submission status: Runtime Error

Solution code:
def kjsoinscount(n):
    res_ls=[]
    for i in range(n): #nの階乗
        if i+1 > 1:
            N=i+1
            for j in range(i+1): #階乗の各要素について素因数分解
                if j+1>1:
                    while N%(j+1)==0:
                        res_ls.append(j+1)
                        N=N/(j+1)
    return res_ls+[1]

def yakspattern(soins_ls):
    import itertools
    from operator import mul
    from functools import reduce
    yaks_ls={}
    for i in range(len(soins_ls)):
        if i>0:
            comb_tup=itertools.combinations(soins_ls,i+1)
            for j in comb_tup:
                #print(j)
                a=reduce(mul,j)
                a=str(a)
                if a not in yaks_ls:
                    #print(j)
                    yaks_ls[a]="ok"
    for i in soins_ls:
        q=str(i)
        yaks_ls[q]="ok"
    yaks_ls
    return yaks_ls.keys

def kjyakscount(n):
    import itertools
    from operator import mul
    from functools import reduce
    yaks_ls=[]
    kj_ls=[i+1 for i in range(n)]
    for i in range(n):
        if i>0:
            comb_tup=itertools.combinations(kj_ls,i+1)
            for j in comb_tup:
                #print(j)
                yaks_ls.append(reduce(mul,j))
                #print(set(yaks_ls))
    return(set(kj_ls+yaks_ls))
    #return(yaks_ls.extend(kj_ls))

n=int(input())
kj=1
for i in range(n):
    kj=kj*(i+1)

print(len(yakspattern(kjsoinscount(n))))

Submission status: Runtime Error

Solution code:
n = int(input())

mod = 10**9+7

sosu = [1] * 100

for j in range(2,n+1):
    tmp = j
    while tmp > 1:
        for i in range(2,n+1):
            if tmp % i == 0:
                sosu[i] += 1
                tmp = tmp // i
        
#print(sosu)
sosu.sort(reverse=True)

ans = 1

for i in range(len(sosu)):
    if sosu[i] > 0:
        ans = ans*sosu[i] % mod
        
print(ans)

Submission status: Runtime Error

Solution code:
import math

n=int(input())
n=math.factorial(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)%(10**9+7))

Submission status: Runtime Error

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

import math
factN=math.factorial(N)
count=0

factor = []
tmp = int(math.sqrt(factN)) + 1
for num in range(2,tmp):
    while factN % num == 0:
            factN //= num
            factor.append(num)

factor_set=list(set(factor))

p=1
for x in factor_set:
    p*=(factor.count(x)+1)
    
    
print(factor)
print(p)

Submission status: Runtime Error

Solution code:
N = int(input())
MOD = 10 ** 9 + 7
x = 1
for i in range(2, N + 1):
  x *= i

count = 1
for i in range(2, N + 1):
  if x % i != 0:
    continue
  count = 1
  while x % i == 0:
    x //= i
    count += 1
  ans *= count
print(ans % MOD)

Submission status: Runtime Error

Solution code:
sosu = []
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 j * j <= 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: Runtime Error

Solution code:
import math
import sys

def make_divisors(n):
    divisors = []
    hoge = 0
    if(n**0.5 > sys.maxint - 1):
      hoge = sys.maxint - 1
    else:
      hoge = int(n**0.5)
    for i in range(1, hoge+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

n = int(input())
print(make_divisors(math.factorial(n)) % (pow(10,9) + 7))

Submission status: Runtime Error

Solution code:
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)
      return divisors

num = int(input())
print(make_divisors(math.factorial(num)) % (pow(10,9) + 7))

Submission status: Runtime Error

Solution code:
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)
	return divisors

num = int(input())
print(make_divisors(math.factorial(num)) % (pow(10,9) + 7))

Submission status: Runtime Error

Solution code:
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)
	return divisors

n = int(input())
print(make_divisors(math.factorial(n)) % (pow(10,9) + 7))

Submission status: Runtime Error

Solution code:
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 = int(input())
print(make_divisors(math.factorial(n)) % (pow(10,9) + 7))

Submission status: Runtime Error

Solution code:
import math

def make_prime_list_2(num):
    if num < 2:
        return []
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0
    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 = int(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

n = int(input())
print(search_divisor_num(math.factorial(n)) % (pow(10,9) + 7))

Submission status: Runtime Error

Solution code:
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(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: Runtime Error

Solution code:
n = int(input())

def search_divisor_num_1(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_1(n) % (pow(10,9) + 7))

Submission status: Runtime Error

Solution code:
//                                    .........
//                      .7>?7n. .(wWWVyyyVyVyyyWWAw-.
//                     J~::::<HyyyyyyyyyyyVyyyyyyyZZuXV<.
//             .?<(((JXF:::::+KW#ZuZyyyyyyZZXZZuuuZOvvrw.?.
//           ,!-vvrwD:;XaJ++jWUWSw_OuVVTV7XzXkzzvo(wrrrrrw+_i 
//         .>.zrrvrd>jdXvvvvrrwWOtrrrwzvvrrrwHkrrrrvrvrvrrvw+?. 
//        .!(rrvrvwXm0vrrwAOrtwRtttrrrrrtttttW0rrrvrvrvrvrrvro.i 
//       .~JrvrrvwVW0<zrwXKtltwRtttttrtrrttttX0rrrvrrvrrvrvrrrw.1
//       <JrrvvvQVWS<czrwWZllOuRttttrtrrtttttXktrvrvrvrrrrZ  (rr/>
//     .<jZ<wrrwHWSwx-JwXKO1lOu$tttrrtrrrrttcJ0rrrrvrwXOltt< .rrw-i
//    .jdvI-jCwXWSrrrvvwW0o(jwZrrOrrrrrzzvrZ>JVtrrrrrtwXOlltrrrrrI,;
//   ,+XHvrvrrdHHvrvvvvZWrttrwKCw<jvuzu>?zz:.JZ=lOroJrtwSllltrvvwrl(.
// .~JZU0rvvvvUWSrrvvzzZStrrrdC1duZZZZZXwuuv<dOllwXrvvrtwklllrrrdRr-> 
//(_7  JrrrrrwHWXrvvzzuuStltOr Jwzzuuuuzzvvv1Izl=lZwrvrtOXOlltrrZ4vI-- 
//     kwyvrrdpKrrvvzzzw0lllZ  (ZttOtrrttttrd>~1==ldOrrrtZklltrrO(kr{>
//    .kdSvvrdWSvvwwuuzdI??1{   z=====llllllw<  1z=lXOrrttXOtlrrr(Rrl(
//    .0d+rrvXWXvwWXuuwOI??v    .z>??????==z$~   ?z=lXOtttdZttrrvzSvw(_
//    .0W(rrvXHXvwWuuwZjVTO=!???<O&x>>+I???d! ..(?79UUUVU6wkrrrrrv0vr>) 
//    .kW(rvvwKXvdWuXw$(z?z       1z1>>zz?1>        1zOvOtrXzuzvvrvrvlt
//    .SW(rrvdWqvwHurd:.I?;     ...~?<<<_<<      ..  _1I(wrdXZuvvrrvv01
//     OWrrrrdWHvwHzwK  1v~.(ggggJ.?!         (<(.JggJ.. .TdKZuzvwkvrXj 
//     .WDzvrdHWwwHzdH.  (MHM###MkTU_         .UTWM##NMMN, ?Huuuw(WvrX( 
//      O>zrrwWHkwHzWW{.dY!jNWML .r_!          !jMd@F  k?Wo juuuIJWvvW(
//        (zrzVWKdMwb.:(% .H@HNM@@N             W@HNMagM. C_,kzzCdWvvfz
//         1wvXWWXHX>_>   .hJHXZWHN             XJWUWWHM:   (Rzz1Hkvw\(-
//          1wdWvHHW<>_    ?U0zzXX=             ,WVCO4y=    ydzZJ 4wd 
//           (wf[?Wr1>(.                ..                 .3JuO\ .SI
//            (Wb zH, .__-_____-                  -__~__.-..~.k2   ,\
//             .4  4WHeo~~~~~~~_.                .~~:~<::~.dqH?     !
//                  4fWTe           .1WW&&&&W1          .(OkP 
//                   4f ,n.         \Y       Y1       .d!.H: 
//                    ?   Wx.        &_    _ 2      .dMK  ?
//                         4 ?a..         ~      ..JWDOq%
//                            (HkMNmx.... ....(&kHP,kk\.K                         
//                          ...?qHNWB:::::::::WHHH-.dK
//                       .J>:jz77<:(C:::::::::O_:~?7f;?3(.
//                    ..z>::::u-~::::~::~:::::(<:::(3::::?-
//                 .,C-::::::<:?x<1+-_~~:~~:(J++?!(3~<:<(J=_<.. 
//               .?   ._1.....~~(z-.._(-1+,.....-J!.._(v!      ?1,
//             .<     !   ?1--...~?iv>___~(T+..J=_(Jv^            <.
//            .=      _       ?7u-((JXJ-((JJZ6+JwY!_      _        (.
//           .}                  ?1&J-:<Z<<<:<+=_        . _.       : 
//           / :   .                 _d7COZW>~           (.  .      ..
//          .: !   (                 .>.~(:d             (~    .    !-
//          (  ~   (                 .z777TT             ..    _   . :
//          :  ~   <_                J<<<<<j_            ._    :   { ( 
//         .   !   >_                >.....({            (_    <  .  (.
//         -   ~   >_               ,~.~..~v)            <     <  ;  .; 
//        .       .>                <..~.._Il            ~     ( .    >
//        .       .~               .>.~..~(Iz                  ( .    ( 
//        <       -~               ,_..~..(>j                  .      . 
//        {       <.               <..~..~(<j.                 ..      _
//                >.               >..~...z:(_                  _      <
//       .        >.              .<.~..~_C(<}                  }      . 
//       _       .~.              .~..~..(>(:>                  }       _
//       :       (~.              ._..~..(<(+>                  >       ~
//       ~       <~_                ??<<!!                      <       .

import java.util.*

fun main(args : Array<String>) {
    val sc = Scanner(System.`in`)
    val k = sc.nextInt()
    val s = sc.nextInt()

    var result = 0
    for (x in 0..k) {
        for (y in 0..k) {
            if (0 <= s - (x + y) <= k){
                result += 1
            }
        }
    }
    print(result)
}


import math
def prime(x):
  p = {}
  cnt = 2
  Flag = True
  while Flag:
    last = math.ceil(x ** 0.5) 
    if cnt > last:
      break
    for i in range(cnt, last + 1):
      if x % i == 0:
        x //= i
        p[i] = 1
        cnt = i + 2
        while x % i == 0:
          x //= i
          p[i] += 1
        cnt = i + 1
        break
      if i == last:
        Flag = False
  if x != 1:
    p[x] = 1
  return p

N = int(input())
R = {}
MOD = 10 ** 9 + 7
for i in range(1, N + 1):
  t = prime(i)
  for i in t.keys():
    if i not in R:
      R[i] = t[i]
    else:
      R[i] += t[i]
      
ans = 1
for i in R.values():
  ans = ans * (i + 1) % MOD

print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
n=int(input())
mod=10**9+7
def searchPrimeNum(N):
    max = int(np.sqrt(N))
    searchList = [i for i in range(2,N+1)]
    primeNum = []
    while searchList[0] <= max:
        primeNum.append(searchList[0])
        tmp = searchList[0]
        searchList = [i for i in searchList if i % tmp != 0]
    primeNum.extend(searchList)
    return primeNum
l=len(searchPrimeNum(n))
plist=searchPrimeNum(n)
cnt=[0]*l
for i in range(l):
  k=1 
  while plist[i]**k<n:
    cnt[i]+=n//(plist[i]**k)
    k+=1
ans=1
for i in cnt:
  ans=(ans*(i+1))%mod
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
n=int(input())
mod=10**9+7
def searchPrimeNum(N):
    max = int(np.sqrt(N))
    searchList = [i for i in range(2,N+1)]
    primeNum = []
    while searchList[0] <= max:
        primeNum.append(searchList[0])
        tmp = searchList[0]
        searchList = [i for i in searchList if i % tmp != 0]
    primeNum.extend(searchList)
    return primeNum
l=len(searchPrimeNum(n))
plist=searchPrimeNum(n)
cnt=[0]*l
for i in range(l):
  k=1 
  while plist[i]**k<n:
    cnt[i]+=n//(plist[i]**k)
    k+=1
ans=1
for i in cnt:
  ans=(ans*i)%mod
print(ans)

Submission status: Runtime Error

Solution code:
def power(x,y):
    if x%y != 0:
        return 0
    else:
        return 1+power(x/y,y)


def main():
    n = int(input())
    prime=[]
    fact = {}
    num_list = [i for i in range(2,n+1)]
    i = 0
    ans = 1
    mod = 10**9+7
    while i <=n**0.5:
        i = num_list.pop(0)
        prime.append(i)
        for j in num_list:
            if j%i ==0:
                num_list.remove(j)
    prime = prime + num_list

    for i in range(1,n+1):
        for j in prime:
            if i <j:
                break
            elif j in fact.keys():
                fact[j] += power(i,j)
            else:
                fact[j] = power(i,j)
    for i in fact.values():
        ans *= (i+1)
        ans %= mod
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n = int(input())
#k(2~n)について、2~kの素数までで割り切れる回数をカウント

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

prime_list = primes(n)
prime_cnt = dict([(k,0) for k in prime_list])
from decimal import Decimal

for k in range(2,n+1):
    k = Decimal(k)
    for j in prime_list:
        j=Decimal(j)
        while k%j==0:
            prime_cnt[j]+=1
            k = k/j
        if k==1:
            break

import functools
import operator

print(functools.reduce(operator.mul, [v+1 for v in prime_cnt.values()])%(10**9+7))

Submission status: Runtime Error

Solution code:
N = int(input())
K = eval("*".join(map(str,[*range(1, N+1)])))
ans = 1
for i in range (2, N + 1):
    num = 0
    while K % i == 0:
        num += 1
        K //= i
    ans *= (num + 1)

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

Submission status: Runtime Error

Solution code:
N = int(input())
f = lambda n: n*f(n-1) if n > 1 else 1
K = f(N)
ans = 1
for i in range (2, N + 1):
    num = 0
    while K % i == 0:
        num += 1
        K //= i
    ans *= (num + 1)

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

Submission status: Runtime Error

Solution code:
import math

n = int(input())

lim = math.ceil(math.sqrt(n))

# 素数判定関数
def isPrime(num):
    # 2未満の数字は素数ではない
    if num < 2: return False
    # 2は素数
    elif num == 2: return True
    # 偶数は素数ではない
    elif num % 2 == 0: return False

    # 3 ~ numまでループし、途中で割り切れる数があるか検索
    # 途中で割り切れる場合は素数ではない
    for i in range(3, math.floor(math.sqrt(num))+1, 2):
        if num % i == 0:
            return False

    # 素数
    return True

# 素数判定
def callIsPrime(input_num):
    numbers = []
    # ループしながら素数を検索する
    for i in range(1, input_num):
        if isPrime(i):
            numbers.append(i)

    # 素数配列を返す
    return numbers

# 関数の呼び出し
prime = callIsPrime(n)

arr = [0] * lim

for i in range(len(prime)):
  j = 1
  while n > prime[i] ** j :
    arr[i] += int(n / prime[i] ** j)
    j += 1
  
ans = 1
for i in arr :
  if i != 0:
    ans *= i+1

print(ans)

Submission status: Runtime Error

Solution code:
import math
n = math.factorial(int(input()))
mod = 10**9+7
#print(n)
def div(n):
  di = []
  for i in range(1,int(n**0.5)+1):
    if n % i == 0:
      di.append(i)
      if i != n//i:
        di.append(n//i)
  return di
print(len(div(n))%mod)

Submission status: Runtime Error

Solution code:
import math
n = math.factorial(int(input()))
#print(n)
def div(n):
  di = []
  for i in range(1,int(n**0.5)+1):
    if n % i == 0:
      di.append(i)
      if i != n//i:
        di.append(n//i)
  return di
print(len(div(n)))

Submission status: Runtime Error

Solution code:
N = int(input())
prime_list = make_prime_list(N)
pcount={}
for p in prime_list:
    pcount[p]=0
for nn in range(2,num+1):
    for p in prime_list:
        n=nn
        if n<p:
            break
        while n%p==0:
            n//=p
            pcount[p]+=1
            
ans = 1
for i in pcount.values():
    ans *= (i + 1)
print(ans % (10 ** 9 + 7))