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 collections import Counter
def f(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

n = int(input())
if n == 1:
    print(0)
    exit()
d = {}
mod = 10**9+7
d[2] = 1
for i in range(3, n+1):
    x = f(i)
    c = Counter(x)
    for j in c.keys():
        if j not in d:
            d[j] = c[j]
        else:
            d[j] += c[j]
        d[j] = d[j] % mod
ans = 1
for i in d.keys():
    ans *= d[i]+1
print(ans%mod)

Submission status: Wrong Answer

Solution code:
from collections import Counter
def f(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

n = int(input())
d = {}
mod = 10**9+7
d[2] = 1
for i in range(3, n+1):
    x = f(i)
    c = Counter(x)
    for j in c.keys():
        if j not in d:
            d[j] = c[j]
        else:
            d[j] += c[j]
        d[j] = d[j] % mod
ans = 1
for i in d.keys():
    ans *= d[i]+1
print(ans%mod)

Submission status: Wrong Answer

Solution code:
n = int(input())
is_prime = [True] * 1005
MOD = 10 ** 9 + 7
is_prime[0] = is_prime[1] = False
factors = []
for i in range(2, n + 1):
    if is_prime[i]:
        cnt = 0
        for j in range(i * i, n + 1, i):
            is_prime[j] = False
        while i <= n:
            cnt += n // i
            i *= i
        factors.append(cnt)
ans = 1
for x in factors:
    ans = ans * (x + 1) % MOD
print(ans)

Submission status: Wrong Answer

Solution code:
MOD = 10**9+7

def calcFact(k):
  acc = 1
  for i in range(1,k+1):
    acc *= i
    acc %= MOD
  return acc

def countDivider(k):
  f = 1
  acc = 0
  while f * f <= k:
    if k % f == 0:
      if f * f == k:
        acc += 1
      else:
        acc += 2
    f += 1
  return acc


print(countDivider(calcFact(int(input()))))

Submission status: Wrong Answer

Solution code:
from collections import Counter
N=int(input())
mod=1e+9 + 7
#引数nが素数かどうかを判定
def is_prime(n):
    for i in range(2, n + 1):
        if i * i > n:
            break
        if n % i == 0:
            return False
    return n != 1

#nを素因数分解したリストを返す
def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table

prime=[]
for i in range(2, N+1):
  if is_prime(i):
    prime.append(i)

prime_table=[]
for i in range(2, N+1):
  prime_table+=(prime_decomposition(i))

prime_table=Counter(prime_table)
ans=1
for k, v in prime_table.items():
  ans*=(v+1)%mod

print(int(ans%mod))

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
if n == 1:
    print(1)
    exit(0)
dp = [0] * (n+1)
mod = 10**9+7

def sieve_of_erastosthenes(num):
    input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)]
    input_list[0] = input_list[1] = False
    input_list[2] = input_list[3] = input_list[5] = True
    sqrt = math.sqrt(num)

    for serial in range(3, num, 2):

        if serial >= sqrt:
            return input_list

        for s in range(serial ** 2, num, serial): 
            input_list[s] = False

prime = sieve_of_erastosthenes(max(6, n))
prime = [i for i, t in enumerate(prime) if t]

for i in range(2, n+1):
    v = i
    while v < n+1:
        dp[i] += 1
        v += i

dp2 = [0] * (n+1)
for p in prime:
    v = p
    k = 1
    while v < n+1:
        dp2[p] += dp[v]
        v *= p
        k += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from operator import mul
from functools import reduce
def PrimeDecomp(N,ConcFlag):
    if ConcFlag:
        if N<=1:
            return [1],1
        else:
            I = 2
            PrimeDec = []
            DivCount = 1
            while I*I<=N:
                Cnt = 0
                while N%I==0:
                    N //= I
                    PrimeDec.append(I)
                DivCount *= (Cnt+1)
                I += 1
            if N>=2:
                PrimeDec.append(N)
                DivCount *= 2
            return PrimeDec,DivCount        
    else:
        if N<=1:
            return [1],[1],1
        else:
            I = 2
            PrimeDec = []
            PrimeCnt = []
            DivCount = 1
            while I*I<=N:
                Cnt = 0
                while N%I==0:
                    N //= I
                    Cnt += 1
                if Cnt>=1:
                    PrimeDec.append(I)
                    PrimeCnt.append(Cnt)
                    DivCount *= (Cnt+1)
                I += 1
            if N>=2:
                PrimeDec.append(N)
                PrimeCnt.append(1)
                DivCount *= 2
            return PrimeDec,PrimeCnt,DivCount

