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:
from math import factorial
from collections import Counter

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

def prime_factoring(n):
    from collections import Counter
    a = prime_factorize(n)
    return Counter(a)

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

n = int(input())
mod = 10**9+7
N =factorial(n)
import numpy as np
List = np.array(list(prime_factoring(N).values()))+1
List = List%mod
print(np.prod(List)%mod)

Submission status: Wrong Answer

Solution code:
from math import factorial
from collections import Counter

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

def prime_factoring(n):
    from collections import Counter
    a = prime_factorize(n)
    return Counter(a)

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

n = int(input())
mod = 10**9+7
N =factorial(n)
import numpy as np
List = np.array(list(prime_factoring(N).values()))+1
List = List%mod
print(List)
print(np.prod(List)%mod)

Submission status: Wrong Answer

Solution code:
n = int(input())
# https://note.nkmk.me/python-prime-factorization/
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

table = [0] * (n+1)
for i in range(2, n+1):
  p = prime_factorize(i)
  for pi in p:
    table[pi] += 1
ans = 1
for t in table:
  ans *= t+1
print(ans)

Submission status: Wrong Answer

Solution code:
def solve():
    n = int(input())
    d = {}
    for i in range(1, n+1):
        d[i] = 0
    
    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
    
    for i in range(1, n+1):
        ps = prime_factorize(i)
        for p in ps:
            d[p] += 1
    
    ans = 1
    for i in range(1, n+1):
        if d[i] >= 1:
            ans *= (d[i]+1)
    
    print(ans)
        
        
if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
n = int(input())
mod = int(1e9+7)
ans = 1
for i in range(n):
  ans *= (i+1)
  ans%=mod

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
mod = 1e9+7
ans = 1
for i in range(n):
  ans *= (i+1)
  ans%=mod

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import math
import copy
import heapq
from functools import cmp_to_key
from bisect import bisect_left, bisect_right
from collections import defaultdict, deque, Counter
sys.setrecursionlimit(1000000)

# input aliases
input = sys.stdin.readline
getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = float("inf")
MOD = 10**9 + 7
divide = lambda x: pow(x, MOD-2, MOD)

def nck(n, k, kaijyo):
    return (npk(n, k, kaijyo) * divide(kaijyo[k])) % MOD

def npk(n, k, kaijyo):
    if k == 0 or k == n:
        return n % MOD
    return (kaijyo[n] * divide(kaijyo[n-k])) % MOD

