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:
from functools import reduce
import math

def main():
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    N = int(input().rstrip())
    factor = []
    f = math.factorial(N)
    dict = {}
    ans = 1
    for num in range(2,int(math.sqrt(f))+2):
        while f % num == 0:
            f //= num
            factor.append(num)
            if num in dict:
                dict[num] += 1
            else:
                dict[num] = 1
    for v in dict.values():
        ans *= v + 1

    print(ans)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n=int(input())
x=1
for i in range(1,n+1):
    x*=i

res=1

for i in range(2,n+1):
    cnt=1
    while x%i==0:
        x=x/i
        cnt+=1
    res*=cnt
    
print(res%(10**9+7))

Submission status: Runtime Error

Solution code:
n=int(input())
x=1
for i in range(1,n+1):
    x*=i

res=1

for i in range(2,n+1):
    cnt=1
    while x%i==0:
        x=x/i
        cnt+=1
    res*=cnt
    
print(res)

Submission status: Runtime Error

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

N = int(input())
pflist = getPrimeFactorsList(math.factorial(N))
pfset = set(pflist)
ans  = 1
for i in pfset:
  ans *= (pflist.count(i) + 1)
  #print(i)
  #print(pflist.count(i))
  
  
#print(pflist)
print(ans)

Submission status: Runtime Error

Solution code:
import sympy
 
N = int(input())
if N == 1:
    print(1)
    exit()
d = {}
for i in range(2,N+1):
    a = sympy.factorint(i)
    for k,v in a.items():
        if k not in d:
            d[k] = 2
        else:
            d[k] +=v
ans = 1
for v in d.values():
    ans = (ans * v)%(10**9+7)
print(ans)

Submission status: Runtime Error

Solution code:
import sympy

N = int(input())
if N == 1:
    print(1)
    exit()
d = {}
for i in range(2,N+1):
    a = sympy.factorint(i)
    for k,v in a.items():
        if k not in d:
            d[k] = 2
        else:
            d[k] +=v
ans = 1
for v in d.values():
    ans = (ans * v)%(10**9+7)
print(ans)

Submission status: Runtime Error

Solution code:
import itertools
import math
import sympy
from collections import deque
from collections import defaultdict
from itertools import permutations
import heapq
import bisect
from scipy.sparse.csgraph import floyd_warshall as wf
from collections import Counter
inf = 10**10

N = int(input())
if N == 1:
    print(1)
    exit()
d = {}
for i in range(2,N+1):
    a = sympy.factorint(i)
    for k,v in a.items():
        if k not in d:
            d[k] = 2
        else:
            d[k] +=v
ans = 1
for v in d.values():
    ans = (ans * v)%(10**9+7)
print(ans)

Submission status: Runtime Error

Solution code:
a = int(input())

import math
a = math.factorial(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)

    # divisors.sort()
    return divisors
  
x = make_divisors(a)
print(len(x))

Submission status: Runtime Error

Solution code:
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy

def j(q):
    if q==1: print("YES")
    else:print("NO")
    exit(0)


def ct(x,y):
    if (x>y):print("GREATER")
    elif (x<y): print("LESS")
    else: print("EQUAL")

def ip():
    return int(input())


def calculate(a):
    s = 0
    for i in range(len(a)):
        for k in range(i+1,len(a)):
            s+=(a[i]*a[k])
    return s

n = ip()                              #入力整数1つ
#n,m= (int(i) for i in input().split())      #入力整数横2つ
#n,a,b = (int(i) for i in input().split())    #入力整数横3つ
#n,a,b,c= (int(i) for i in input().split())  #入力整数横4つ
#s = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#a=[input() for i in range(h)]
#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
if n == 1:
    print(1)
elif n==2:
    print(2)
else:
    l = [0]* ( n + 1 )

    for i in range(n+1):
        s = []
        value = i
        search = 1
        while value != 1 and search <= math.sqrt(value):
            search+=1
            if value%search == 0:
                s.append(search)
                value = value//search
                search = 1
        if search > math.sqrt(value) and value > 1:
            s.append(value)

        for p in range(len(s)):
            l[s[p]]+=1
ans = 1
for i in range(2,n+1):
    if l[i]:ans*=(l[i]+1)

print(ans%(pow(10,9)+7))

Submission status: Runtime Error