def DivisorFactorial(N,FactDec,FactCnt,MemoFlag):
    if MemoFlag:
        if N<=1:
            FDivCnt = 0
            return FactDec,FactCnt,FDivCnt
        else:
            PrimeDec,PrimeCnt,_ = PrimeDecomp(N,False)
            for TP in range(0,len(PrimeDec)):
                if PrimeDec[TP] in set(FactDec):
                    FactCnt[FactDec.index(PrimeDec[TP])] += PrimeCnt[TP]
                else:
                    FactDec.append(PrimeDec[TP])
                    FactCnt.append(PrimeCnt[TP])
            FDivCnt = reduce(mul,[(T+1) for T in FactCnt])
            return FactDec,FactCnt,FDivCnt
    else:
        if N<=1:
            FDivCnt = 0
            return FactDec,FactCnt,FDivCnt
        else:
            for TN in range(2,N+1): 
                PrimeDec,PrimeCnt,_ = PrimeDecomp(TN,False)
                for TP in range(0,len(PrimeDec)):
                    if PrimeDec[TP] in set(FactDec):
                        FactCnt[FactDec.index(PrimeDec[TP])] += PrimeCnt[TP]
                    else:
                        FactDec.append(PrimeDec[TP])
                        FactCnt.append(PrimeCnt[TP])
            FDivCnt = reduce(mul,[(T+1) for T in FactCnt])
            return FactDec,FactCnt,FDivCnt
          
N = int(input())
FactDec,FactCnt,FDivCnt = DivisorFactorial(N,[],[],False)
print(FDivCnt%(10**9+7))

Submission status: Wrong Answer

Solution code:
num = int(input())
product = 1
factors = 2

for i in range(1, num+1):
  product *= i
  
