s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time stringlengths 1 5 | memory stringlengths 1 7 | code_size stringlengths 1 6 | code stringlengths 1 539k |
|---|---|---|---|---|---|---|---|---|---|---|---|
s369836305 | p03828 | u704001626 | 1560309093 | Python | Python (3.4.3) | py | Runtime Error | 1046 | 5076 | 817 | n = int(input())
#k(2~n)について、2~kの素数までで割り切れる回数をカウント
def primes(n):
is_prime = [True] * (n + 1)
is_prime[0] = False
is_prime[1] = False
for i in range(2, int(n**0.5) + 1):
if not is_prime[i]:
continue
for j in range(i * 2, n + 1, i):
is_prime[j] = False
return ... |
s974307693 | p03828 | u733337827 | 1556920857 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 211 | N = int(input())
K = eval("*".join(map(str,[*range(1, N+1)])))
ans = 1
for i in range (2, N + 1):
num = 0
while K % i == 0:
num += 1
K //= i
ans *= (num + 1)
print(ans % (10**9 + 7)) |
s083126855 | p03828 | u733337827 | 1556919991 | Python | Python (3.4.3) | py | Runtime Error | 71 | 3880 | 213 | N = int(input())
f = lambda n: n*f(n-1) if n > 1 else 1
K = f(N)
ans = 1
for i in range (2, N + 1):
num = 0
while K % i == 0:
num += 1
K //= i
ans *= (num + 1)
print(ans % (10**9 + 7)) |
s846642860 | p03828 | u298892458 | 1555609413 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1055 | import math
n = int(input())
lim = math.ceil(math.sqrt(n))
# 素数判定関数
def isPrime(num):
# 2未満の数字は素数ではない
if num < 2: return False
# 2は素数
elif num == 2: return True
# 偶数は素数ではない
elif num % 2 == 0: return False
# 3 ~ numまでループし、途中で割り切れる数があるか検索
# 途中で割り切れる場合は素数ではない
for i in range(3, math.... |
s663782805 | p03828 | u483645888 | 1555072387 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 242 | import math
n = math.factorial(int(input()))
mod = 10**9+7
#print(n)
def div(n):
di = []
for i in range(1,int(n**0.5)+1):
if n % i == 0:
di.append(i)
if i != n//i:
di.append(n//i)
return di
print(len(div(n))%mod) |
s925295203 | p03828 | u483645888 | 1555072304 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 224 | import math
n = math.factorial(int(input()))
#print(n)
def div(n):
di = []
for i in range(1,int(n**0.5)+1):
if n % i == 0:
di.append(i)
if i != n//i:
di.append(n//i)
return di
print(len(div(n))) |
s615672741 | p03828 | u677440371 | 1555027331 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 351 | N = int(input())
prime_list = make_prime_list(N)
pcount={}
for p in prime_list:
pcount[p]=0
for nn in range(2,num+1):
for p in prime_list:
n=nn
if n<p:
break
while n%p==0:
n//=p
pcount[p]+=1
ans = 1
for i in pcount.values():
ans *= (i ... |
s005140792 | p03828 | u603745966 | 1554952458 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3700 | 1292 | 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,... |
s552431337 | p03828 | u210827208 | 1554823716 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 177 | 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)) |
s319392023 | p03828 | u210827208 | 1554823670 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 172 | 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)
|
s880255742 | p03828 | u037430802 | 1554740562 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 610 | 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())
pfl... |
s573431297 | p03828 | u798129018 | 1554700842 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 298 | 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) |
s324560663 | p03828 | u798129018 | 1554700812 | Python | PyPy3 (2.4.0) | py | Runtime Error | 168 | 38256 | 298 | 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) |
s328235492 | p03828 | u798129018 | 1554700781 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38384 | 298 | 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)
|
s293058049 | p03828 | u798129018 | 1554700724 | Python | PyPy3 (2.4.0) | py | Runtime Error | 171 | 38768 | 553 | 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(... |
s980432878 | p03828 | u225415456 | 1554422551 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 331 | 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)
pr... |
s756425142 | p03828 | u933214067 | 1551925949 | Python | Python (3.4.3) | py | Runtime Error | 168 | 13644 | 1809 | 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():
... |
s435796283 | p03828 | u455696302 | 1551728599 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 451 | 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 = pri... |
s220977534 | p03828 | u977389981 | 1548989952 | Python | Python (3.4.3) | py | Runtime Error | 52 | 3064 | 344 | 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 + ... |
s419394439 | p03828 | u273201018 | 1548625300 | Python | Python (3.4.3) | py | Runtime Error | 35 | 3064 | 472 | 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... |
s456359154 | p03828 | u020604402 | 1546241229 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38512 | 374 | 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)... |
s713560813 | p03828 | u427344224 | 1542574459 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 4437 | 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);
T... |
s408748531 | p03828 | u123756661 | 1541130991 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3064 | 434 | #!/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:
... |
s335542799 | p03828 | u883048396 | 1540828263 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3192 | 616 | 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... |
s967758557 | p03828 | u459697504 | 1540162738 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 777 | #! /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)のみリストにする
... |
s194040780 | p03828 | u863841238 | 1538089097 | Python | Python (3.4.3) | py | Runtime Error | 74 | 3876 | 639 | 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... |
s666636892 | p03828 | u863076295 | 1536886909 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 209 | 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) |
s518291641 | p03828 | u863076295 | 1536873607 | Python | Python (3.4.3) | py | Runtime Error | 43 | 3060 | 199 | 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) |
s083126794 | p03828 | u863076295 | 1536873433 | Python | Python (3.4.3) | py | Runtime Error | 44 | 3060 | 199 | 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) |
s586324128 | p03828 | u140251125 | 1533346225 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 243 | 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)
|
s219945663 | p03828 | u690536347 | 1533237377 | Python | Python (3.4.3) | py | Runtime Error | 78 | 3572 | 277 | 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) |
s090027376 | p03828 | u588341295 | 1532327652 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1235 | # -*- 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
ste... |
s337868623 | p03828 | u004025573 | 1532283183 | Python | Python (3.4.3) | py | Runtime Error | 57 | 3064 | 682 | 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 isprim... |
s314596105 | p03828 | u631277801 | 1532270168 | Python | Python (3.4.3) | py | Runtime Error | 31 | 3064 | 673 | 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 ... |
s177900327 | p03828 | u631277801 | 1532269999 | Python | Python (3.4.3) | py | Runtime Error | 30 | 3192 | 642 | 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 ... |
s148418712 | p03828 | u419686324 | 1530948815 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 511 | 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()))
... |
s489854994 | p03828 | u653642801 | 1530932895 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 2242 | 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:... |
s608496516 | p03828 | u653642801 | 1530932741 | Python | Python (3.4.3) | py | Runtime Error | 69 | 3064 | 990 |
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:
... |
s078340546 | p03828 | u653642801 | 1530932658 | Python | Python (3.4.3) | py | Runtime Error | 68 | 3064 | 974 | 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.ind... |
s994181180 | p03828 | u653642801 | 1530932456 | Python | Python (3.4.3) | py | Runtime Error | 69 | 3064 | 987 |
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
... |
s885618627 | p03828 | u095969144 | 1530066780 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 65 | i = int(input())
s = input()
s_c = s.count("D")
print(i - s_c)
|
s432971710 | p03828 | u095969144 | 1530066689 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 64 | i = int(input())
s = input()
s_c = s.count("I")
print(i - s_c) |
s198637569 | p03828 | u251252118 | 1529531277 | Python | Python (2.7.6) | py | Runtime Error | 14 | 2568 | 140 | 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 |
s880178265 | p03828 | u270681687 | 1527957520 | Python | Python (3.4.3) | py | Runtime Error | 74 | 3896 | 293 | 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)) |
s572682900 | p03828 | u125205981 | 1524287990 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3188 | 700 | 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
c... |
s418725725 | p03828 | u257974487 | 1522025554 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 13 | import sympy
|
s224103823 | p03828 | u729707098 | 1521838861 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 195 | 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) |
s641165638 | p03828 | u257974487 | 1520816331 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 122 | 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)) |
s843460063 | p03828 | u030726788 | 1520470886 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 164 | 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) |
s501157839 | p03828 | u143492911 | 1518672808 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 105 | n=int(input())
mod=10**9+7
import math
import sympy
v=math.factorial(n)
print(sympy.divisor_count(v)%mod) |
s300972004 | p03828 | u811528179 | 1516943652 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 133 | 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))
|
s953637084 | p03828 | u863684580 | 1514850796 | Python | Python (2.7.6) | py | Runtime Error | 2105 | 11396 | 390 | 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 ... |
s117647562 | p03828 | u863684580 | 1514850577 | Python | Python (2.7.6) | py | Runtime Error | 2105 | 11396 | 393 | 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... |
s983924653 | p03828 | u800610991 | 1500179835 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 164 | 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)
|
s344555332 | p03828 | u667084803 | 1494631435 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 203 | 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) |
s163300682 | p03828 | u667084803 | 1494630792 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 168 | 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)) |
s020682436 | p03828 | u667084803 | 1494630499 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 158 | 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) |
s208039042 | p03828 | u820680729 | 1485445074 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 129 | from sympy import divisor_count
from math import factorial
div = 10**9 + 7
n = int(input())
print(divisor_count(factorial(n))) |
s835517961 | p03828 | u010110540 | 1485230585 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3192 | 199 | 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) |
s509436650 | p03828 | u284563808 | 1484946365 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 122 | import math
from sympy import divisor_count
N = int(input())
N = math.factorial(N)
print(divisor_count(N) % (10**9 + 7))
|
s753233540 | p03828 | u482249892 | 1484754988 | Python | Python (3.4.3) | py | Runtime Error | 37 | 4076 | 800 | 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
... |
s925625313 | p03828 | u886545507 | 1484666468 | Python | Python (2.7.6) | py | Runtime Error | 21 | 2692 | 159 | 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)
|
s930911427 | p03828 | u886545507 | 1484666396 | Python | Python (2.7.6) | py | Runtime Error | 18 | 2568 | 167 | 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)
|
s260524064 | p03828 | u731028462 | 1484602383 | Python | Python (3.4.3) | py | Runtime Error | 29 | 3700 | 967 | from functools import reduce
MOD = 10**9 + 7
primes = list(map(int, "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 ... |
s300741873 | p03828 | u009460507 | 1484540715 | Python | Python (3.4.3) | py | Runtime Error | 40 | 3064 | 927 | import math
def prime_decomposition(n):
i = 2
table = []
while i * i <= n:
while n % i == 0:
n = n // i
table.append(i)
i += 1
if n > 1:
table.append(n)
return table
n = int(input())
n_kai = math.factorial(n)
soin = prime_decomposition(n_kai)
tmp = soin[0]
counter = 0
num_dict = ... |
s183559094 | p03828 | u009460507 | 1484540584 | Python | Python (3.4.3) | py | Runtime Error | 40 | 3064 | 906 | import math
def prime_decomposition(n):
i = 2
table = []
while i * i <= n:
while n % i == 0:
n = n // i
table.append(i)
i += 1
if n > 1:
table.append(n)
return table
n = int(input())
n_kai = math.factorial(n)
soin = prime_decomposition(n_kai)
tmp = soin[0]
counter = 0
num_dict = ... |
s508610700 | p03828 | u009460507 | 1484540386 | Python | Python (3.4.3) | py | Runtime Error | 39 | 3064 | 883 | import math
def prime_decomposition(n):
i = 2
table = []
while i * i <= n:
while n % i == 0:
n = n // i
table.append(i)
i += 1
if n > 1:
table.append(n)
return table
n = int(input())
n_kai = math.factorial(n)
soin = prime_decomposition(n_kai)
tmp = soin[0]
counter = 0
num_dict = ... |
s758071442 | p03828 | u580920947 | 1484538037 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3192 | 262 |
N = int(input())
ls = [1]
ans = 0
if N == 1:
print(1)
else:
for i in range(1, N+1):
new_ls = map(lambda x: x*i, ls)
for j in new_ls
if j not in ls:
ans += 1
ls.append(j)
print(ans) |
s376258375 | p03828 | u590905793 | 1484537972 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3188 | 229 | import math
y = int(input())
n= math.factorial(y)
i = 2
num = 1
while i * i <= n:
temp = 0
while n % i == 0:
temp += 1
n /= i
if temp != 0:
temp += 1
num *= temp
i += 1
if n > 1:
num *= 2
print(num % (10**9 + 7)) |
s573796004 | p03828 | u009460507 | 1484537954 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 718 | import math
def prime_decomposition(n):
i = 2
table = []
while i * i <= n:
while n % i == 0:
n = n // i
table.append(i)
i += 1
if n > 1:
table.append(n)
return table
n = int(input())
n_kai = math.factorial(n)
soin = prime_decomposition(n_kai)
tmp = soin[0]
counter = 0
num_dict = {... |
s594512805 | p03828 | u106342872 | 1484537891 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 648 | # -*- coding:utf-8 -*-
import math
import sys
def mark(s, x):
for i in range(x + x, len(s), x):
s[i] = False
def sieve(n):
s = [True] * n
for x in range(2, int(n**0.5) + 1):
if s[x]: mark(s, x)
return [i for i in range(0,n) if s[i] and i > 1]
n = int(input())
p = sieve(n)
arr = [0]*le... |
s022174810 | p03828 | u580920947 | 1484537540 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 273 | # -*- coding: utf-8 -*-
# problem C2
N = int(input())
ls = [1]
ans = 0
if N == 1:
print(1)
else:
for i in range(1, N+1):
for j in ls:
x = j * i
if x not in ls:
ans += 1
n.append(x)
print(ans) |
s008265861 | p03828 | u009460507 | 1484536951 | Python | Python (3.4.3) | py | Runtime Error | 40 | 3064 | 706 | import math
def prime_decomposition(n):
i = 2
table = []
while i * i <= n:
while n % i == 0:
n = n // i
table.append(i)
i += 1
if n > 1:
table.append(n)
return table
n = int(input())
n_kai = math.factorial(n)
soin = prime_decomposition(n_kai)
tmp = soin[0]
counter = 0
num_dict = {... |
s414904929 | p03828 | u009460507 | 1484536839 | Python | Python (3.4.3) | py | Runtime Error | 41 | 3064 | 713 | def prime_decomposition(n):
i = 2
table = []
while i * i <= n:
while n % i == 0:
n = n // i
table.append(i)
i += 1
if n > 1:
table.append(n)
return table
n = int(input())
n_kai = 1
for i in range(1, n+1):
n_kai*=i
soin = prime_decomposition(n_kai)
tmp = soin[0]
counter = 0
num_d... |
s840449827 | p03828 | u009460507 | 1484536592 | Python | Python (3.4.3) | py | Runtime Error | 42 | 3188 | 1016 | def prime_decomposition(n):
i = 2
table = []
while i * i <= n:
while n % i == 0:
n = n // i
table.append(i)
i += 1
if n > 1:
table.append(n)
return table
n = int(input())
n_kai = 1
for i in range(1, n+1):
n_kai*=i
#print(n_kai)
soin = prime_decomposition(n_kai)
soin = [int(x) f... |
s750793218 | p03828 | u012693733 | 1484536263 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 413 | import math
def num_divisors(n):
return reduce(lambda x, y: x * (y[1] + 1), factorize(n), 1)
def factorize(n):
f = ()
for m in gen_prime_candidates():
if m * m > n:
break
e, n = calc_exp(n, m)
if e:
f = f + ( (m, e), )
if n != 1:
f = f + ( (n, 1)... |
s521264647 | p03828 | u009460507 | 1484536127 | Python | Python (3.4.3) | py | Runtime Error | 42 | 3192 | 1017 | def prime_decomposition(n):
i = 2
table = []
while i * i <= n:
while n % i == 0:
n = n // i
table.append(i)
i += 1
if n > 1:
table.append(n)
return table
n = int(input())
n_kai = 1
for i in range(1, n+1):
n_kai*=i
#print(n_kai)
soin = prime_decomposition(n_kai)
soin = [int(x) f... |
s056525844 | p03828 | u382423941 | 1484535870 | Python | Python (3.4.3) | py | Runtime Error | 168 | 3828 | 405 | import functools
mod = 1e9 + 7
n = int(input())
fact = [1] * (n+1)
for i in range(2, n+1):
for j in range(2, 32):
if i == 0:
break
while True:
if i % j == 0:
i /= j
fact[j] += 1
else:
break
if i != 0:
f... |
s070977729 | p03828 | u093843560 | 1484533864 | Python | Python (2.7.6) | py | Runtime Error | 1320 | 15344 | 713 | from scipy.special import factorial
def factorization(n):
def factor_sub(n, m):
c = 0
while n % m == 0:
c += 1
n /= m
return c, n
#
buff = []
c, m = factor_sub(n, 2)
if c > 0: buff.append((2, c))
c, m = factor_sub(m, 3)
if c > 0: buff.append((... |
s111309976 | p03829 | u825685913 | 1601401537 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9148 | 164 | l = list(map(int, input().split()))
ans = 0
for i in range(n-1):
dx = a * (l[i+1] - l[i])
if b < dx:
ans += b
else:
ans += dx
print(ans) |
s717316147 | p03829 | u036104576 | 1596044612 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8952 | 202 | N, A, B = map(int, input().split())
X = list(map(int, input().split()))
ans = 0
for i in range(1, N):
d = X[i] - X[i - 1]
if d * A > B:
ans += B
else:
ans += d * A
print(ans |
s870899751 | p03829 | u878654696 | 1591977131 | Python | Python (3.4.3) | py | Runtime Error | 26 | 11096 | 153 | n, a, b = map(int, input().split())
x = map(int, input().split())
ans = 0
for i in range(1, len(x)):
ans += min(b, (x[i]-x[i-1]+a-1)//a*a)
print(ans) |
s765629963 | p03829 | u878654696 | 1591977100 | Python | Python (3.4.3) | py | Runtime Error | 27 | 11096 | 148 | n, a, b = map(int, input().split())
x = map(int, input().split())
ans = 0
for i in range(1, x):
ans += min(b, (x[i]-x[i-1]+a-1)//a*a)
print(ans) |
s610746075 | p03829 | u025501820 | 1589734993 | Python | PyPy3 (2.4.0) | py | Runtime Error | 190 | 38640 | 242 | #!/usr/bin/env python3
import numpy as np
N, A, B = map(int, input().split())
X = np.array(list(map(int, input().split())))
diff = np.diff(X)
ans = 0
for d in diff:
if d * A <= B:
ans += d * A
else:
ans += B
print(ans) |
s673109971 | p03829 | u578323547 | 1588298609 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 14252 | 152 | n,a,b = map(int, input().split())
x = [int(x) for x in input().split(' ')]
mp = 0
for i in range(n-1):
mp += min(a*(x[i+1]-x[i], b))
print(mp) |
s835889495 | p03829 | u973053237 | 1587673027 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 124 | n,a,b=map(int,input().split())
s=list(map(int,input().split())
t=0
for i in range(n-1):
t+=min(b,a*(s[i+1]-s[i]))
print(t) |
s909193489 | p03829 | u923659712 | 1573742929 | Python | Python (3.4.3) | py | Runtime Error | 92 | 14224 | 168 | n,a,b=map(int,input().split())
x=list(map(int,input().split()))
ans=0
for i in range(n):
if (x[i+1]-x[i])*a>=b:
ans+=b
else:
ans+=(x[i+1]-x[i])*a
print(ans) |
s769084051 | p03829 | u141610915 | 1568232553 | Python | PyPy3 (2.4.0) | py | Runtime Error | 169 | 38512 | 187 | N, A, B = map(int, input().split())
X = list(map(int, input().split()))
res = 0
for i in range(N - 1):
if X[i + 1] - X[i] > B:
res += B
else:
res += X[i + 1] = X[i]
print(res) |
s927101825 | p03829 | u114648678 | 1559561905 | Python | Python (3.4.3) | py | Runtime Error | 87 | 14252 | 214 | n,a,b=map(int,input().split())
x=list(map(int,input().split()))
if a>=b:
print(b*n)
else:
d=b//a
ans=0
for i in range(n-1):
if x[i+1]-x[i]>d:
ans+=b
else:
ans+=(x[i+1]-x[i])*a
print(ans) |
s070860269 | p03829 | u268793453 | 1542152660 | Python | PyPy3 (2.4.0) | py | Runtime Error | 202 | 39536 | 158 | n, a, b = [int(i) for i in input().split()]
X = [int(i) for i in input.split()]
ans = 0
for i in range(n-1):
ans += min(a * (X[i+1] - X[i]), b)
print(ans) |
s736245701 | p03829 | u268793453 | 1542152628 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 158 | n, a, b = [int(i) for i in input().split()]
X = [int(i) for i in input.split()]
ans = 0
for i in range(n-1):
ans += min(a * (X[i+1] - X[i]), b)
print(ans) |
s617091256 | p03829 | u268793453 | 1542152582 | Python | PyPy3 (2.4.0) | py | Runtime Error | 200 | 39664 | 156 | n, a, b = [int(i) for i in input().split()]
X = [int(i) for i in input.split()]
ans = 0
for i in range(n-1):
ans += min(a * X[i+1] - X[i], b)
print(ans) |
s883543808 | p03829 | u268793453 | 1542152554 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38512 | 150 | n, a, b = [int(i) for i in input().split()]
X = [int(i) for i in input.split()]
ans = 0
for i in range(n-1):
ans += min(a * X[i+1] - b)
print(ans) |
s762613087 | p03829 | u631277801 | 1532435098 | Python | Python (3.4.3) | py | Runtime Error | 134 | 14636 | 626 | from collections import deque
N,A,B = map(int, input().split())
X = list(map(int, input().split()))
INF = float("inf")
dist = deque(X)
next_x = +1
i = 0
ans = 0
while len(dist) != 1:
if A*abs(dist[i+next_x] - dist[i]) <= B:
ans += A*abs(dist[i+next_x] - dist[i])
if next_x == 1:
dist... |
s441501558 | p03829 | u150117535 | 1504991078 | Python | PyPy3 (2.4.0) | py | Runtime Error | 164 | 38384 | 109 | n,a,b=[int(x) for x in input().split()]
ans=0
for i in range(n-1):
ans+=max(a*(x[i+1]-x[i]),b)
print(ans) |
s508091042 | p03829 | u873917047 | 1485644268 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 220 | coding: UTF-8
N, A, B=map(int, input().split())
lis=list(map(int,input().split()))
#print(lis)
out=0
for i in range(0,N-1):
d=lis[i+1]-lis[i]
if d*A < B:
out=out+d*A
else:
out=out+B
print(out) |
s762583436 | p03829 | u348405655 | 1485401550 | Python | Python (3.4.3) | py | Runtime Error | 29 | 5140 | 234 | N, A, B = map(int,input().split());
X[N] = map(int,input().split);
for i in range(N-1):
dist[i] = X[i+1]-X[i];
fatigue = 0;
for i in dist:
if i*A<B:
fatigue += i * A;
else:
fatigue += B;
print(fatigue);
|
s895653768 | p03829 | u093843560 | 1484538933 | Python | Python (2.7.6) | py | Runtime Error | 242 | 22952 | 549 | import numpy as np
N,A,B = map(int,raw_input().split())
city = raw_input()
ci = city.split(" ")
path = []
for i in range(len(ci)-1):
z = int(ci[i+1])-int(ci[i])
path.append(z)
costa = []
def binary_encode(i, num_digits):
return np.array([i >> d & 1 for d in range(num_digits)])
for i in range(2**len... |
s317201463 | p03829 | u093843560 | 1484537893 | Python | Python (2.7.6) | py | Runtime Error | 143 | 15376 | 528 | N,A,B = map(int,raw_input().split())
city = raw_input()
ci = city.split(" ")
path = []
for i in range(len(ci)-1):
z = int(ci[i+1])-int(ci[i])
path.append(z)
costa = []
def binary_encode(i, num_digits):
return np.array([i >> d & 1 for d in range(num_digits)])
for i in range(2**len(path)):
pc = bin... |
s711147056 | p03829 | u093843560 | 1484537798 | Python | Python (2.7.6) | py | Runtime Error | 664 | 22824 | 549 | import numpy as np
N,A,B = map(int,raw_input().split())
city = raw_input()
ci = city.split(" ")
path = []
for i in range(len(ci)-1):
z = int(ci[i+1])-int(ci[i])
path.append(z)
costa = []
def binary_encode(i, num_digits):
return np.array([i >> d & 1 for d in range(num_digits)])
for i in range(2**len... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.