Solution code:
def prime_factors(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors

if __name__ == "__main__":
    N = int(input())
    num = math.factorial(N)
    pf = prime_factors(num)
    c = Counter(pf)
    
    res = 1

    for i in c.values():
        res *= i + 1
    
    print(res % (10**9+7))

Submission status: Runtime Error

Solution code:
n = int(input())

def nprf(n):
    pf = {}
    for i in range(2, n + 1):
        for j in range(2, i + 1):
            while i % j == 0:
                if not j in pf:
                    pf[j] = 0
                pf[j] += 1
                i //= j
    return pf
    
cnt = 1
for v in nprf(n).values():
    cnt *= (v + 1)
    
print(cnt % mod)

Submission status: Runtime Error

Solution code:
import math


def get_prime_factorized(N):
    R = []
    b, e = 2, 0
    while b ** 2 <= N:
        while N % b == 0:
            N  = N // b
            e += 1
        if e > 0:
            R.append([b, e])
        b, e = b + 1, 0
    if N > 1:
        R.append([N, 1])
    return R


N = int(input())

L = [l[1]+1 for l in get_prime_factorized(math.factorial(N))]

for i, l in enumerate(L):
    if i  == 0:
        R  = l
    else:
        R *= l

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

Submission status: Runtime Error

Solution code:
const = 10 ** 9 + 7
N = int(input())
TABLE = [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]T = []
ans = 1
for x in TABLE:
    L = []
    for i in range(1,N + 1):
        count = 0
        while i % x == 0:
            i /= x
            count += 1
        L.append(count)
    T.append(sum(L)+1)
#print(T)
for x in T:
    ans *= x
print(ans % const)

Submission status: Runtime Error

Solution code:
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;


public class Main {
    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in);
        Task task = new Task();
        task.solve(sc, out);
        out.flush();
        sc.close();
    }

    static class Task {
        public void solve(Scanner sc, PrintWriter out) {
            int n = nint(sc);
            long D = (long) 10E8 + 7;
            long count = 1 ;
            Map<Integer, Integer> r = new HashMap<>();
            for (int i = 2; i <= n ; i++) {
                Map<Integer, Integer> m = primeFactorize(i);
                for (Map.Entry<Integer, Integer> e : m.entrySet()){
                    if (r.containsKey(e.getKey())){
                        int tmp = r.get(e.getKey());
                        tmp+=e.getValue();
                        r.put(e.getKey(), tmp);
                    }else{
                        r.put(e.getKey(), 1);
                    }
                }
            }
            for(Map.Entry<Integer, Integer> e : r.entrySet()){
                count *= (e.getValue()+1);
                count %= D;
            }
            out.println(count);
        }
    }


    static int nint(Scanner sc) {


        return Integer.parseInt(sc.next());
    }

    static long nlong(Scanner sc) {
        return Long.parseLong(sc.next());
    }

    static double ndouble(Scanner sc) {
        return Double.parseDouble(sc.next());
    }

    static float nfloat(Scanner sc) {
        return Float.parseFloat(sc.next());
    }

    static String nstr(Scanner sc) {
        return sc.next();
    }

    static long[] longLine(Scanner sc, int size) {
        long[] lLine = new long[size];
        for (int i = 0; i < size; i++) {
            lLine[i] = nlong(sc);
        }
        return lLine;
    }

    static int[] intLine(Scanner sc, int size) {
        int[] iLine = new int[size];
        for (int i = 0; i < size; i++) {
            iLine[i] = nint(sc);
        }
        return iLine;
    }

    static String[] strLine(Scanner sc, int size) {
        String[] strLine = new String[size];
        for (int i = 0; i < size; i++) {
            strLine[i] = nstr(sc);
        }
        return strLine;
    }

    static long maxFromList(List<Long> longList) {
        return longList.stream().max(Comparator.naturalOrder()).get();
    }

    static long minFromList(List<Long> longList) {
        return longList.stream().min(Comparator.naturalOrder()).get();
    }

    public static int sumDigits(int n) {
        int sum = 0;
        while (n != 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }

    public static long sumDigits(long n) {
        long sum = 0;
        while (n != 0) {
            sum += n % 10;
            n /= 10;
        }
        return sum;
    }

    static List<Integer> getIntegerList(Scanner sc, int size) {
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < size; i++) {
            list.add(nint(sc));
        }
        return list;
    }

    static List<Long> getLongList(Scanner sc, int size) {
        List<Long> list = new ArrayList<>();
        for (int i = 0; i < size; i++) {
            list.add(nlong(sc));
        }
        return list;
    }

    static List<String> getStringList(Scanner sc, int size) {
        List<String> stringList = new ArrayList<>();
        for (int i = 0; i < size; i++) {
            stringList.add(nstr(sc));
        }
        return stringList;
    }

    private static long lcm(long a, long b) {
        return a * b / gcd(b, a % b);
    }

    private static long gcd(long a, long b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    private static Map<Integer, Integer> primeFactorize(long num) {
        Map<Integer, Integer> map = new HashMap<>();
        int i = 2;
        while (i * i <= num) {
            while (num % i == 0) {
                num /= i;
                if (map.containsKey(i)) {
                    int tmp = map.get(i);
                    tmp++;
                    map.put(i, tmp);
                } else {
                    map.put(i, 1);
                }
            }
            i ++;
        }
        if (num > 1)
            map.put((int) num, 1);
     return map;
    }
}