def fact_and_inv(SIZE):
    inv = [0] * SIZE  # inv[j] = j^{-1} mod MOD
    fac = [0] * SIZE  # fac[j] = j! mod MOD
    finv = [0] * SIZE  # finv[j] = (j!)^{-1} mod MOD
    inv[1] = 1
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    for i in range(2, SIZE):
        inv[i] = MOD - (MOD // i) * inv[MOD % i] % MOD
        fac[i] = fac[i - 1] * i % MOD
        finv[i] = finv[i - 1] * inv[i] % MOD

    return fac, finv

def renritsu(A, Y):
    # example 2x + y = 3, x + 3y = 4
    # A = [[2,1], [1,3]])
    # Y = [[3],[4]] または [3,4]
    A = np.matrix(A)
    Y = np.matrix(Y)
    Y = np.reshape(Y, (-1, 1))
    X = np.linalg.solve(A, Y)

    # [1.0, 1.0]
    return X.flatten().tolist()[0]

class TwoDimGrid:
    # 2次元座標 -> 1次元
    def __init__(self, h, w, wall="#"):
        self.h = h
        self.w = w
        self.size = (h+2) * (w+2)
        self.wall = wall
        self.get_grid()
        # self.init_cost()

    def get_grid(self):
        grid = [self.wall * (self.w + 2)]
        for i in range(self.h):
            grid.append(self.wall + getS() + self.wall)

        grid.append(self.wall * (self.w + 2))
        self.grid = grid
    def init_cost(self):
        self.cost = [INF] * self.size

    def pos(self, x, y):
        # 壁も含めて0-indexed 元々の座標だけ考えると1-indexed
        return y * (self.w + 2) + x
    def getgrid(self, x, y):
        return self.grid[y][x]
    def get(self, x, y):
        return self.cost[self.pos(x, y)]
    def set(self, x, y, v):
        self.cost[self.pos(x, y)] = v
        return
    def show(self):
        for i in range(self.h+2):
            print(self.cost[(self.w + 2) * i:(self.w + 2) * (i+1)])
    def showsome(self, tgt):
        for t in tgt:
            print(t)
        return
    def showsomejoin(self, tgt):
        for t in tgt:
            print("".join(t))
        return

    def search(self):
        grid = self.grid
        move = [(0, 1), (0, -1), (1, 0), (-1, 0)]
        move_eight = [(0, 1), (0, -1), (1, 0), (-1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
        # for i in range(1, self.h+1):
        #     for j in range(1, self.w+1):
        #         cx, cy = j, i
        #         for dx, dy in move_eight:
        #             nx, ny = dx + cx, dy + cy


def soinsu(n):
    ret = defaultdict(int)
    for i in range(2, int(math.sqrt(n) + 2)):
        if n % i == 0:
            while True:
                if n % i == 0:
                    ret[i] += 1
                    n //= i
                else:
                    break

    if not ret:
        return {n: 1}
    return ret


def solve():
    n = getN()
    p =defaultdict(int)
    for i in range(2, n+1):
        so = soinsu(i)
        for k, v in so.items():
            p[k] += v

    ans = 1
    # print(p)
    for v in p.values():
        ans *= v + 1
        ans %= MOD
    print(ans)
    return

def main():
    n = getN()
    for _ in range(n):
        solve()

    return
if __name__ == "__main__":
    # main()
    solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n = int(input())


def prime_factorization(k):
    if k < 2:
        return []
    r = math.ceil(math.sqrt(k))
    ans = []
    i = 2
    while i <= r:
        if k % i == 0:
            ans.append(i)
            k //= i
        else:
            i += 1
    if k > 1:
        ans.append(k)
    return ans


prime_cnt = [0] * (n + 1)  # 1,2,..N まで個数を数える。Nが合成数なら０にする
for i in range(n):
    for j in prime_factorization(i):
        prime_cnt[j] += 1
ans = 1
for i in prime_cnt:
    if i != 0:
        ans *= i
print(ans)

Submission status: Wrong Answer

Solution code:
from math import factorial as f

n = int(input())
fn = f(n)

q = 2
ans = 1
while q ** 2 <= fn:
    c = 1
    while not fn % q:
        c += 1
        fn //= q
    ans *= c
    q += 1

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

Submission status: Wrong Answer

Solution code:
import math
N=math.factorial(int(input()))
i=2
ans=1
M=10**9+7
while i*i<=N:
    cnt=1
    while N%i==0:
        cnt+=1
        N//=i
    ans*=cnt
    i+=1

print(int(ans%M))

Submission status: Wrong Answer

Solution code:
import math
def factorization(n):
    i = 2
    factors = []
    while i <= math.floor(n**0.5):
        if n%i == 0:
            factors.append(i)
            n //= i
        else:
            i += 1
    if n>1:
        factors.append(n)
    return factors
#約数列挙
N = int(input())
ls = []
for i in range(1,N+1):
    ls.extend(factorization(i))
ls.sort()
ans = 1
now = 1
now_2 = 0
for i in range(len(ls)):
    if i == 0:
        now_2 = ls[i]
    else:
        if ls[i] == now_2:
            now += 1
        else:
            ans *= (now+1)
            now = 1
            now_2 = ls[i]
ans *= (now+1)
print(ans%(10**9+7))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)
MOD = 10 ** 9 + 7
import math

dic = dict()


def factoring(k): #kを因数分解し、素因数とその個数を辞書に入れて返す。
    n = int(math.sqrt(k))+2
    for i in range(2, n):
        count = 0
        while k%i == 0:
            count += 1
            k = k//i
        if count != 0:
            dic[i] = count
    if k != 1: #sqrt(k)までチェックしてもkが1になっていない --> kが素因数
        dic[k] = 1

N = int(input())

for i in range(1, N + 1):
    factoring(i)

ans = 1
for i in dic:
    ans *= (dic[i] + 1)
    ans %= MOD

print (ans)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
MOD = 10**3
n = int(input())


def sieve(n):
    n += 1
    res = [i for i in range(n)]
    for p in range(2, int(n**.5)+1):
        if res[p] < p:
            continue
        for q in range(p**2, n, p):
            if res[q] == q:
                res[q] = p
    return res


U = 10**3
min_factor = sieve(U)
pf = defaultdict(lambda: 0)


def prime_factor(n):
    while 1 < n:
        pf[min_factor[n]] += 1
        n //= min_factor[n]


for i in range(1, n+1):
    prime_factor(i)

ans = 1
for v in pf.values():
    ans *= v+1
    ans %= MOD
print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

    for i in range(3, math.floor(math.sqrt(num))+1, 2):
        if num % i == 0:
            return False
    return True

    
N = int(input())
total = 1
mod = 10**9+7
kaijo_ = math.factorial(N)
print(kaijo_)
for i in range(1,N+1):
    cnt = 0
    n = kaijo_
    if isPrime(i):
        while n % i == 0:
            n = n // i
            cnt += 1
        print(i,cnt)
        total = (total*(cnt+1))%mod
print(total)

Submission status: Wrong Answer

Solution code:
import math

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

    for i in range(3, math.floor(math.sqrt(num))+1, 2):
        if num % i == 0:
            return False
    return True

def kaijo(n, mod):
    total = 1
    for i in range(1,n+1):
        total = (total*i)%mod
    return total
    
N = int(input())
total = 1
mod = 10**9+7
kaijo_ = kaijo(N, mod)

for i in range(1,N+1):
    cnt = 0
    n = kaijo_
    if isPrime(i):
        while n % i == 0:
            n = n / i
            cnt += 1
    total *= cnt+1
print(total)

Submission status: Wrong Answer

Solution code:
N = int(input())
print(2**(N-1))

Submission status: Wrong Answer

Solution code:
import sys
import os
import math
import bisect
import collections
import itertools
import heapq

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()

    ret = [0]*N
    for i in range(2,N+1):
        x = i
        for j in range(2,i+1):
            while x%j == 0:
                # print(x)
                x //= j
                ret[j-1] += 1
            # print('---')

    # print(ret)
    ans = 1
    for r in ret:
        ans *= r+1
    print(ans)



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
pri=[2]
for i in range(3,n+1):
    flag=1
    for j in range(2,int(i**(1/2))+1):
        if i%j==0:
            flag=0
            break
    if flag==1:
        pri.append(i)
l=len(pri)
cnt=[0]*l
for i in range(2,n+1):
    x=i
    for j in range(l):
        while x%pri[j]==0:
            cnt[j]+=1
            x=x//pri[j]
s=1
for j in range(l):
    s*=(cnt[j]+1)
print(s)

Submission status: Wrong Answer

Solution code:
n = int(input())
mod = 10 ** 9 + 7
def factorization(n):
    ans = {}
    for j in range(2, n + 1):
        temp = j
        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
                if i not in ans:
                    ans[i] = cnt % mod
                else:
                    ans[i] += cnt % mod

        if temp!=1:
            ans[temp] = 1

        if len(ans) == 0 and temp != 1:
            ans[n] = 1
        #print(ans)
    return ans
#for i in range(2, n + 1):
mod = 10 ** 9 + 7
fact = factorization(n)
ans = 1
for i in fact.values():
    ans *= (i + 1)
    ans %= mod
print(ans)

Submission status: Wrong Answer

Solution code:
def factorization(n):
    res = []
    tmp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if tmp % i == 0:
            cnt = 0
            while tmp % i == 0:
                cnt += 1
                tmp //= i
            res.append([i, cnt])
    if tmp != 1:
        res.append([tmp, 1])
    if res == []:
        res.append([n, 1])
    return res




N = int(input())
MOD = 10**9 + 7
fact = [[0, 0]]

for i in range(1, N+1):
    for fi in factorization(i):
        if fi[0] in fact[:][0]:
            fact[fi[0]][1] += fi[1]
        else:
            fact.append(fi)

ans = 1
for f in fact:
    ans *= (f[1] + 1)
    ans %= MOD

print(ans)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

ans=0
x = math.factorial(N)
for i in range(1, x//2+1):
    if N%i == 0:
        ans += 1
print(ans%(10**9+7))

Submission status: Wrong Answer

Solution code:
MOD = 10 ** 9 + 7
n = int(input())

res = 1
ex = [0 for _ in range(n + 1)]
for i in range(1, n + 1):
    for j in range(2, i + 1):
        if i % j == 0:
            while i % j == 0:
                ex[j] += 1
                i //= j

ans = 1
for i in range(n):
    ans *= (ex[i] + 1)
    ans %= MOD

print(ans)

Submission status: Wrong Answer

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

n = int(input())

c = 1
for i in range(1, n+1):
    c *= i
c = c%(10**9+7)
s = make_divisors(c)
print(len(s)%(10**9+7))

Submission status: Wrong Answer

Solution code:
# import math

def inv(x, mod=1):
    return pow(x, mod-2, mod)

def fact(x, mod=1):
    res = 1 
    for i in range(1, x + 1): 
        res *= i
        res %= mod    
    return res

def comb(n, k, mod=1000000007):
    return (fact(n, mod) * inv(fact(n-k, mod), mod) * inv(fact(k, mod), mod)) % mod


def func(n):
    # n_fact = func(math.factorial(n)
    res = n
    for i in range(2, n):
        res += comb(n-1,i)
    # for i in range(1, int(n**0.5)+1):
    #     if n % i == 0:
    #         res += 1
    #         if i != n // i:
    #             res += 1
    return (res % 1000000007)

n = int(input())
print(func(n))

Submission status: Wrong Answer

Solution code:
import sys
import math
import fractions
import bisect
import queue
import heapq
import collections
import itertools
sys.setrecursionlimit(4100000)

MOD = int(1e9+7)
PI = 3.14159265358979323846264338327950288
INF = 1e18

'''
1行のint=====================================
N, K = map(int, input().split())
N, M = map(int, input().split())
A, B = map(int, input().split())

H, W = map(int, input().split())

L, R = map(int, input().split())

1行のstring=================================
S, T = input().split()

1行の整数配列================================
P = list(map(int,input().split()))

A = list(map(int,input().split()))
B = list(map(int,input().split()))

D = list(map(int,input().split()))

L = list(map(int,input().split()))
R = list(map(int,input().split()))

T = list(map(int,input().split()))

改行あり整数==================================
X = []
Y = []
for i in range(N):
    x1,y1=[int(i) for i in input().split()]
    X.append(x1)
    Y.append(y1)

A = []
for i in range(N):
    a=int(input())
    A.append(a)

Pair = []
for i in range(N):
    x1,y1=[int(i) for i in input().split()]
    Pair.append((x1, y1))
    
2次元整数配列=====================================
A = []
for i in range(N):
    tmp = list(map(int,input().split()))
    A.append(tmp)


N行M列の初期化====================================
dp = [[VAL] * RETU for i in range(GYO)]

'''



N = int(input())

g_sosuu = [] # bool



def eratos(n):
    global g_sosuu

    for i in range(n):
        g_sosuu.append(True)
        
    g_sosuu[0] = False
    g_sosuu[1] = False
    for i in range(2, int(math.sqrt(n)) + 1):
        if g_sosuu[i]:
            for j in range(i*2, n, i):
                g_sosuu[j] = False


eratos(N//2+10)

sosuu_list = []
for i in range(N//2+10):
    if g_sosuu[i]:
        sosuu_list.append(i)


ans = 1
count = [0]*1010
for n in range(1, N+1):
    
    for s in sosuu_list:

        for i in range(1, 100):
            if n%(s**i) == 0:
                count[s] += 1
            else:
                break

for c in count[2:]:
    ans *= (c+1)%MOD
    ans %= MOD

print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter


def prime_factorize(n):
    p = 2
    fct = []
    # 素数pはp**2がAを超えないもの
    while n >= p ** 2:
        if n % p == 0:
            # このpは、2乗がAを超えないもの
            # 2乗がnを超えない限り割り続ける: 各pの積で割る
            n //= p
            fct.append(p)
        p += 1
    if n > 1:
        fct.append(n)
    return fct


N = int(input())
MOD = 1000000007
numbers = []
for i in range(1, N+1):
    numbers += prime_factorize(i)

count_numbers = Counter(numbers)
ans = 1
for n in count_numbers.values():
    ans *= ((n+1) % MOD)

print(ans % MOD)

Submission status: Wrong Answer

Solution code:
#提出デバッグ
#n<=10**3

n = int(input())

fct = [1]*(n+1)
fct[1] = 0
fct[0] = 0
mod = 10**9+7
#print(mod)
sq = int(n**(1//2))+3

for i in range(2,sq):
    for j in range(2,n//i+1):

        fct[i*j] = 0
#print(fct)
prm = []

for i in range(n+1):
    if fct[i]:
        prm.append(i)
#print("prm",prm)
ind = []

for p in prm:
    tmp = 0
    tmp2 = n
    while tmp2:
        tmp2//=p 
        tmp += tmp2 
    ind.append(tmp)
ans = 1
for i in ind:
    ans *= (i+1)
    ans %= mod

#print("ind",ind)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

MOD = 10**9+7

NN = [0 for _ in range(1001)]
AA = [0 for _ in range(1001)]


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        # if NN[temp] != 0:
        #     arr.append(NN[temp][0])
        #     return arr
        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

ans = 1
for i in range(1, N+1):
    chin = factorization(i)
    # NN[i] = chin
    # print(chin)
    for x,y in chin:
        AA[x] += y
for i in range(2, N):
    if AA[i] > 0:
        ans *= (AA[i]+1) % MOD
        ans %= MOD
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
prime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
res = 1

nprime = [p for p in prime if p <= n]

for p in prime:
    tempn = n
    tres = 1
    while tempn > p:
        tempn = tempn // p
        tres += tempn
    res *= tres
    if res > 10**9+7:
        res %= (10**9+7)

print(res)

Submission status: Wrong Answer

Solution code:
n=int(input())

r=1
while n>1:
  r=r*n
  n-=1

print(r//(10**9+7))

Submission status: Wrong Answer

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

def f(num):

    i = 2
    d = dict()

    while i * i <= num:
        if num % i == 0:
            num //= i
            d[i] = d.get(i, 0) + 1
        else:
            i += 1
    d[num] = 1

    return d

ans = 1

for i in f(math.factorial(int(input()))).values():
    ans *= i+1

print(ans%mod)

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[1]*(n+1)
for i in range(n):
    l[i+1]=(i+1)*l[i] % 1000000007
print(l[n])

Submission status: Wrong Answer

Solution code:
n=int(input())
def soinsuu(a):
    yakusuu=[]
    j=2
    while(a>1):
        for i in range(j,int(a**0.5)+1):
            if a%i==0:
                yakusuu.append(i)
                a=a//i
                j=i
                break
        else:
            yakusuu.append(a)
            break
    yakusuu.sort()
    return yakusuu
ans=[]
from collections import Counter
for i in range(2,n+1):
    ans+=soinsuu(i)
ans2=1
mod=10**9+7
for i in Counter(ans).values():
    ans2=(ans2*(i+1))%mod
ans2

Submission status: Wrong Answer

Solution code:
N = int(input())

from math import factorial
num_divide = factorial(N)

divided = False

factor_dict = {}

for i in range(2, N + 1):
    for t in range(2, i + 1):
        
        while i % t == 0:
        
            i /= t
            if t not in factor_dict:
                factor_dict[t] = 1
            else:
                factor_dict[t] += 1

        if i == 1:
            break

count = 1
for key, value in factor_dict.items():
    count *= value + 1
    count %= (1000000007)
    print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

from math import factorial
num_divide = factorial(N)

divided = False

factor_dict = {}

for i in range(2, N + 1):
    for t in range(2, i + 1):
        
        while i % t == 0:
        
            i /= t
            if t not in factor_dict:
                factor_dict[t] = 1
            else:
                factor_dict[t] += 1

        if i == 1:
            break

count = 1
for value in factor_dict.values():
    count *= value + 1
    
print(int(count % (10e9 + 7)))

Submission status: Wrong Answer

Solution code:
N = int(input())

from math import factorial
num_divide = factorial(N)

divided = False

factor_dict = {}

for i in range(2, N + 1):
    for t in range(2, i + 1):
        
        while i % t == 0:
        
            i /= t
            if t not in factor_dict:
                factor_dict[t] = 1
            else:
                factor_dict[t] += 1

        if i == 1:
            break

count = 1
for value in factor_dict.values():
    count *= value + 1
    
print(count % (10e9 + 7))

Submission status: Wrong Answer

Solution code:
N = int(input())

from math import factorial
num_divide = factorial(N)

divided = False

factor_dict = {}

for i in range(2, N + 1):
    for t in range(2, i + 1):
        
        while i % t == 0:
        
            i /= t
            if t not in factor_dict:
                factor_dict[t] = 1
            else:
                factor_dict[t] += 1

        if i == 1:
            break

count = 1
for value in factor_dict.values():
    count *= value + 1
    
count % (10e9 + 7)

Submission status: Wrong Answer

Solution code:
N = int(input())

from math import factorial
num_divide = factorial(N)

divided = False

factor_dict = {}

for i in range(2, N + 1):
    for t in range(2, i + 1):
        
        while i % t == 0:
        
            i /= t
            if t not in factor_dict:
                factor_dict[t] = 1
            else:
                factor_dict[t] += 1

        if i == 1:
            break

count = 1
for value in factor_dict.values():
    count *= value + 1
    
count % 10e9 + 7

Submission status: Wrong Answer

Solution code:
from collections import Counter

def factoring(N, factor_prev):
    '''
    input:
    N, factor_prev: 素因数分解すべきN, Nまでに存在する素数のリスト
    output
    N_dict, factor_list: Nの素因数分解の辞書: 例えば12の場合{2: 2, 3: 1}, Nが素数の場合はfactor_prevにNを追加して返す。Nが素数でない場合は引数を返す。
    '''
    
    factor_list = factor_prev
    N_dict = {}
    
    while True:
        if N == 1:
            return N_dict, factor_list
        
        for factor in factor_prev:
            if N % factor == 0:
                N = N // factor
                
                # 集計部分
                if factor in N_dict:
                    N_dict[factor] += 1
                    break
                    
                else:
                    N_dict[factor] = 1
                    break
                    
            #素数の場合
            if factor == factor_prev[-1] and N % factor != 0:
                factor_list.append(N)
                N_dict[N] = 1
                return N_dict, factor_list

def factorial_factoring(N):
    # 例外処理
    if N == 1:
        return {2: 0}
    
    else:
        factorial_factoring_dict = {}
        
        for i in range(2, N+1):
            if i == 2:
                N_dict = {2: 1}
                factor_prev = [2]
                factorial_factoring_dict = Counter(factorial_factoring_dict) + Counter(N_dict)
            else:
                N_dict, factor_prev = factoring(i, factor_prev)
                factorial_factoring_dict = Counter(factorial_factoring_dict) + Counter(N_dict)
    
    return(factorial_factoring_dict)
  
divisor = 1
mod = 1000000007
for _, v in factorial_factoring(1000).items():
    divisor = divisor * (v + 1)
print(divisor % mod)

Submission status: Wrong Answer

Solution code:
n = int(input())
prime = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37)
factor = {}
for i in prime:
    factor[i] = 0

for i in range(n):
    test = i+1
    for j in prime:
        while test%j == 0:
            factor[j] += 1
            test //= j

ans, MOD = 1, 10**9+7
for i in prime:
    ans *= factor[i]+1
    ans %= MOD
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
prime = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37)
factor = {}
for i in prime:
    factor[i] = 0

for i in range(n):
    test = i+1
    for j in prime:
        while test%j == 0:
            factor[j] += 1
            test //= j

ans, MOD = 1, 10**9+7
for i in prime:
    ans *= factor[i]+1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
P=[2]
for i in range(3,n+1):
  flag=1
  for p in P:
    if i%p==0:
      flag=0
  if flag==1:
    P.append(i)
ans=1
for p in P:
  np=0
  x=1
  while p**x<=n:
    np+=n//(p*x)
    x+=1
  ans*=(1+np)
print(ans%(10**9+7))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
d=dict()
m=[2,3,5,7,11,13,17,19,23,29,31]
for i in m:
  d[i]=0
  nn=n
  while nn:
    d[i]+=nn//i
    nn//=i
ans=1
for i in d.values():
  ans*=i+1
print(ans%1000000007)

Submission status: Wrong Answer

Solution code:
n=int(input())
d=dict()
if n==1:
  print(1)
else:
  for i in range(2,n+1):
    for j in range(2,i+1):
      if i%j==0:
        if j not in d:
          d[j]=1
        else:
          d[j]+=1
  ans=1
  for i in d.values():
    if i!=0:
      ans*=i+1
  print(ans%1000000007)

Submission status: Wrong Answer

Solution code:
n=int(input())
d=dict()
if n==1:
  print(1)
else:
  for i in range(2,n+1):
    for j in range(2,i+1):
      if i%j==0:
        if j not in d:
          d[j]=1
        else:
          d[j]+=1
  ans=1
  for i in d.values():
    if i!=0:
      ans*=i+1
  print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
d=dict()
if n==1:
  print(1)
else:
  for i in range(2,n+1):
    for j in range(2,i+1):
      if i%j==0:
        if j not in d:
          d[j]=1
        else:
          d[j]+=1
  ans=1
  for i in d.values():
    ans*=i+1
  print(ans)

Submission status: Wrong Answer

Solution code:
import math

def is_prime(n):
    if n == 2 or n == 3: return True
    if n%2 == 0 or n < 2: return False
    for i in range(3, int(n**0.5)+1, 2):
        if n%i == 0:
            return False
    return True

N = int(input())
ans = 1
for p in [i for i in range(N) if is_prime(i)]:
    e = 0
    for n in range(1, N+1):
        while n % p == 0:
            n //= p
            e += 1
    ans *= e + 1
ans %= 10**9 + 7
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())


def era(n):
    data = [i for i in range(2, n + 1)]
    for d in data:
        data = [x for x in data if (x == d or x % d != 0)]
    data1 = []
    for d in data:
        data1.append([d, 1])
    return data1


mod = 10 ** 9 + 7
n = ni()
lis = era(n)
print(lis)
for i in range(1, n + 1):
    for j in range(len(lis)):
        if i < lis[j][0]:
            break
        elif i % lis[j][0] == 0:
            count = 0
            m = i
            while(m % lis[j][0] == 0):
                m = m // lis[j][0]
                count += 1
            lis[j][1] += count
ans = 1
for i in range(len(lis)):
    ans *= lis[i][1]
    ans %= mod
print(ans)