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
s770547685
p03796
u318165580
1565803997
Python
Python (3.4.3)
py
Runtime Error
18
2940
61
import math a=int(input()) print(math.factional(a)%(10**9+7))
s653536916
p03796
u946424121
1565668148
Python
Python (3.4.3)
py
Runtime Error
17
2940
99
n = int(input()) prod = 1 for i in range(1,n+1): prod *= i ans = ans%(10**9+7) print(ans)
s089024685
p03796
u360515075
1565632301
Python
Python (3.4.3)
py
Runtime Error
20
2940
66
import math N = int(input()) print (factorial(N) % (10 ** 9 + 7))
s719875692
p03796
u903082918
1565614626
Python
Python (3.4.3)
py
Runtime Error
17
2940
236
_n = int(sys.stdin.readline()) # N! = aH + b # (N+1) * N! = aH(N+1) + b(N+1) # = aH(N+1) + int(b(N+1)/H) * H + b(N+1) % H result = reduce(lambda a, n: (a * n) % H, range(1, _n + 1), 1) print(result)
s164548178
p03796
u045408189
1565487598
Python
Python (3.4.3)
py
Runtime Error
17
2940
52
a=int(input()) import math print(math.fractional(a))
s578151275
p03796
u158778550
1565374260
Python
Python (3.4.3)
py
Runtime Error
18
2940
66
import math n = int(input()) print(math.factrial(n) % (10^9 + 7))
s666278551
p03796
u695079172
1564961146
Python
Python (3.4.3)
py
Runtime Error
18
2940
160
n = int(input()) temp = 1 for i in range(1,n+1): temp = temp + i temp = temp % (10**10) print(int(temp % (10 ** 9 + 7)))
s581832068
p03796
u695079172
1564960813
Python
Python (3.4.3)
py
Runtime Error
17
2940
83
n = int(input()) temp = 1 for i in range(1,n+1): temp = temp * i print(temp)
s912182976
p03796
u896741788
1564442650
Python
Python (3.4.3)
py
Runtime Error
17
2940
59
import math a=int(input()) print(math.factrial(a)%(10*9+7))
s524049734
p03796
u369338402
1564362931
Python
Python (3.4.3)
py
Runtime Error
17
2940
79
n=input() power=1 for i in range(1,n+1): power=power*i print(power%(10**9+7))
s176660209
p03796
u888512581
1564074116
Python
Python (3.4.3)
py
Runtime Error
41
2940
89
N = int(input()) p = 1 for i in range(1, N + 1): p *= i p = p % (10**9 + 7) prin
s508166770
p03796
u239342230
1563424254
Python
Python (3.4.3)
py
Runtime Error
224
89808
150
import sys sys.setrecursionlimit(10**5) N=int(input()) MOD=10**9+7 def seki(x): if x<2: return 1 else: return x*seki(x-1)%MOD print(seki(N)%MOD)
s444783621
p03796
u174509352
1563156764
Python
Python (3.4.3)
py
Runtime Error
17
2940
417
#include<bits/stdc++.h> #define rep(i,n) for(int (i) = 0;(i) < (n);(i)++) #define SORT(c) sort((c).begin(),(c).end()) #define INF 1000000007 //S.size() using namespace std; typedef vector<int> VI; typedef vector<string> VS; typedef vector<char> VC; typedef vector<bool> VB; typedef unsigned long long ll; int main(void){ int N; cin>>N; ll num = 1; for(ll i = 1; i <= N; i++)num *= i; cout<<num % INF; }
s501546625
p03796
u062459048
1560653983
Python
Python (3.4.3)
py
Runtime Error
2103
3460
84
n = int(input()) p = 1 for i in range(1,n+1): p = p*i ap = p/1000000007 print(ap)
s304222408
p03796
u062459048
1560653804
Python
Python (3.4.3)
py
Runtime Error
299
3060
83
n = int(input()) p = 1 for i in range(n): p = p*2^i ap = p/(1000000007) print(ap)
s734269331
p03796
u371409687
1560553748
Python
Python (3.4.3)
py
Runtime Error
17
2940
60
import math N=int(input()) print(math.factorial(N)%(10**9+7)
s291206899
p03796
u247554097
1560393972
Python
PyPy3 (2.4.0)
py
Runtime Error
169
38256
246
# sはありったけ使うほうがいい(cから作るとコストがかかる) # ありったけ = m//2 # 残ったcからsccを作るには4つ必要 n, m = map(int, input().split()) c = min(n, m // 2) c += max(0, (m-2*n) // 4) print(c)
s509770349
p03796
u778814286
1559866201
Python
Python (3.4.3)
py
Runtime Error
18
2940
102
n = int(input()) mod = 10**9 + 7 ans = 1 for i in range(1, N+1): ans = (ans * i) % mod print(ans)
s866339439
p03796
u083668616
1559677611
Python
PyPy3 (2.4.0)
py
Runtime Error
170
38256
88
N = int(input()) ans = 1 for i in range(1, N+1): ans = (ans * i) % 1000000007 print ans
s342511161
p03796
u221841077
1559501693
Python
Python (3.4.3)
py
Runtime Error
17
2940
85
N = int(input()) pow = 1 for i in range(1,N+1): pow = pow*i10**9+7 print(pow)
s792510866
p03796
u399721252
1559422068
Python
Python (3.4.3)
py
Runtime Error
17
2940
94
n = int(input()) power = 1 mod = 10**9+7 for i in range(n): p = (p * (i+1)) % mod print(p)
s702935446
p03796
u623687794
1559418656
Python
Python (3.4.3)
py
Runtime Error
74
3944
137
x=int(input()) def factorial(n): a=1 if n==1: return a else: a= n*factorial(n-1) return a%(10**9+7) print(factorial(x))
s141088788
p03796
u623687794
1559418573
Python
Python (3.4.3)
py
Runtime Error
2107
95356
178
import sys sys.setrecursionlimit(100000) x=int(input()) def factorial(n): a=1 if n==1: return a else: a= n*factorial(n-1) return a print(factorial(x)%(10**9+7))
s302075046
p03796
u623687794
1559418287
Python
Python (3.4.3)
py
Runtime Error
73
3940
138
x=int(input()) def factorial(n): a=1 if n==1: return a else: a= n*factorial(n-1) return a print(factorial(x)%(10**9+7))
s526487862
p03796
u623687794
1559417959
Python
Python (3.4.3)
py
Runtime Error
17
2940
108
def factorial(n): a=1 if n==1: return a else: a*= factorial(n-1) return a print(a/(10**9+7))
s151734411
p03796
u463655976
1559382389
Python
PyPy3 (2.4.0)
py
Runtime Error
2113
133256
130
def fraction(N): w = N for x in range(1, N): w *= x return w print("{:.0f}".format(fraction(int(input())) % (1e9 + 7)))
s059871126
p03796
u463655976
1559382292
Python
Python (3.4.3)
py
Runtime Error
2104
3460
130
def fraction(N): w = N for x in range(1, N): w *= x return w print("{:.0f}".format(fraction(int(input())) % (1e9 + 7)))
s992254772
p03796
u463655976
1559382093
Python
Python (3.4.3)
py
Runtime Error
2104
3460
113
def fraction(N): w = N for x in range(1, N): w *= x return w print(fraction(int(input())) % (1e9 + 7))
s127863110
p03796
u463655976
1559381959
Python
Python (3.4.3)
py
Runtime Error
75
3884
122
def fraction(N): if N <= 1: return 1 else: return N * fraction(N-1) print(fraction(int(input())) % (1e9 + 7))
s382668962
p03796
u463655976
1559381899
Python
Python (3.4.3)
py
Runtime Error
73
3884
110
def fraction(N): if N <= 1: return 1 else: return N * fraction(N-1) print(fraction(int(input())))
s210956357
p03796
u161271485
1559351737
Python
Python (3.4.3)
py
Runtime Error
82
11700
218
import sys sys.setrecursionlimit(10000) def kaijo(N): if N == 1: return 1 else: return N * kaijo(N-1) if __name__ == '__main__': n = int(input().strip()) print(kaijo(n) % (10**9 + 7))
s593912646
p03796
u161271485
1559351632
Python
Python (3.4.3)
py
Runtime Error
73
3892
176
def kaijo(N): if N == 1: return 1 else: return N * kaijo(N-1) if __name__ == '__main__': n = int(input().strip()) print(kaijo(n) % (10**9 + 7))
s317034737
p03796
u651803486
1559080186
Python
Python (3.4.3)
py
Runtime Error
2104
3464
95
n = int(input()) total = 1 for i in range(1, n+1): total *= i print(total / (10**9 + 7))
s821297712
p03796
u933341648
1558977937
Python
Python (3.4.3)
py
Runtime Error
17
2940
95
n = int(input()) ans = 1 for i in range(n): ans *= i + 1 asn %= (10**9 + 7) print(ans)
s293049328
p03796
u483645888
1557857017
Python
Python (3.4.3)
py
Runtime Error
73
3884
97
n = int(input()) mod = 10**9+7 def Fac(x): return x*Fac(x-1)%mod if x != 0 else 1 print(Fac(n))
s577375165
p03796
u483645888
1557856907
Python
Python (3.4.3)
py
Runtime Error
77
3888
97
n = int(input()) mod = 10**9+7 def Fac(x): return x*Fac(x-1) if x != 0 else 1 print(Fac(n)%mod)
s852419090
p03796
u856169020
1557774296
Python
Python (3.4.3)
py
Runtime Error
2104
3464
92
N = int(input()) power = 1 for i in range(N): power *= i+1 print(power / (pow(10, 9) + 7))
s845885015
p03796
u209918867
1557650599
Python
Python (3.4.3)
py
Runtime Error
229
4020
55
import math;print(math.factorial(int(input()))%(7+1e9))
s542604240
p03796
u240230402
1557638355
Python
Python (3.4.3)
py
Runtime Error
18
2940
90
N=int(input()) r = 10**9+7 power=1 for i in range(n): power=power*(i+1)%r print(power)
s318519611
p03796
u581187895
1557572395
Python
Python (3.4.3)
py
Runtime Error
231
3984
78
import math n = int(input()) ans = math.factorial(n) % (1e9+7) print(int(ans))
s085990014
p03796
u581187895
1557572348
Python
Python (3.4.3)
py
Runtime Error
229
4024
63
import math n = int(input()) print(math.factorial(n) % (1e9+7))
s391320987
p03796
u279229189
1557172259
Python
Python (3.4.3)
py
Runtime Error
2104
3468
108
N = int(input()) power = 1 for i in range(1, N + 1, 1): power = i * power print(power / (10 ** 9 + 7))
s088113875
p03796
u279229189
1557172155
Python
Python (3.4.3)
py
Runtime Error
2104
3460
137
N = int(input()) for i in range(1, N + 1, 1): if i == 1: power = i else: power = i * power print(power / (10 ** 9 + 7))
s157772788
p03796
u802772880
1557085548
Python
Python (3.4.3)
py
Runtime Error
17
2940
142
import math n=int(input()) print(math.factorial(n)%(1e9+7))n=int(input()) ans=1 for i in range(1,n+1): ans=(ans*i)%(1e9+7) print(int(ans))
s800609894
p03796
u802772880
1557085469
Python
Python (3.4.3)
py
Runtime Error
17
2940
137
import math n=int(input()) print(math.factorial(n)%(1e9+7))n=int(input()) ans=1 for i in range(1,n+1): ans=(ans*i)%(1e9+7) print(ans)
s598600816
p03796
u902468164
1556215330
Python
Python (3.4.3)
py
Runtime Error
18
2940
113
res = 1 for i in range(1, n+1): res *= i if res > 10**9+7: res %= 10 ** 9+7 print(res%(10**9+7))
s872336120
p03796
u771532493
1555466012
Python
Python (3.4.3)
py
Runtime Error
17
2940
83
n,m=map(int,input().split()) a=m//2 if n>a: print(a) else: print((n+a)//2)
s557446789
p03796
u371467115
1555170599
Python
Python (3.4.3)
py
Runtime Error
2104
3460
76
n=int(input()) ans=1 for i in range(1,n+1): ans=ans*i print(ans/(10**9+7))
s761055319
p03796
u300269535
1554953072
Python
Python (3.4.3)
py
Runtime Error
17
2940
122
n = int(input()) power = 1 for i in range(n): power = power + (i+1)%1000000007 power %= %1000000007 print(power)
s094484147
p03796
u544050502
1554927273
Python
Python (3.4.3)
py
Runtime Error
230
3972
61
import math N=int(input()) print(math.factorial(N)/(10**9+7))
s610755080
p03796
u588081069
1553707070
Python
Python (3.4.3)
py
Runtime Error
17
2940
115
N = int(input()) power = 1 mod = 10 ** 9 + 7 for i in range(1, N + 1): power *= i power %= mod print(power)
s579451258
p03796
u518042385
1553274542
Python
Python (3.4.3)
py
Runtime Error
18
2940
65
n=int(input()) inport math m=math.factorial(n) print(m%(10**9+7))
s521458909
p03796
u782654209
1553111638
Python
Python (3.4.3)
py
Runtime Error
18
2940
46
import math print(math.factorial(N)%(10**9+7))
s929560257
p03796
u729133443
1552976153
Python
Python (3.4.3)
py
Runtime Error
229
4020
55
import math;print(math.factorial(int(input()))%(1e9+7))
s643799672
p03796
u544050502
1551755467
Python
Python (3.4.3)
py
Runtime Error
230
3976
64
import math N=int(input()) print(int(math.factorial(N)%(7+1e9)))
s125784903
p03796
u544050502
1551755297
Python
Python (3.4.3)
py
Runtime Error
230
3972
59
import math N=int(input()) print(math.factorial(N)%(7+1e9))
s714981318
p03796
u544050502
1551755028
Python
Python (3.4.3)
py
Runtime Error
18
2940
58
import math N=int(input()) print(math.factorial(N)%(7+1e9)
s240448318
p03796
u544050502
1551754928
Python
Python (3.4.3)
py
Runtime Error
17
2940
68
from math import factorial N=int(input()) print(factorial(N)%(7+1e9)
s131424350
p03796
u962819039
1551554274
Python
Python (3.4.3)
py
Runtime Error
2104
3360
143
n = int(input()) ans = 1 for i in range(1, n + 1): ans *= i if ans >= (10 ** 9 + 7): ans = ans - (10 ** 9 + 7) print(p % (10 ** 9 + 7))
s409100583
p03796
u301302814
1551463538
Python
Python (3.4.3)
py
Runtime Error
18
2940
119
# coding: utf-8 div = 10 ** 9 + 7 n = int(input()) ans = 1 for i in range(1, N + 1): ans = (ans * i) % div print(ans)
s996014920
p03796
u367130284
1550380968
Python
Python (3.4.3)
py
Runtime Error
17
2940
69
from math import fractorial;print(fractorial(int(input()))%(10**9+7))
s399436431
p03796
u592248346
1549983279
Python
Python (3.4.3)
py
Runtime Error
18
2940
54
import math n = int(input()) actorial(n) % (10**9+7))
s124168069
p03796
u225482186
1549316785
Python
Python (3.4.3)
py
Runtime Error
2106
89804
187
import sys sys.setrecursionlimit(100000) n = int(input()) def train(n): if n == 1: return 1 else: return n * train(n-1) ans = train(n) % (10**9 + 7) print(ans)
s388183474
p03796
u928784113
1545229824
Python
Python (3.4.3)
py
Runtime Error
75
3896
166
# -*- coding: utf-8 -*- N = int(input()) def fact(n): if n == 0: return 1 elif n == 1: return 1 else: return fact(n-1)*n print(fact(N) % (10**9 +7))
s644575758
p03796
u111365959
1542984188
Python
Python (3.4.3)
py
Runtime Error
19
2940
69
import math n = int(input()) print(math.factorical(n) % (10**9 + 7))
s291678346
p03796
u111365959
1542984151
Python
Python (3.4.3)
py
Runtime Error
17
2940
66
import math n = gets.to_i print(math.factorical(n) % (10**9 + 7))
s936526435
p03796
u923279197
1540597850
Python
Python (3.4.3)
py
Runtime Error
73
3940
123
def k(n): mod =1000000007 if n==1: return 1 else: return (n*k(n-1))%mod print(k(int(input())))
s681322866
p03796
u320325426
1538777100
Python
Python (3.4.3)
py
Runtime Error
17
2940
84
x, i = 1, 1 while i <= int(input()): x = (x * i) % (10 ** 9 + 7) i += 1 print(x)
s167337339
p03796
u333768710
1538596936
Python
Python (3.4.3)
py
Runtime Error
38
2940
177
mod = 1000000007 n = int(input()) factorial_previous = 1 for i in range(2,n+1): factorial = (i*factorial_previous)%mod factorial_previous = factorial print(factorial)
s747206105
p03796
u362560965
1535161214
Python
Python (3.4.3)
py
Runtime Error
41
2940
102
N = int(input()) power = 1 for i in range(1,N+1): power *= i power %= (10**9 + 7) print(ans)
s830244205
p03796
u277802731
1534282583
Python
Python (3.4.3)
py
Runtime Error
2104
3460
81
#55b n = int(input()) p=1 for i in range(1,n+1): p = p*i print(a%(10**9+7))
s963980080
p03796
u277802731
1534282524
Python
Python (3.4.3)
py
Runtime Error
2104
3460
77
#55b n=int(input()) p=1 for i in range(1,n+1): p = p*i print(a%(10**9+7))
s452038724
p03796
u698479721
1530735095
Python
Python (3.4.3)
py
Runtime Error
73
3912
116
N = int(input()) import math def s(n): if n == 1: return 1 else: return (n*s(n-1))%(10**9+7) print(s(N))
s860951988
p03796
u024804656
1529101936
Python
Python (3.4.3)
py
Runtime Error
17
3064
821
s = input().split() h = int(s[0]) w = int(s[1]) s = [] for i in range(h): s.append(input()) for i in range(h): row = '' for j in range(w): cnt = 0 if s[i][j] == '#': row += '#' continue if i > 0 and j > 0 and s[i-1][j-1] == '#': cnt += 1 if i > 0 and s[i-1][j] == '#': cnt += 1 if i > 0 and j < w - 1 and s[i-1][j+1] == '#': cnt += 1 if j > 0 and s[i][j-1] == '#': cnt += 1 if j < w - 1 and s[i][j+1] == '#': cnt += 1 if i < h - 1 and s[i+1][j-1] == '#': cnt += 1 if i < h - 1 and s[i+1][j] == '#': cnt += 1 if i < h - 1 and j < w - 1 and s[i+1][j+1] == '#': cnt += 1 row += str(cnt) print(row)
s952498652
p03796
u102126195
1525712015
Python
Python (3.4.3)
py
Runtime Error
17
2940
81
N = int(input()) p = 1 for i in range(1, N ; 1): p *= i print(p % 1000000007)
s168741062
p03796
u019584841
1519571404
Python
Python (3.4.3)
py
Runtime Error
17
2940
64
n=int(input()) for i in range(1,n+1): m*=i print(m%1000000007)
s343520280
p03796
u350179603
1515952732
Python
Python (3.4.3)
py
Runtime Error
17
2940
113
w, a, b = map(int, input().split()) if b >= a+w: print(b-a-w) elif b+w<= a: print(a-b-w) else: print(0)
s299005459
p03796
u943004959
1513135240
Python
Python (3.4.3)
py
Runtime Error
17
2940
48
N = int(input()) print(math.factorial(N) % MOD)
s523890944
p03796
u943004959
1513121660
Python
Python (3.4.3)
py
Runtime Error
232
4088
92
import math def solve(): N = int(input()) print(math.factorial(N) % MOD) solve()
s405759480
p03796
u943004959
1513121555
Python
Python (3.4.3)
py
Runtime Error
228
3980
87
import math def solve(): print(math.factorial(int(input())) % MOD) solve()
s643006500
p03796
u243370518
1503613417
Python
Python (3.4.3)
py
Runtime Error
73
3884
156
def factorial(n): if n==1: return 1 else: return n * factorial(n-1) x = int(input()) div = pow(10,9) - 7 print(factorial(x) % div)
s388152982
p03796
u676264453
1499993053
Python
Python (3.4.3)
py
Runtime Error
17
2940
161
def imp_kai(n): ac = 1 for i in range(n): ac *= i + 1 ac = ac % (1e9 + 7) return ac % (1e9 + 7) - n = int(input()) print(imp_kai(n))
s479532887
p03796
u676264453
1499722798
Python
Python (3.4.3)
py
Runtime Error
72
3880
116
def kai(n): if (n == 1): return 1 else: return n * kai(n-1) % (1e9 + 7) n = int(input()) print(kai(n))
s232941673
p03796
u351527281
1497582672
Python
Python (3.4.3)
py
Runtime Error
2104
3464
94
N = int(input()) total = 1 for i in range(1,N+1): total *= i print(int(total/(10**9 + 7)))
s682538537
p03796
u116142267
1497129247
Python
Python (3.4.3)
py
Runtime Error
71
3896
129
def solve(n): if n==0: return 1 else: return n*solve(n-1) N = int(input()) print(solve(N)%(10**9+7))
s262266873
p03796
u116142267
1497128967
Python
Python (3.4.3)
py
Runtime Error
71
3896
129
def solve(n): if n==0: return 1 else: return n*solve(n-1) N = int(input()) print(solve(N)%(10**9+7))
s814858969
p03796
u918009437
1489373611
Python
Python (3.4.3)
py
Runtime Error
440
4364
110
import math N = int(input()) fn = math.factorial(N) ans = int(math.factorial(N)%(math.pow(10,9)+7)) print(ans)
s978503928
p03796
u522002538
1488909303
Python
Python (2.7.6)
py
Runtime Error
12
2568
84
m = 1 for var in range(int(raw_input) + 1): m = m * var + 1 print(m%1000000000*+7)
s669673792
p03796
u522002538
1488909276
Python
Python (2.7.6)
py
Runtime Error
10
2568
83
m = 1 for var in range(int(raw_input) + 1): m = m * var + 1 print(m%1000000000*+7)
s395642974
p03796
u803848678
1488863345
Python
Python (3.4.3)
py
Runtime Error
17
2940
112
N = int(input()) ans = 1 for i in range(N): ans = ans * (i + 1) % (10**9 + 7) print(ans)
s556333893
p03796
u803848678
1488860947
Python
Python (3.4.3)
py
Runtime Error
17
2940
91
N = int(input()) ans = 1 for i in range(N) ans = ans * (i + 1) % (10**9 + 7) print(ans)
s489234585
p03796
u377301040
1488718302
Python
Python (2.7.6)
py
Runtime Error
10
2568
153
#include <iostream> using namespace std; int N; int main() { scanf("%d", &N); int q = N/15; printf("%d\n", 800*N - 200*q); return 0; }
s046193212
p03796
u247781603
1488681485
Python
Python (3.4.3)
py
Runtime Error
17
2940
110
input_len = input() ans = 1 for i in range(1, input_len+1): ans *= i ans = ans % (10 ** 9) + 7 print(ans)
s906017083
p03796
u590905793
1487826523
Python
Python (3.4.3)
py
Runtime Error
18
2940
90
N = int(input()) power = 1 for i in range(1,N+1): power = (i * power % P) print(power)
s032307572
p03796
u805887876
1487796315
Python
Python (2.7.6)
py
Runtime Error
10
2568
114
s,c = map(int, raw_input().split()) scc = 0 if s*2 <= c: scc = s c -= s*2 else: scc = c/2 print scc + c/4
s535407792
p03796
u805887876
1487791306
Python
Python (2.7.6)
py
Runtime Error
2103
3140
96
import math n = int(raw_input()) print '{:d}'.format(math.factorial(n) % (math.pow(10,9) + 7))
s562999111
p03796
u805887876
1487791087
Python
Python (2.7.6)
py
Runtime Error
2103
3148
81
import math n = int(raw_input()) print math.factorial(n) % (math.pow(10,9) + 7)
s504496643
p03796
u327543932
1487682809
Python
Python (2.7.6)
py
Runtime Error
24
4240
182
n=input() a=[0]*(n+1) def P(n): if n==1: return 1 elif a[n]!=0: return (a[n]) else: a[n]=P(n-1)*n return (a[n]) print (int(P(n)%(1e9 +7)))
s861113967
p03796
u327543932
1487651009
Python
Python (2.7.6)
py
Runtime Error
24
4244
182
n=input() a=[0]*(n+1) def P(n): if n==1: return 1 elif a[n]!=0: return (a[n]) else: a[n]=P(n-1)*n return (a[n]) print (int(P(n)%(1e9 +7)))
s963010593
p03796
u631914718
1487479512
Python
Python (3.4.3)
py
Runtime Error
256
114108
238
n = int(input()) import sys sys.setrecursionlimit(100000) def fa(n, memo=dict()): if n==0 or n == 1: return 1 elif n in memo.keys(): return memo[n] else: temp = fa(n-1)*n %int(10**9+7) memo[n] = temp return temp print(fa(n))