Submission status: Runtime Error

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


def prime(t):
    i=2
    while i**2<=t:
        if t%i==0: return 0
        i+=1
    return 1

mod=10**9+7

p=[]
for i in range(2,1008):
    if prime(i):
        p.append(i)

d={i:0 for i in p}
n=int(input())

tmp=1
for i in range(1,n+1):
    tmp*=i
    for j in p:
        while tmp%j==0:
            d[j]+=1
            tmp//=j
        if tmp<j: break
 
for i in d:
    ans*=d[i]+1
    ans%=mod
print(ans)

Submission status: Runtime Error

Solution code:
def 解():
    iN = int(input())
    iD = 10**9 + 7


    if iN < 3:
        print(iN)
        exit()

    d素={2:1}
    for i in range(2,iN + 1):
        b素 = 1
        for j in range(2,int(i**0.5)+2):
            if i % j == 0:
                b素 = 0
                break
        if b素 :
            d素[i]=1
    for i in range(2,iN+1):
        for i素 in d素:
            while i % i素 == 0:
                d素[i素]+=1
                i //= i素
           if i == 0:
                break
    iAns = 1
    for i素,num in d素.items():
        iAns *= num
        iAns %= iD
    print(iAns)
解()

Submission status: Runtime Error

Solution code:
#! /usr/bin/python3
# Factors of Factorial

"""
1≦N≦103
"""

import math
import sympy

test = False

N = int(input())


def yakusu_no_kosu(n):
    """
    n! の約数の個数
    """
    d = sympy.factorint(math.factorial(n))
    # n!を素因数分解 {素因数1: 個数, 素因数2: 個数, …}
    l_d = list(d.values())
    # 各素因数(key)の個数(value)のみリストにする

    if test:
        print('l_d =', l_d)

    kosu = 1
    # 約数の数

    for v in l_d:
        kosu *= v + 1
    # 各素因数(key)の個数v(value)から約数の個数を算出

    return kosu


def main():
    """
    N! の約数の個数を 10^9+7 で割った余りを出力
    """
    print(yakusu_no_kosu(N) % (10**9 + 7))


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
MOD = 10**9 + 7

def factorial(num):
    if num == 1:
        return 1
    else:
        return num * factorial(num-1)

def factoring(n):
    i = 2
    prime_factors = []
    while i*i <= n:
        while n%i == 0:
            n /= i
            prime_factors.append(i)
        i += 1
    if n > 1:
        prime_factors.append(n)
    return prime_factors

def total_combination(num_list):
    non_duplicates = list(set(num_list))
    total = 1

    for i in non_duplicates:
        total *= num_list.count(i)+1

    return total 

n = int(input())

f = factorial(n)
primes = factoring(f)
ans = total_combination(primes) % MOD

print(ans)

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())
d = []
for _ in range(n):
    d.append(list(map(int,input().split())))
d.sort(key=lambda x: x[0])
count = 0
for x,y in d:
    count += y
    if count >= k:
        break
print(x)

Submission status: Runtime Error

Solution code:
N=int(input())
t=[0]*N
for i in range(2,N+1):
    s=1
    while i>1:
        s+=1
        while i%s==0:
            i=i//s
            t[s-2]+=1
for j in range(N):
    q=q*(t[j]+1)%(10**9+7)
print(q)

Submission status: Runtime Error