for j in range(1, product//2 + 1):
  if product % j == 0:
    factors += 1
print(factors)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import sqrt

num = int(input())
f = 1

for i in range(num):
  f = f * (i+1)
  
divisors = 0
new_f = f%1000000007
for i in range(int(sqrt(new_f))):
  if new_f%(i+1) == 0:
    divisors += 2
    
print(divisors)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import sqrt

num = int(input())
f = 1

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

Submission status: Wrong Answer

Solution code:
from math import sqrt

num = int(input())
f = 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num = int(input())
product = 1
factors = 0

for i in range(1, num+1):
  product *= i
  
for j in range(1, product//2 + 1):
  if product % j == 0:
    factors += 1
print(factors)

Submission status: Wrong Answer

Solution code:
num = int(input())
product = 1
factors = 0

for i in range(1, num+1):
  product *= i
  
for j in range(1, product//2 - 1):
  if product % j == 0:
    factors += 1
print(factors)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range(num):
  f = f * (i+1)
  

    
print(f)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
num = int(input())
product = 1
factors = 0

for i in range(1, num+1):
  product *= i
  
for j in range(1, product//2):
  if product % j == 0:
    factors += 1
print(factors)

Submission status: Wrong Answer

Solution code:
import math
from math import factorial

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

a = 1
for i in range(1,n+1):
    a *= i
    a %= mod

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

lis = factorization(a)

ans = 1
for i in lis:
    ans *= (i[1]+1)

print(ans)

Submission status: Wrong Answer

Solution code:
def compute(n):
	prime = [ True for i in range(0, n+1)]
	res = []
	for i in range(2, n+1):
		if prime[i]==True:
			res.append(i)
			for j in range(i , n+1,i):
				prime[j]=False
	return res

mod = 10**9+7
n = int(input())
res = compute(n)
tot = 1
for i in res:
	now = 0
	p =n
	while p>0:
		now = now+(p//i)
		p=p//i
	tot = (tot % mod)*((now+1)%mod)
print(tot)

Submission status: Wrong Answer

Solution code:
n = int(input())

factorial = 1
divisor = []
ans = 0

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

print(factorial)

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

# print(divisor)

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import Counter


def prime_factorization(n):
    """
    nを素因数分解して素因数のリストを返却する
    """
    if n < 2:
        return [n]

    primes = []
    while n % 2 == 0:
        primes.append(2)
        n //= 2
    i = 3
    while i ** 2 <= n:
        while n % i == 0:
            primes.append(i)
            n //= i
        i += 2
    if n != 1:
        primes.append(n)
    return primes


MOD = 10 ** 9 + 7
N = int(input())

counter = Counter()

if N == 1:
    print(1)
else:
    for n in range(2, N + 1):
        for p in prime_factorization(n):
            counter[p] += 1

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

print(ans)

Submission status: Wrong Answer

Solution code:
import collections
n = int(input())
li = []
for k in range(2, n+1):
  for i in range(2, int(k**0.5)+1):
    while k % i == 0:
      k //= i
      li.append(i)
  if k != 1:
    li.append(k)
c = collections.Counter(li)
ans = 1
for k, v in c.items():
  ans *= (v+1)
print(ans)

Submission status: Wrong Answer

Solution code:
from math import sqrt, ceil
N = int(input())
x = [1]*N
for i in range(2,N+1):
  for j in range(2,int(ceil(sqrt(N)))):
    while i%j == 0:
      i //= j;
      x[j-1] += 1
answer = 1
for i in x:
  answer *= i+1
  answer %= 1000000007
print(answer)

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy, copy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
#import numpy as np
#from decimal import *

#素因数分解
def factorization(n):
	arr = []
	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
			arr.append([i, cnt])
	if tmp != 1:
		arr.append([tmp, 1])
	if arr == []:
		arr.append([n, 1])
	return arr
	
N = INT()

if N == 1:
	print(1)
	exit()

dic = defaultdict(int)
for i in range(2, N+1):
	for key, value in factorization(i):
		dic[key] += value

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

print(ans)

Submission status: Wrong Answer

Solution code:
class Sieve:
    # Sieve of Eratosthenes
    def __init__(self, n):
        f = [0]*(n+1)
        primes = list()
        f[0] = f[1] = -1
        for i in range(2,n+1):
            if f[i]:
                continue
            primes.append(i)
            f[i]=i
            for j in range(i*i, n+1, i):
                if not f[j]:
                    f[j] = i
        self.f = f
        self.primes = primes
    def isPrime(self, x):
        return self.f[x] == x
    def factorList(self, x):
        res = list()
        while x > 1:
            res.append(self.f[x])
            x //= self.f[x]
        return res
    def factor(self, x):
        fl = self.factorList(x)
        if len(fl) == 0:
            return list()
        res = [[fl[0], 0]]
        for p in fl:
            if res[-1][0] == p:
                res[-1][1] += 1
            else:
                res.append([p, 1])
        return res

sv= Sieve(10000)

n=int(input())
ans=1
d=dict()
for i in range(2,n+1):
    f=sv.factor(i)

    for p,cnt in f:
        try:
            d[p]+=cnt
        except:
            d[p]=cnt

for p,cnt in d.items():
    ans*=(cnt+1)

print(ans)

Submission status: Wrong Answer

Solution code:
from math import factorial

N = int(input())
N = factorial(N)

i = 2
num = 1
ans = 1

while N != 1:
    if N % i == 0:
        N //= i
        num += 1
    else:
        ans *= num
        num = 1
        i += 1
ans *= num

print(ans)

Submission status: Wrong Answer

Solution code:
from math import factorial

N = int(input())
N = factorial(N)
maxx = (N // 2)
i = 2
num = 1
ans = 1

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

Submission status: Wrong Answer

Solution code:

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

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

print(ans + 1)

Submission status: Wrong Answer

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

N = int(input())
from collections import Counter
from numpy import prod

def Main(N):
    if N == 1:
        return 1
    ans = []
    for i in range(2, N+1):
        ans += prime_factorize(i)
    counter = Counter(ans)
    val = [v+1 for v in counter.values()]
    return prod(val)
          
                    
print(Main(N))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
from functools import reduce
from math import ceil, sqrt
def factorint(n):
    d = {}
    for i in range(2, ceil(sqrt(n))):
        c = 0
        q, r = divmod(n, i)
        while not r:
            c += 1
            n = q
            q, r = divmod(n, i)
        if c:
            d[i] = c
    if n != 1:
        d[n] = 1
    return d

n = int(input())
mod = 10**9 + 7
A = defaultdict(lambda:1)
for i in range(1, n+1):
    for k, v in factorint(i).items():
        A[k] += v

print(reduce(lambda x, y: x*y % mod, A.values()) if A else 1)

Submission status: Wrong Answer

Solution code:
import functools
def primes(n):

    prime_list = list(range(n+1))
    prime_list[1] = 0
    for i in range(2, int(n**0.5)+1):
        if prime_list[i] != 0:
            for j in range(2*i, n+1, i):
                prime_list[j] = 0

    return [i for i in prime_list if i != 0]

def solve(n):

    prime_list = primes(n)
    powers = []
    for p in prime_list:
        tmp = 0
        a = p
        while a <= n:
            tmp += n // a
            a *= p
        powers.append(tmp)

    ans = functools.reduce(
        lambda acc, x: (acc*(x+1)) % (10**9+1), powers, 1)

    return ans

if __name__ == "__main__":
    n = int(input())
    print(solve(n))

Submission status: Wrong Answer

Solution code:
from math import sqrt
from collections import defaultdict

n = int(input())
cnt = defaultdict(int)

def judge_prime(j):
    div_cnt = 0
    #print(j)
    for i in range(1, j + 1):
        if j % i == 0:
            div_cnt += 1
    
    if div_cnt == 2:
        return True
    return False

def cnt_div(i, j):
    ret = 0
    while i % j == 0:
        ret += 1
        i //= j

    return ret
for i in range(1, n + 1):
    for j in range(1, n + 1):
        #print(i % j == 0)
        #print(judge_prime(j))
        if i % j == 0 and judge_prime(j):
            cnt[j] += cnt_div(i, j)
        
    
ans = 0
#print(cnt)
for k, v in cnt.items():
    if ans == 0:
        ans += v + 1
    else:
        ans *= v + 1

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

Submission status: Wrong Answer

Solution code:
from math import sqrt
from collections import defaultdict

n = int(input())
cnt = defaultdict(int)

def judge_prime(j):
    div_cnt = 0
    #print(j)
    for i in range(1, j + 1):
        if j % i == 0:
            div_cnt += 1
    
    if div_cnt == 2:
        return True
    return False

def cnt_div(i, j):
    ret = 0
    while i % j == 0:
        ret += 1
        i //= j

    return ret
for i in range(1, n + 1):
    for j in range(1, i + 1):
        #print(i % j == 0)
        #print(judge_prime(j))
        if i % j == 0 and judge_prime(j):
            cnt[j] += cnt_div(i, j)
        
    
ans = 0
#print(cnt)
for k, v in cnt.items():
    if ans == 0:
        ans += v + 1
    else:
        ans *= v + 1

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

Submission status: Wrong Answer

Solution code:
def is_prime(q):
    if q < 2 or q&1 == 0: return False
    return pow(5, q-1, q)*pow(7, q-1, q) == 1
  
def main():
  mod = 10**9+7
  n = int(input())
  ans = 1
  if n == 1:
    print(1)
    exit()
  
  b = [2]
  for i in range(2,min(n,998)):
    if i == 5 or i == 7:
      b.append(i)
    if i == 561:
      continue
    if is_prime(i):
      b.append(i)
  
  for i in b:
    p = i
    cnt = 1
    chk = 1
    for j in range(10):
      chk += n//p
      if p > n:
        ans *= chk
        ans %= mod
        chk = 1
        break
      p *= i
      
  print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

import math

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

num = prime_factorize(math.factorial(N))
ans = 1
num_list = set(num)

for x in num_list:
    ans *= (num.count(x) + 1)
    
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
a = []

if (n==1):
    print(1)
    sys.exit

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(2,n+1):
    a = prime_factorize(i,a)

a.sort()
c = []
count = 1
for i in range(1,len(a)):
    if(a[i-1]!=a[i]):
        c.append(count)
        count = 1
    else:
        count += 1
c.append(count)

ans = 1
for i in range(0,len(c)):
    ans *= (c[i]+1)
print(ans % 1000000007)

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc052/tasks/arc067_a
# C - Factors of Factorial

N = int(input())

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


def get_prime_factor(n):
    from collections import defaultdict
    res = defaultdict(int)
    for i in range(2, n + 1):
        if i * i > n:
            break
        while n % i == 0:
            res[i] = res[i] + 1
            n = n // i
    if n != 1:
        res[n] = 1
    return res

prime_factor = get_prime_factor(n)

# WIP
# TODO: 素因数から約数(の個数)をどうやって取り出すか

Submission status: Wrong Answer

Solution code:

import math
from collections import Counter
from collections import defaultdict
mod = 10**9+7 

def prime(n):
  for i in range(2, math.ceil(math.sqrt(n))+1):
    while n % i == 0:
      n /= i
      prime_count[i] += 1
  if n > 1:
    prime_count[int(n)] += 1

n = int(input())
a = 1
prime_count = defaultdict(int)
for i in range(1, n+1):
  prime(i)

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

Submission status: Wrong Answer

Solution code:
def resolve():
    n = int(input())
    M = 10 ** 9 + 7
    pl = [0] * (n + 1)

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

Submission status: Wrong Answer

Solution code:
n=int(input())
array=[]
for i in range(2,n+1):
    s=i
    while s!=1:
        turn=0
        for j in range(2,s+1):
            if s%j==0:
                s=s//j
                array.append(j)
                break
ans=1
import collections
c=collections.Counter(array)
l=list(c.values())
print(l)
for i in range(len(l)):
    ans*=l[i]+1
print(ans%(10**9+7))

Submission status: Wrong Answer

Solution code:
n=int(input())
N=1
for i in range(1,n+1):
    N*=i
    
array=[]
while N!=1:
    turn=0
    for i in range(2,N+1):
        if N%i==0:
            N=N//i
            array.append(i)
            break
ans=1
import collections
c=collections.Counter(array)
l=list(c.values())
for i in range(len(l)):
    ans*=l[i]+1
print(ans%(10**9+1))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
n = int(input())
f = defaultdict(int)
for i in range(2, n+1):
  for j in range(2, i+1):
    if i % j == 0:
      f[j] += 1
ans = 1
mod = 10**9 + 7
for k,v in f.items():
  ans = (ans * (v+1)) % mod
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
n = int(input())
f = defaultdict(int)
for i in range(2, n+1):
  for j in range(2, i+1):
    if i % j == 0:
      f[j] += 1
ans = 1
mod = 10**9 + 7
for k,v in f.items():
  ans = (ans * v) % mod
print(ans)

Submission status: Wrong Answer

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

n=int(input())

x=[0]*1000
for i in range(2,n+1):
  for _ in prime_factorize(i):
    x[_]+=1

ans=1
for _ in x:
  if _ > 0:
    ans=(ans*(_+1))%(10**9+7)

print(ans)
    
x.sort()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
insu_list = [[2, 0]]
ans = 1

for i in range(N):
    n = i+1
    for j in range(len(insu_list)):
        while n % insu_list[j][0] == 0:
            n /=insu_list[j][0]
            insu_list[j][1] += 1
    if n != 1:
        insu_list.append([n, 1])
print(insu_list)
for i in range(len(insu_list)):
    ans *= insu_list[i][1] + 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

class remainder():
    def __init__(self, mod=(10**9 + 7)):
        self.mod = mod
    
    def mul(self, a, b):
        return ((a % self.mod) * (b % self.mod)) % self.mod

    def pow(self, a, b):
        bp = []
        #bp.append(1)
        bp.append(a)

        n = len(bin(b)) - 2
        for x in range(n):
            bp.append(bp[x]**2 % self.mod)

        res = 1
        for x in range(n):
            if b >> x & 1:
                res = (res * bp[x]) % self.mod
        
        return res

    def div(self, a, b):
        
        return self.mul(a, self.pow(b, self.mod - 2))


def findAllOfPrime(N):
    prime = [True] * (N + 1)
    prime[0] = False
    prime[1] = False

    x = 2
    while x**2 <= N:
        if prime[x]:
            j = 2
            while x * j <= N:
                prime[x * j] = False
                j += 1
        x += 1

    return prime

re = remainder()
primes = set()
for n in range(1, N + 1):
    prime = findAllOfPrime(n)
    for i, p in enumerate(prime):
        if p:
            primes.add(i)

print(primes)

A = math.factorial(N)
ans = 1
for p in primes:
    cnt = 1
    while A % p == 0:
        cnt += 1
        A //= p
    ans = re.mul(ans, cnt)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct
  
MOD = 10 ** 9 + 7

print(len(factorize(n)) % MOD)

Submission status: Wrong Answer

Solution code:
from collections import Counter
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table

n = int(input())
insu = []
for i in range(2, n+1):
  insu = insu + prime_decomposition(i)
insu_c = Counter(insu)

r = 1

for c in insu_c.values():
  r *= (c+1)
print(r)

Submission status: Wrong Answer

Solution code:
import collections

n = int(input())


def prime_factorize_n(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


k = []
for i in range(1, n + 1):
    k = k + prime_factorize_n(i)
c = collections.Counter(k)
d = c.most_common()
ans = 1

for k, v in d:
    ans *= (v + 1) % (10 ** 9 + 7)
print(ans)