Solution code:
N=int(input());t=[0]*N
for i in range(2,N+1):
    s=1
    while i>1:
        s+=1
        while i%s==0:
            i=i//s
            t[s-2]+=1
for j in range(N):
    q=q*(t[j]+1)%(10**9+7)
print(q)

Submission status: Runtime Error

Solution code:
import math

# input
N = int(input())

N_f = math.factorial(N)

ans = 0

for i in range(1, math.ceil(math.sqrt(N_f))):
    if N_f % i == 0:
        ans += 1
        if N_f != i ** 2:
            ans += 1

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

print(ans)

Submission status: Runtime Error

Solution code:
from collections import Counter
from functools import reduce
n=int(input())
l=[]

for j in range(2,n+1):
  n=j
  for i in range(2,j+1):
    while not n%i:
      l.extend([i])
      n//=i
o=Counter(l)
p=int(1e9+7)
v=reduce(lambda x,y:x*y,map(lambda x:x+1,o.values()))%p
print(v)

Submission status: Runtime Error

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

# 階乗しないで求める版

x = int(input())

# 素数判定用関数
def is_prime_2(num):
    if num < 2:
        return False
    if num == 2 or num == 3 or num == 5:
        return True
    if num % 2 == 0 or num % 3 == 0 or num % 5 == 0:
        return False
    # 疑似素数(2でも3でも5でも割り切れない数字)で次々に割っていく
    prime = 7
    step = 4
    num_sqrt = math.sqrt(num)
    while prime <= num_sqrt:
        if num % prime == 0:
            return False
        prime += step
        step = 6 - step
    return True

# xまでの間にある素数を列挙
sosu_list = []
for i in range(x+1):
    if is_prime_2(i):
        sosu_list.append(i)

# 素数のカウントは階乗前の値から個別に取って合算でも問題ない
sosu_cnt = {}
for i in range(1, x+1):
    for sosu in sosu_list:
        while i % sosu == 0:
            if sosu in sosu_cnt:
                sosu_cnt[sosu] += 1
            else:
                sosu_cnt[sosu] = 1
            i //= sosu

# 素数カウントを使って、約数の個数を求める
ans = 1
for key, value in sosu_cnt.items():
    sosu_cnt[key] += 1
    ans = (ans * sosu_cnt[key]) % (10 ** 9 + 7)
print(ans)

Submission status: Runtime Error

Solution code:
mod=1000000007

k=int(input())

counter = 0
primes = [2, 3]

for n in range(5, k+1, 2):
    isprime = True
    for i in range(0, len(primes)):
        counter+=1
        if primes[i]**2 > n:
            break
        counter += 1
        if n % primes[i] == 0:
            isprime = False
            break
    if isprime:
        primes.append(n)    

#print(primes)
num=[0]*(k+1)

for i in range(1,k+1):
    for a in primes:
        b=i
        while b>1:
            if b%a==0:
                num[a]+=1
                b=b//a
            else:
                break

ans=1
        
for a in primes:
    if num[a]>0:
        ans=ans*(num[a]+1)%mod
        
#print(num)
print(ans)

Submission status: Runtime Error

Solution code:
import math

prime = {}

N = int(input())

isPrime = [True]*(N+1)
isPrime[0] = False
isPrime[1] = False
for i in range(2,int(math.sqrt(N))+2):
    if isPrime[i]:
        n = 2*i
        while n<=N:
            isPrime[n] = False
            n += i

for i in range(N+1):
    if isPrime[i]:
        prime[i] = 0

key_list = list(prime.keys())

for num in range(2,N+1):
    res = num
    idx = 0
    while res>1:
        k = key_list[idx]
        if res%k == 0:
            prime[k] += 1
            res = res//k
        else:
            idx += 1
    
ans = 1
for v in prime.values():
    ans *= (v+1) 
    ans = ans % (10**9+7)
    if ans==0:
        ans = 1
    
print(ans)

Submission status: Runtime Error

Solution code:
import math

prime = {}

N = int(input())

isPrime = [True]*(N+1)
isPrime[0] = False
isPrime[1] = False
for i in range(2,int(math.sqrt(N))+2):
    if isPrime[i]:
        n = 2*i
        while n<=N:
            isPrime[n] = False
            n += i

for i in range(N+1):
    if isPrime[i]:
        prime[i] = 0

key_list = list(prime.keys())

for num in range(2,N+1):
    res = num
    idx = 0
    while res>1:
        k = key_list[idx]
        if res%k == 0:
            prime[k] += 1
            res = res//k
        else:
            idx += 1
    
ans = 1
for v in prime.values():
    ans *= (v+1) 
    ans = ans % (10**9+7)
    
print(ans)

Submission status: Runtime Error

Solution code:
from functools import reduce
from copy import deepcopy

n = int(input())

def dadd(t, s): 
    for k,v in s.items():
        t[k] = t.get(k, 0) + v 
    return t

def pfd(c, i): 
    for j in range(2, i // 2 + 1): 
        if i % j == 0:
            d = i // j
            return dadd(deepcopy(c[j]), c.get(d, dict()))
    return { i: 1 } 

p,c = {},{}
for i in range(2, n + 1): 
    q = pfd(c, i)
    c[i] = q 
    dadd(p, q)

tot = reduce(lambda a,(k,v): a * (v + 1), p.items(), 1)
print(tot % (10 ** 9 + 7))

Submission status: Runtime Error

Solution code:
import sys

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

    k = 1
    s = []
    #lst = list(range(1,N+1))
    primes = prime(N)
    num = len(primes)

    # N=1
    lst = [0] * N
    if N ==1:
        print(1)
        exit()

    # N>=2
    for i in range(2,N+1):
        b =[]
        b = bunkai(i)
        for i in b:
            lst[primes.index(i)] += 1

    ans = 1
    for i in lst:
        if i is not 0:
            ans = ans * (i+1)
    print(ans%1000000007)


def prime(n):
    primes = []
    for i in range(2,n):
        flag = True
        for j in range(2,i):
            if i%j == 0:
                flag = False
        if flag:
            primes.append(i)
    return primes

def bunkai(i):
    bunkai =[]
    s =0
    while s ==0:
        for j in range(2,i+1):
            if i % j ==0:
                bunkai.append(j)
                i = int(i/j)
                if i ==1:
                   s=1
                break
    return bunkai

if __name__ == "__main__":
        main()
shunki@ ~/scripts/python/atcoder/abc/abc_000 $ vim c.py
shunki@ ~/scripts/python/atcoder/abc/abc_000 $ python c.py
2
2
shunki@ ~/scripts/python/atcoder/abc/abc_000 $ python c.py
3
4
shunki@ ~/scripts/python/atcoder/abc/abc_000 $ cat c.py
import sys

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

    k = 1
    s = []
    #lst = list(range(1,N+1))
    primes = prime(N+1)
    num = len(primes)

    # N=1
    lst = [0] * N
    if N ==1:
        print(1)
        exit()

    # N>=2
    for i in range(2,N+1):
        b =[]
        b = bunkai(i)
        for i in b:
            lst[primes.index(i)] += 1

    ans = 1
    for i in lst:
        if i is not 0:
            ans = ans * (i+1)
    print(ans%1000000007)


def prime(n):
    primes = []
    for i in range(2,n):
        flag = True
        for j in range(2,i):
            if i%j == 0:
                flag = False
        if flag:
            primes.append(i)
    return primes

def bunkai(i):
    bunkai =[]
    s =0
    while s ==0:
        for j in range(2,i+1):
            if i % j ==0:
                bunkai.append(j)
                i = int(i/j)
                if i ==1:
                   s=1
                break
    return bunkai

if __name__ == "__main__":
        main()

Submission status: Runtime Error

Solution code:

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

    k = 1
    s = []
    #lst = list(range(1,N+1))
    primes = prime(N)
    num = len(primes)

    # N=1
    lst = [0] * N
    if N ==1:
        print(1)
        exit()

    # N>=2
    for i in range(2,N+1):
        b =[]
        b = bunkai(i)
        for i in b:
            lst[primes.index(i)] += 1

    ans = 1
    for i in lst:
        if i is not 0:
            ans = ans * (i+1)
    print(ans%1000000007)


def prime(n):
    primes = []
    for i in range(2,n):
        flag = True
        for j in range(2,i):
            if i%j == 0:
                flag = False
        if flag:
            primes.append(i)
    return primes

def bunkai(i):
    bunkai =[]
    s =0
    while s ==0:
        for j in range(2,i+1):
            if i % j ==0:
                bunkai.append(j)
                i = int(i/j)
                if i ==1:
                   s=1
                break
    return bunkai

if __name__ == "__main__":
        main()

Submission status: Runtime Error

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

    k = 1
    s = []
    #lst = list(range(1,N+1))
    primes = prime(N)
    num = len(primes)

    # N=1
    lst = [0] * N
    if N ==1:
        print(1)

    # N>=2
    for i in range(2,N+1):
        b =[]
        b = bunkai(i)
        for i in b:
            lst[primes.index(i)] += 1

    ans = 1
    for i in lst:
        if i is not 0:
            ans = ans * (i+1)
    print(ans/1000000007)


def prime(n):
    primes = []
    for i in range(2,n):
        flag = True
        for j in range(2,i):
            if i%j == 0:
                flag = False
        if flag:
            primes.append(i)
    return primes

def bunkai(i):
    bunkai =[]
    s =0
    while s ==0:
        for j in range(2,i+1):
            if i % j ==0:
                bunkai.append(j)
                i = int(i/j)
                if i ==1:
                   s=1
                break
    return bunkai

if __name__ == "__main__":
        main()

Submission status: Runtime Error

Solution code:

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

    k = 1
    s = []
    #lst = list(range(1,N+1))
    primes = prime(N)
    num = len(primes)

    # N=1
    lst = [0] * N

    # N>=2

    for i in range(2,N+1):
        b =[]
        b = bunkai(i)
        for i in b:
            lst[primes.index(i)] += 1

    ans = 1
    for i in lst:
        if i is not 0:
            ans = ans * (i+1)
    print(ans)



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


def prime(n):
    primes = []
    for i in range(2,n):
        flag = True
        for j in range(2,i):
            if i%j == 0:
                flag = False
        if flag:
            primes.append(i)
    return primes

def bunkai(i):
    bunkai =[]
    s =0
    while s ==0:
        for j in range(2,i+1):
            if i % j ==0:
                bunkai.append(j)
                i = int(i/j)
                if i ==1:
                   s=1
                break
    return bunkai




if __name__ == "__main__":
        main()

Submission status: Runtime Error

Solution code:
i = int(input())
s = input()

s_c = s.count("D")

print(i - s_c)

Submission status: Runtime Error

Solution code:
i = int(input())
s = input()

s_c = s.count("I")

print(i - s_c)

Submission status: Runtime Error

Solution code:
import math
N = float(raw_input())
F = int(math.factorial(N))
ans = 0
for i in range(F):
    if F % (i + 1) == 0:
        ans += 1
print ans

Submission status: Runtime Error

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

def factorial(n):
    if n == 1:
        return 1
    return n * factorial(n-1)

num = factorial(n)

ans = 1
for i in range(2, n+1):
    count = 0
    while num % i == 0:
        count += 1
        num = num // i
    ans *= (count + 1)

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

Submission status: Runtime Error

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

    lst = erastosthenes(N)
    plist = [i for i in range(3, N + 1, 2) if lst[i]]
    plist = [2] + plist

    mod = 1000000007
    ans = 1
    for p in plist:
        cnt = 0
        i = 1
        while 1:
            x = p ** i
            if x > N:
                break
            cnt += N // x
            i += 1
        ans = (ans % mod * (cnt + 1) % mod) % mod
    print(ans)

def erastosthenes(n):
    prime = [0, 1] * ((n + 1) // 2)
    if not n % 2:
        prime += [0]
    prime[1], prime[2] = 0, 1

    sqrt = n ** 0.5
    i = 3
    while i <= sqrt:
        for j in range(i ** 2, n, i):
            prime[j] = 0
        i += 2
    return prime

main()

Submission status: Runtime Error

Solution code:
import sympy

Submission status: Runtime Error

Solution code:
n,a,b = (int(i) for i in input().split())
x = [int(i) for i in input().split()]
answer = 0
for i in range(n-1):
	if (x[i+1]-x[i])*a < b: answer += (x[i+1]-x[i])*a
	else: answer += b
print(answer)

Submission status: Runtime Error

Solution code:
import sympy
N = int(input())
p = 1
for i in range(1, N+1):
    p *= i
ans = sympy.divisor_count(p)
print(ans % (10**9+7))

Submission status: Runtime Error

Solution code:
n=int(input())
i=1
lis=[]
while(i*i<=n):
  count=0
  while(n%i==0):
    count+=1
    n=n//i
  if(count！=0):lis.append(count)
x=1
for i in lis:
  x*=(i+1)
print(x)

Submission status: Runtime Error

Solution code:
n=int(input())
mod=10**9+7
import math
import sympy
v=math.factorial(n)
print(sympy.divisor_count(v)%mod)

Submission status: Runtime Error

Solution code:
import sympy
n=int(input())
factorial=int(1)
for i in range(1,n+1):
    factorial*=i
print(sympy.divisor_count(factorial)%(10**9+7))

Submission status: Runtime Error

Solution code:
import sys
sys.getrecursionlimit()
sys.setrecursionlimit(1000)

l = int(raw_input())

def factorial(l):
    if l == 0:
        return 1
    else:
        return l * factorial(l-1)
integ = factorial(l)
integ = integ
factors = []
i = 1

while(integ >= i):
    if (integ % i) == 0:
        factors.append(i)
    i+=1
print len(factors)
divisor = long(len(factors))
origin =long((10 ** 9) + 7)

Submission status: Runtime Error

Solution code:
import sys
sys.getrecursionlimit()
sys.setrecursionlimit(1000)

l = int(raw_input())

def factorial(l):
    if l == 0:
        return 1
    else:
        return l * factorial(l-1)
integ = factorial(l)
integ = integ
factors = []
i = 1

while(integ > i):
    if (integ % i) == 0:
        factors.append(i)
    i+=1
divisor = long(len(factors))
origin =long((10 ** 9) + 7)
print origin % divisor

Submission status: Runtime Error

Solution code:
a = int(input())
c = list(map(int,input().split()))
su = sum(c)
diff = 1e9
cc = 0
for x in range(a-1):
    cc += c[x]
    diff = min(diff,abs(su-2*cc))
print(diff)

Submission status: Runtime Error

Solution code:
import math
N=int(input())
M=math.factorial(N)
R=[]
for r in range (2,N+1):
  count=0
  while M%r==0:
    M=M/r
    count+=1
  R+=[count]

count=1
for r in range(N-1):
  count=count*(R[r]+1)
print(count)

Submission status: Runtime Error

Solution code:
import math
N=int(input())
N=math.factorial(N)
r=math.sqrt(N)
count=0
if r%1==0:
  count-=1
for i in range(int(r)):
  if N%(1+i)==0:
    count+=2
print(count%(10**9+7))

Submission status: Runtime Error

Solution code:
import math
N=int(input())
N=math.factorial(N)
r=math.sqrt(N)
count=0
if r%1==0:
  count-=1
for i in range(int(r)):
  if N%(1+i)==0:
    count+=2
print(count)

Submission status: Runtime Error

Solution code:
from sympy import divisor_count
from math import factorial

div = 10**9 + 7

n = int(input())

print(divisor_count(factorial(n)))

Submission status: Runtime Error

Solution code:
import sympy as sp
import math as ma
N = int(input())
dic = sp.factorint(ma.factorial(N))
key = list(dic.keys())
ans = 1
for i in range(len(dic)):
    ans *= (1 + dic[key[i]])
print(ans % 1000000007)

Submission status: Runtime Error

Solution code:
import math
from sympy import divisor_count
N = int(input())
N = math.factorial(N)

print(divisor_count(N) % (10**9 + 7))

Submission status: Runtime Error

Solution code:
def prime_factorization(N):
    ps = primes(N)
    factors = {}
    n = N
    for p in ps:
        index = 0
        while True:
            p_m = n % p
            if p_m == 0:
                n = n // p
                index += 1
            else:
                if index:
                    factors[p] = index
                break
    return factors

from collections import defaultdict
from functools import reduce
import operator

total_fact = {}
for i in range(2, N+1):
    fact = prime_factorization(i)

    for x, n in fact.items():
        if x in total_fact:
            total_fact[x] += n
        else:
            total_fact[x] = n
    #print(fact)
divs = reduce(operator.mul, [n+1 for x, n in total_fact.items()], 1)
#print('{}!'.format(N), total_fact, divs)
print(divs % 1000000007)

Submission status: Runtime Error

Solution code:
import sympy
import math

n=int(raw_input())
m=sympy.factorint(math.factorial(n))
res=1
v=m.values()
for i in xrange(len(v)):
 res*=v[i]+1
print res%(10**9+7)

Submission status: Runtime Error

Solution code:
import sympy
import math

n=int(raw_input())
m=sympy.factorint(math.factorial(n))
print m
res=1
v=m.values()
for i in xrange(len(v)):
 res*=v[i]+1
print res%(10**9+7)