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 int64 0 100 | memory stringlengths 4 6 | code_size int64 15 14.7k | code stringlengths 15 14.7k | problem_id stringlengths 6 6 | problem_description stringlengths 358 9.83k | input stringlengths 2 4.87k | output stringclasses 807
values | __index_level_0__ int64 1.1k 1.22M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s130099762 | p02233 | u300329459 | 1590647979 | Python | Python3 | py | Accepted | 20 | 5600 | 322 | def fina(n, fina_list):
if n <= 1:
fina_list[n] = 1
return fina_list[n]
elif fina_list[n]:
return fina_list[n]
else:
fina_list[n] = fina(n-1, fina_list) + fina(n-2, fina_list)
return fina_list[n]
n = int(input())
fina_list = [None]*(n + 1)
print(fina(n, fina_list))... | p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,282 |
s979365532 | p02233 | u153034461 | 1590599457 | Python | Python3 | py | Accepted | 40 | 14100 | 283 | import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
n = int(input())
dp = [0]*(1000001)
dp[0] = 1
dp[1] = 1
for i in range(2,n+1):
dp[i] = dp[i-1] + dp[i-2]
print(dp[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,283 |
s675531716 | p02233 | u430457144 | 1590597194 | Python | Python3 | py | Accepted | 20 | 5600 | 113 | N = int(input())
dp = [1] * (N + 1)
for n in range(2, N + 1):
dp[n] = dp[n - 1] + dp[n - 2]
print(dp[N])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,284 |
s321748253 | p02233 | u838372139 | 1590588401 | Python | Python3 | py | Accepted | 30 | 5600 | 115 | N=int(input())
dp=[0]*(N+1)
dp[0]=1
dp[1]=1
for i in range(2,N+1):
dp[i]=dp[i-1]+dp[i-2]
ans=dp[N]
print(ans)
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,285 |
s440457971 | p02233 | u904289400 | 1590506002 | Python | Python3 | py | Accepted | 30 | 6292 | 179 | from functools import lru_cache
@lru_cache(maxsize=None)
def fib(n):
if n==0 or n==1:
return 1
else:
return fib(n-1)+fib(n-2)
n=int(input())
print(fib(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,286 |
s862227778 | p02233 | u256637043 | 1590493717 | Python | Python3 | py | Accepted | 20 | 5600 | 238 | # ALDS1_10_A.py
N = int(input())
fib_list = [0]*(N+1)
def fib(n):
if n<=1:
fib_list[n] = 1
else:
if fib_list[n] == 0:
fib_list[n] = fib(n-1) + fib(n-2)
return fib_list[n]
fib(N)
print(fib_list[N])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,287 |
s015804201 | p02233 | u128671689 | 1590455046 | Python | Python3 | py | Accepted | 20 | 5600 | 135 | def f(n):
f=[1,1]
for i in range(2,n):
f.append(f[i-2]+f[i-1])
return f[n-1]
n=int(input())
print(f(n+1))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,288 |
s165423860 | p02233 | u511744190 | 1590454524 | Python | Python3 | py | Accepted | 20 | 5600 | 134 | def fib(n):
x=[1,1]
for i in range(n+1):
y=x[i]+x[i+1]
x.append(y)
print(x[n])
a=int(input())
fib(a)
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,289 |
s469878071 | p02233 | u753534330 | 1590402070 | Python | Python3 | py | Accepted | 20 | 5588 | 207 | n = int(input())
a0 = 1
a1 = 1
#print(a0, a1, end='')
if n == 0 or n == 1:
a2 = 1
else:
for i in range(n-1):
a2 = a0 + a1
a0 = a1
a1 = a2
#print('',a2,end='')
print(a2)
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,290 |
s403356048 | p02233 | u177648086 | 1590392321 | Python | Python3 | py | Accepted | 30 | 5600 | 159 | n=int(input())
a=[1,1]
def fib(n):
if n <= 1:
return a[n]
for i in range(2,n+1):
a.append(a[i-1]+a[i-2])
return a[n]
print(fib(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,291 |
s728374319 | p02233 | u577978368 | 1590385850 | Python | Python3 | py | Accepted | 20 | 5608 | 244 | def fib(n,memo={}):
if n == 0:
return 1
elif n == 1:
return 1
elif n in memo:
return memo[n]
else:
memo[n]=fib(n-1,memo)+fib(n-2,memo)
return memo[n]
a=int(input())
print(fib(a))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,292 |
s922937959 | p02233 | u470391435 | 1590383758 | Python | Python3 | py | Accepted | 20 | 5600 | 176 | n = int(input())
def fib(x):
lst=[1,1]
for i in range(x-1):
z = len(lst)
y = int(lst[z-2])+int(lst[z-1])
lst.append(y)
print(lst[x])
fib(n)
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,293 |
s343957879 | p02233 | u144723565 | 1590367560 | Python | Python3 | py | Accepted | 20 | 5608 | 322 | n = int(input())
def fib(n):
dp = [0] * (n+1)
dp[0] = 1
dp[1] = 1
def fib_sub(n):
if dp[n] != 0:
return dp[n]
fibn1 = fib_sub(n-1)
fibn2 = fib_sub(n-2)
dp[n-1] = fibn1
dp[n-2] = fibn2
return fibn1 + fibn2
return fib_sub(n)
print(fib(n))... | p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,294 |
s136486112 | p02233 | u994684803 | 1590333170 | Python | Python3 | py | Accepted | 20 | 5604 | 140 | fib = [0 for i in range(45)]
fib[0] = 1
fib[1] = 1
for i in range(2, 45):
fib[i] = fib[i - 1] + fib[i - 2]
n = int(input())
print(fib[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,295 |
s903242634 | p02233 | u235534975 | 1590328470 | Python | Python3 | py | Accepted | 20 | 5600 | 195 | n = int(input())
F = [0]*(n+1)
if n == 0:
print(1)
elif n==1:
print(1)
elif n > 1:
F[0] = 1
F[1] = 1
for i in range(2,n+1):
F[i] = F[i-1] + F[i-2]
print(F[-1])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,296 |
s606833607 | p02233 | u560996731 | 1590318845 | Python | Python3 | py | Accepted | 20 | 5600 | 186 | n = int(input())
dp = [0]*(45)
dp[0] = 1
dp[1] = 1
def fib(i):
j = 2
while j <= i:
if j >= 2:
dp[j] = dp[j-1] + dp[j-2]
j += 1
fib(n)
print(dp[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,297 |
s476362414 | p02233 | u420091741 | 1590306996 | Python | Python3 | py | Accepted | 20 | 5604 | 257 | import sys
if __name__ == "__main__":
n = int(input())
if n == 0 or n == 1:
print(1)
sys.exit(0)
dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1
for i in range(2, n + 1):
dp[i] = dp[i - 1] + dp[i - 2]
print(dp[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,298 |
s017960745 | p02233 | u286298310 | 1590305196 | Python | Python3 | py | Accepted | 20 | 5600 | 285 | F = [0 for i in range(50)]
F[0] = 1
F[1] = 1
def fib(n) :
if n == 0 or n == 1:
F[n] = 1
return F[n]
else:
if F[n] == 0:
F[n] = fib(n-1) + fib(n-2)
return F[n]
else:
return F[n]
n = int(input())
print(fib(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,299 |
s190282283 | p02233 | u767630905 | 1590217471 | Python | Python3 | py | Accepted | 20 | 5600 | 100 | n = int(input())
dp = [1] * (50)
for i in range(n):
dp[i + 2] = dp[i + 1] + dp[i]
print(dp[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,300 |
s367034067 | p02233 | u208184442 | 1590060679 | Python | Python3 | py | Accepted | 20 | 5596 | 130 | n = int(input())
fib = [-1] * (n+1)
fib[0] = 1
fib[1] = 1
for i in range(2,n+1):
fib[i] = fib[i-1] + fib[i-2]
print(fib[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,301 |
s588995127 | p02233 | u945415253 | 1590044373 | Python | Python3 | py | Accepted | 20 | 5596 | 285 | def fibonacci_dp(n,lf):
if n == 0 or n == 1:
return lf[n]
if n < len(lf):
return lf[n]
lf.insert(n,fibonacci_dp(n-2,lf) + fibonacci_dp(n-1,lf))
return lf[n]
if __name__ == "__main__":
n = int(input())
lf = [1,1,]
print(fibonacci_dp(n,lf))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,302 |
s962826000 | p02233 | u228556128 | 1590022526 | Python | Python3 | py | Accepted | 20 | 5600 | 106 | n=int(input())
fib=[1,1]
for i in range(2,n+1):
a=fib[i-1]+fib[i-2]
fib.append(a)
print(fib[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,303 |
s597002071 | p02233 | u322947441 | 1590018556 | Python | Python3 | py | Accepted | 20 | 5592 | 173 | n = int(input())
n1 = 1
n2 = 1
result = 0
if n < 2:
result = 1
else:
for i in range(n-1):
result = n1 + n2
n2 = n1
n1 = result
print(result)
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,304 |
s124305667 | p02233 | u705625724 | 1589971046 | Python | Python3 | py | Accepted | 20 | 5604 | 177 | # coding: utf-8
# 40
n = int(input())
a = int(0)
b = int(1)
if n==1:
A = b
elif n==2:
A = 2
else:
for i in range(n):
a,b = b,a+b
A = b
print(A)
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,305 |
s284830938 | p02233 | u421290920 | 1589962964 | Python | Python3 | py | Accepted | 30 | 6292 | 182 | from functools import lru_cache
@lru_cache()
def fib(n:int):
if n == 0 or n == 1:
return 1
else:
return fib(n-1) + fib(n-2)
n = int(input())
print(fib(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,306 |
s471400653 | p02233 | u895962529 | 1589880360 | Python | Python3 | py | Accepted | 20 | 5600 | 98 | a=[0]*45
a[0]=1
a[1]=1
for i in range(2,45):
a[i]=a[i-1]+a[i-2]
n=int(input())
print(a[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,307 |
s387210683 | p02233 | u526434091 | 1589875047 | Python | Python3 | py | Accepted | 20 | 5600 | 468 |
fibo = [0] * 45
N = int(input())
fibo[0] = 1
fibo[1] = 1
for i in range(2,N+1):
fibo[i] = fibo[i-1]+fibo[i-2]
print(fibo[N])
# N = int(input())ใๅๅธฐใฎใฟ
# def fibo(n):
# if n == 0 or n == 1:
# return 1
# return fibo(n-1)+fibo(n-2)
# print(fibo(N))
# N = int(input()) ใกใขๅๅๅธฐใ5596KB 635B
# def fibo(n):
#... | p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,308 |
s405950050 | p02233 | u288578617 | 1589847427 | Python | Python3 | py | Accepted | 20 | 5596 | 74 | n=int(input())
x, y=0, 1
for i in range(1, n+1):
x, y=y, x+y
print(y)
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,309 |
s320337647 | p02233 | u140569607 | 1589783502 | Python | Python3 | py | Accepted | 20 | 5596 | 104 | n = int(input())
fib = [1, 1]
for i in range(2, n+1):
fib.append(fib[i-1] + fib[i-2])
print(fib[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,310 |
s128214801 | p02233 | u124936061 | 1589746370 | Python | Python3 | py | Accepted | 20 | 5600 | 95 | n = int(input())
a = [1, 1]
for i in range(2, n+1):
a.append(a[i-1] + a[i-2])
print(a[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,311 |
s014097671 | p02233 | u652807546 | 1589708251 | Python | Python3 | py | Accepted | 20 | 5620 | 317 | memo = {}
def fib(n):
"""
:param n: non-negative integer
:return: n-th fibonacci number
"""
if n == 0 or n == 1:
return 1
try:
return memo[n]
except KeyError:
pass
res = fib(n-1) + fib(n-2)
memo[n] = res
return res
n = int(input())
print(fib(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,312 |
s947895277 | p02233 | u435414815 | 1589637737 | Python | Python3 | py | Accepted | 20 | 5588 | 183 | x=int(input())
if x == 0 or x == 1 : print("1")
else :
i=0
b=1
c=1
while i<(x-1) :
d=b+c
c=b
b=d
i=i+1
print(b)
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,313 |
s772601459 | p02233 | u747915832 | 1589630862 | Python | Python3 | py | Accepted | 20 | 5600 | 157 | n = int(input())
fib = []
for i in range(n+1):
if i <=1 :
fib.append(1)
if i > 1 :
fib.append( fib[i-2] + fib[i-1] )
print(fib[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,314 |
s511070555 | p02233 | u192469946 | 1589555981 | Python | Python3 | py | Accepted | 20 | 5600 | 235 | #1_10_A
n = int(input())
MEMO = [None] * (n + 1)
def Fib(i):
if i == 0 or i == 1:
return 1
if MEMO[i]:
return MEMO[i]
r = Fib(i-1) + Fib(i-2)
MEMO[i] = r
return r
print(Fib(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,315 |
s823879132 | p02233 | u253463111 | 1589534635 | Python | Python3 | py | Accepted | 20 | 5592 | 69 | n=int(input())
a=b=1
while range(n):
a,b=b,a+b
n-=1
print(a)
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,316 |
s468201416 | p02233 | u290304811 | 1589444079 | Python | Python3 | py | Accepted | 20 | 5600 | 127 | n = int(input())
fib = [1,1]
if n>=2:
for i in range(2,n+1):
fib.append(fib[i-1]+fib[i-2])
print(fib[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,317 |
s550897683 | p02233 | u758426656 | 1589439321 | Python | Python3 | py | Accepted | 20 | 5600 | 129 | n = int(input())
fib_b = [1,1]
if n > 1:
for i in range(2,n+1):
fib_b.append(fib_b[i-1]+fib_b[i-2])
print(fib_b[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,318 |
s422549938 | p02233 | u069607647 | 1589363830 | Python | Python3 | py | Accepted | 20 | 5604 | 384 | # http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_10_A&lang=ja
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
n = int(readline())
dp = [0] * (n+1)
dp[0] = 1
dp[1] = 1
for i in range(2,n+1):
dp[i] = dp[i-1] + dp[i-2... | p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,319 |
s312398858 | p02233 | u057249340 | 1589348900 | Python | Python3 | py | Accepted | 20 | 5600 | 153 | def fibn(n):
fib = [1,1]
for i in range(2,n+1):
fib.append(fib[i-2] + fib[i-1])
return fib[n]
x = int(input())
print(fibn(x))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,320 |
s241631139 | p02233 | u428671978 | 1589280518 | Python | Python3 | py | Accepted | 20 | 5600 | 290 | from sys import stdin
def main():
#ๅ
ฅๅ
readline=stdin.readline
n=int(readline())
dp=[0]*(n+1)
for i in range(n+1):
if i==0 or i==1:
dp[i]=1
else:
dp[i]=dp[i-1]+dp[i-2]
print(dp[n])
if __name__=="__main__":
main()
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,321 |
s131253536 | p02233 | u988962397 | 1589262536 | Python | Python3 | py | Accepted | 20 | 5596 | 77 | n=int(input())
a1=1
a=1
i=1
while i<n:
a1,a=a,a1+a
i+=1
print(a)
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,322 |
s960269381 | p02233 | u862272701 | 1589211976 | Python | Python3 | py | Accepted | 20 | 5600 | 214 | n = int(input())
def fib(i):
if i<=1:
return 1
else:
a, b = 0, 1
for i in range(n+1):
c = b + a
b = a
a = c
return c
print(fib(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,323 |
s075034879 | p02233 | u590535211 | 1589203127 | Python | Python3 | py | Accepted | 30 | 5600 | 215 | n = int(input())
memo = [-1]*(n+1)
memo[0] = 1
memo[1] = 1
def fib(n):
if memo[n] != -1:
return memo[n]
else:
ans = fib(n-1)+fib(n-2)
memo[n] = ans
return ans
print(fib(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,324 |
s651837382 | p02233 | u395654950 | 1589184608 | Python | Python3 | py | Accepted | 20 | 5612 | 256 | # coding: utf-8
# Your code here!
def fibo(n, memo = {}):
if n == 0 or n == 1:
return 1
elif n in memo:
return memo[n]
else:
memo[n] = fibo(n - 1, memo) + fibo(n - 2, memo)
return memo[n]
n = int(input())
print(fibo(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,325 |
s678661177 | p02233 | u583329397 | 1589117251 | Python | Python3 | py | Accepted | 20 | 5596 | 70 | n=int(input())
a=1
b=1
i=0
while i<n:
a,b=b,a+b
i+=1
print(a)
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,326 |
s881464756 | p02233 | u647921435 | 1589096153 | Python | Python3 | py | Accepted | 20 | 5600 | 224 | n=int(input())
MAX_N=n
MEMO = [None] * (MAX_N + 1)
def f(n):
if n==0:
return 1
if n==1:
return 1
if MEMO[n]:
return MEMO[n]
r=f(n-1)+f(n-2)
MEMO[n]=r
return r
print(f(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,327 |
s422875381 | p02233 | u145526353 | 1589090588 | Python | Python3 | py | Accepted | 20 | 5600 | 107 | n = int(input())
fib = [1, 1]
for i in range(2, n+1):
fib.append(fib[i-1] + fib[i-2])
print(fib[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,328 |
s433045722 | p02233 | u822971508 | 1589087864 | Python | Python3 | py | Accepted | 20 | 5616 | 321 | # -*- coding:utf-8 -*-
def solve():
import sys
N = int(sys.stdin.readline())
dp = [None]*45
dp[0], dp[1] = 1, 1
def fib(n):
if dp[n] is not None:
return dp[n]
dp[n] = fib(n-1) + fib(n-2)
return dp[n]
print(fib(N))
if __name__ == "__main__":
solve()
... | p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,329 |
s128248809 | p02233 | u350963229 | 1589010080 | Python | Python3 | py | Accepted | 20 | 5604 | 142 | fib = [0 for i in range(45)]
fib[0] = 1
fib[1] = 1
for i in range(2, 45):
fib[i] = fib[i - 1] + fib[i - 2]
a = int(input())
print(fib[a])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,330 |
s110088772 | p02233 | u789716290 | 1588942345 | Python | Python3 | py | Accepted | 20 | 5600 | 116 | n = int(input())
num = [1,1]
for i in range(2,45):
f = num[i - 1] + num[i - 2]
num.append(f)
print(num[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,331 |
s784726008 | p02233 | u984591045 | 1588901229 | Python | Python3 | py | Accepted | 20 | 5600 | 119 | n = int(input())
dp = [0]*(n+1)
dp[0] = dp[1] = 1
for i in range(2,n+1):
dp[i] = dp[i-1] + dp[i-2]
print(dp[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,332 |
s820501929 | p02233 | u481381669 | 1588897902 | Python | Python3 | py | Accepted | 20 | 5600 | 187 | MAX_N = 44
dp = [None] * (MAX_N + 1)
dp[0] = 1
dp[1] = 1
def fib(n):
for i in range(2, n+1):
dp[i] = dp[i-1] + dp[i-2]
return dp[n]
n = int(input())
print(fib(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,333 |
s416834348 | p02233 | u814278309 | 1588853124 | Python | Python3 | py | Accepted | 20 | 5600 | 151 | def fibn(n):
fib = [1,1]
for i in range(2,n+1):
fib.append(fib[i-2] + fib[i-1])
return fib[n]
n = int(input())
print(fibn(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,334 |
s006438176 | p02233 | u240091169 | 1588821561 | Python | Python3 | py | Accepted | 30 | 6292 | 217 | from functools import lru_cache
@lru_cache(maxsize=None)
def Fib(n) :
if n == 0 :
return 1
elif n == 1 :
return 1
else :
return Fib(n-1) + Fib(n-2)
N = int(input())
print(Fib(N))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,335 |
s407751183 | p02233 | u777962369 | 1588780675 | Python | Python3 | py | Accepted | 20 | 5600 | 164 | N = int(input())
def solve(N):
fib = [1]*(N+1)
for i in range(2,N+1):
fib[i] = fib[i-1] + fib[i-2]
ans = fib[N]
return ans
print(solve(N))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,336 |
s844593622 | p02233 | u668650835 | 1588754558 | Python | Python3 | py | Accepted | 20 | 5600 | 165 | n = int(input())
def fib(n):
if(n==0): return 1
elif(n==1): return 1
elif(n>1):
a,b = 1,1
for i in range(n-1):
a,b = b,a+b
return b
print(fib(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,337 |
s486823447 | p02233 | u848622255 | 1588529604 | Python | Python3 | py | Accepted | 10 | 5600 | 242 | def fib(n):
if n ==0 or n ==1:
return 1
dp = [0] * (n+1)
dp[0] = 1
dp[1] = 1
for i in range(2,n+1):
dp[i] += dp[i-1] + dp[i- 2]
return dp[n ]
# if __name__ == '__main__':
n=int(input())
print(fib(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,338 |
s172892641 | p02233 | u014861569 | 1588439045 | Python | Python3 | py | Accepted | 20 | 5600 | 90 | y=[1,1]
n=int(input())
for i in range(0,n):
a=y[i]+y[i+1]
y.append(a)
print(y[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,339 |
s990439992 | p02233 | u555063680 | 1588396195 | Python | Python3 | py | Accepted | 20 | 5600 | 122 | N = int(input())
dp = [0] * (N+1)
dp[0] = 1
dp[1] = 1
for i in range(2,N+1):
dp[i] = dp[i-1] + dp[i-2]
print(dp[N])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,340 |
s933788370 | p02233 | u411823106 | 1588340739 | Python | Python3 | py | Accepted | 20 | 5604 | 163 | import sys
n = int(sys.stdin.readline().strip())
fib = [0] * (n+1)
fib[0] = 1
fib[1] = 1
for i in range(2, n+1):
fib[i] = fib[i-1] + fib[i-2]
print(fib[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,341 |
s184536122 | p02233 | u486183171 | 1588234802 | Python | Python3 | py | Accepted | 20 | 5600 | 220 | N = int(input())
dp = [None] * (N + 1)
def fib(n):
if dp[n] != None:
return dp[n]
if n == 0 or n == 1:
dp[n] = 1
else:
dp[n] = fib(n - 2) + fib(n - 1)
return dp[n]
print(fib(N))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,342 |
s960142767 | p02233 | u037441960 | 1588063981 | Python | Python3 | py | Accepted | 20 | 5600 | 250 | n = int(input())
F = [0] * 45
def fib(n) :
if n == 0 or n == 1 :
return 1
else :
if F[n] != 0 :
return F[n]
else :
F[n] = fib(n - 1) + fib(n - 2)
return F[n]
print(fib(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,343 |
s748949217 | p02233 | u474356387 | 1587992867 | Python | Python3 | py | Accepted | 20 | 5600 | 228 | def fibonacci(n, l):
if n <= 1:
l[n] = 1
return l[n]
elif l[n] != 0:
return l[n]
else:
l[n] = fibonacci(n-1, l) + fibonacci(n-2, l)
return l[n]
n = int(input())
l = [0] * (n+1)
print(fibonacci(n, l))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,344 |
s599793905 | p02233 | u411092946 | 1587987826 | Python | Python3 | py | Accepted | 20 | 5596 | 172 | N = int(input())
A = [0]*(N+1)
if N == 0 or N == 1:
print(1)
else:
A[0] = 1
A[1] = 1
for i in range(2, N+1):
A[i] = A[i-1] + A[i-2]
print(A[N])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,345 |
s696891321 | p02233 | u332878765 | 1587913184 | Python | Python3 | py | Accepted | 20 | 5600 | 130 | n = int(input())
dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1
for i in range(2, n + 1):
dp[i] = dp[i - 1] + dp[i - 2]
print(dp[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,346 |
s764138096 | p02233 | u639364872 | 1587892033 | Python | Python3 | py | Accepted | 20 | 5604 | 216 | import sys
n = int(input())
dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1
if n == 0:
print(1)
sys.exit()
elif n == 1:
print(1)
sys.exit()
for i in range(2, n+1):
dp[i] = dp[i-1] + dp[i-2]
print(dp[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,347 |
s467944289 | p02233 | u720435112 | 1587890708 | Python | Python3 | py | Accepted | 20 | 5600 | 200 | n = int(input())
# ๅ็่จ็ปๆณ
def fibonacci(n):
F = [0]*(n+1)
F[0] = 1
F[1] = 1
for i in range(2, n+1):
F[i] = F[i-2] + F[i-1]
return F
f = fibonacci(n)
print(f[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,348 |
s280795169 | p02233 | u157179698 | 1587803897 | Python | Python3 | py | Accepted | 20 | 5600 | 178 | n = int(input())
dp = [0]*(n+1)
for i in range(n+1):
if i == 0:
dp[i] = 1
elif i == 1:
dp[i] = 1
else:
dp[i] = dp[i-1] + dp[i-2]
print(dp[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,349 |
s164065838 | p02233 | u531262486 | 1587799284 | Python | Python3 | py | Accepted | 20 | 5596 | 100 | n = int(input())
dp = [1] * (n+1)
for j in range(n-1):
dp[j+2] = dp[j+1] + dp[j]
print(dp[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,350 |
s524552840 | p02233 | u219141430 | 1587795397 | Python | Python3 | py | Accepted | 20 | 5600 | 163 | n = int(input())
def fib_loop(n):
F = [-1] * (n + 1)
F[0], F[1] = 1, 1
for i in range(2, n + 1):
F[i] = F[i - 1] + F[i - 2]
return F[n]
print(fib_loop(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,351 |
s906890365 | p02233 | u909811933 | 1587726284 | Python | Python3 | py | Accepted | 20 | 5600 | 121 | n = int(input())
fib = [0]*45
fib[0] = 1
fib[1] = 1
for i in range(2,45):
fib[i] = fib[i-1] + fib[i-2]
print(fib[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,352 |
s135368956 | p02233 | u119355204 | 1587726178 | Python | Python3 | py | Accepted | 20 | 5600 | 264 | N = int(input())
memo = [-1]*500
def fibo(x):
if memo[x] != -1:
return memo[x]
if x == 0 or x == 1:
ans=1
memo[x] = ans
return ans
ans = fibo(x-1) + fibo(x-2)
memo[x] = ans
return ans
print(fibo(N))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,353 |
s568127956 | p02233 | u174107425 | 1587713565 | Python | Python3 | py | Accepted | 20 | 5604 | 145 | N = int(input())
DP = [0 for _ in range(N + 1)]
DP[0] = 1
DP[1] = 1
for i in range(2, N + 1):
DP[i] = DP[i - 1] + DP[i - 2]
print(DP[N])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,354 |
s380227574 | p02233 | u713172874 | 1587702070 | Python | Python3 | py | Accepted | 20 | 5596 | 101 | fib = [1]*100
for i in range(2,100):
fib[i] = fib[i-1] + fib[i-2]
print(fib[int(input())])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,355 |
s491030545 | p02233 | u690713461 | 1587695104 | Python | Python3 | py | Accepted | 30 | 6064 | 461 | import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
def pri... | p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,356 |
s053218746 | p02233 | u323882423 | 1587543376 | Python | Python3 | py | Accepted | 20 | 5604 | 140 | inf = 10**9+7
mod = 10**9+7
n = int(input())
dp = [1 for i in range(n+1)]
for i in range(2,n+1):
dp[i] = dp[i-2] + dp[i-1]
print(dp[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,357 |
s643927951 | p02233 | u647694976 | 1587518573 | Python | Python3 | py | Accepted | 20 | 5600 | 102 | n=int(input())
DP=[0]*45
DP[0],DP[1]=1,1
for i in range(2,45):
DP[i]=DP[i-1]+DP[i-2]
print(DP[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,358 |
s923059365 | p02233 | u776243834 | 1587286308 | Python | Python3 | py | Accepted | 20 | 5600 | 96 | n = int(input())
fib = [1]*45
for i in range(2,n+1):
fib[i] = fib[i-1]+fib[i-2]
print(fib[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,359 |
s139101281 | p02233 | u043994425 | 1587283270 | Python | Python3 | py | Accepted | 20 | 5600 | 311 | def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
n = INT()
m = [-1] * (n+1)
m[0] = 1
m[1] = 1
def fib(n):
if m[n] != -1:
return m[n]
ans = fib(n-1) + fib(n-2)
m[n] = ans
return ans
print(fib(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,360 |
s570425240 | p02233 | u554198876 | 1587279018 | Python | Python3 | py | Accepted | 30 | 6300 | 184 | n = int(input())
from functools import lru_cache
@lru_cache(maxsize=None)
def fibo(n: int):
if n == 0 or n == 1:
return 1
return fibo(n-1) + fibo(n-2)
print(fibo(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,361 |
s937041339 | p02233 | u922248744 | 1587215991 | Python | Python3 | py | Accepted | 20 | 5600 | 233 | # def fibb(n):
# if n == 1 or n == 2:
# return 1
# else:
# return fibb(n-1)+fibb(n-2)
n = int(input())
fibb = [0]*45
fibb[0:2] = [1,1]
for i in range(2,45):
fibb[i] = fibb[i-1] + fibb[i-2]
print(fibb[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,362 |
s121558145 | p02233 | u115626571 | 1587200493 | Python | Python3 | py | Accepted | 30 | 5600 | 115 | n = int(input())
dp = [0]*50
dp[0] = 1
dp[1] = 1
for i in range(2,46):
dp[i] = dp[i-1] + dp[i-2]
print(dp[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,363 |
s047610918 | p02233 | u496924602 | 1587100522 | Python | Python3 | py | Accepted | 20 | 5596 | 138 | n = int(input())
table = [0] * 45
table[0] = 1
table[1] = 1
for i in range(2,45):
table[i] = table[i-1]+table[i-2]
print(table[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,364 |
s130677292 | p02233 | u483082413 | 1587047006 | Python | Python3 | py | Accepted | 30 | 5604 | 154 | n = int(input())
dps = [0 for _ in range(n + 1)]
dps[0] = 1
dps[1] = 1
for i in range(2, n + 1):
dps[i] = dps[i - 2] + dps[i - 1]
print(dps[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,365 |
s751715376 | p02233 | u580036688 | 1587044938 | Python | Python3 | py | Accepted | 20 | 5604 | 133 | n = int(input())
DP = [0 for _ in range(n+1)]
DP[0] = 1
DP[1] = 1
for i in range(2, n+1):
DP[i] = DP[i-1]+DP[i-2]
print(DP[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,366 |
s149351721 | p02233 | u808372529 | 1587012786 | Python | Python3 | py | Accepted | 20 | 5600 | 124 | def fb(num):
a, b = 1, 0
for _ in range(num):
a, b = a + b, a
return b
n = int(input())
print(fb(n+1))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,367 |
s723243818 | p02233 | u512884261 | 1586958543 | Python | Python3 | py | Accepted | 20 | 5604 | 270 | import sys
input = lambda: sys.stdin.readline().rstrip()
def resolve():
n = int(input())
fib = [0]*(n+1)
fib[0] = 1
fib[1] = 1
for i in range(2, n+1):
fib[i] = fib[i-1]+fib[i-2]
print(fib[n])
if __name__ == '__main__':
resolve()
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,368 |
s204175088 | p02233 | u309996056 | 1586943723 | Python | Python3 | py | Accepted | 20 | 5600 | 127 | n = int(input())
fib = [0]*(n+1)
fib[0] = 1
fib[1] = 1
for i in range(2, n+1):
fib[i] = fib[i-1] + fib[i-2]
print(fib[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,369 |
s562796700 | p02233 | u980837785 | 1586873135 | Python | Python3 | py | Accepted | 20 | 5600 | 126 | n = int(input())
fib = [0] * (n+1)
fib[0] = 1
fib[1] = 1
for i in range(2, n+1):
fib[i] = fib[i-1] + fib[i-2]
print(fib[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,370 |
s336802915 | p02233 | u652209331 | 1586868749 | Python | Python3 | py | Accepted | 20 | 5600 | 205 | n = int(input())
def fibonacci(n):
a,b = 1,1
if n == 0 or n == 1:
return 1
else:
for i in range(n-1):
a,b = b,a+b
return b
print(fibonacci(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,371 |
s969454330 | p02233 | u222010246 | 1586785620 | Python | Python3 | py | Accepted | 20 | 5604 | 306 | n = int(input())
fibs = [0 for _ in range(n+1)]
# checks = [False for _ in range(n+1)]
def fib(k):
for i in range(k+1):
if i == 0:
fibs[i] = 1
elif i == 1:
fibs[i] = 1
else:
fibs[i] = fibs[i-1] + fibs[i-2]
return fibs[k]
print(fib(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,372 |
s188811538 | p02233 | u486404145 | 1586780557 | Python | Python3 | py | Accepted | 30 | 6292 | 454 | # -*- coding: utf-8 -*-
import sys
from functools import lru_cache
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: print('Yes' if b else 'No')
YESNO=lambda b: print('YES' if b else 'NO')
def main():
@lru_cache()
def fib(n):
if n==0 or n==1... | p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,373 |
s016932127 | p02233 | u259225866 | 1586767995 | Python | Python3 | py | Accepted | 20 | 5600 | 206 | #DPใซใใใใฃใใใใๆฐๅ
n = int(input())
dp = [-1] * (n+1) #DPใใผใใซใฎ็จๆ
dp[0] = 1
dp[1] = 1#ๅๆๅค่จญๅฎ
for i in range(2, n+1):
dp[i] = dp[i-1] + dp[i-2]
print(dp[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,374 |
s545596188 | p02233 | u628720626 | 1586702798 | Python | Python3 | py | Accepted | 20 | 5600 | 175 | n=int(input())
f=[0]*(n+1)
def fib(n,f):
if n==0 or n==1:
return 1
else:
if f[n]!=0:
return f[n]
else:
f[n]=fib(n-1,f)+fib(n-2,f)
return f[n]
print(fib(n,f))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,375 |
s558204549 | p02233 | u258049727 | 1586659665 | Python | Python3 | py | Accepted | 20 | 5596 | 99 | n = int(input())
fib = [1]*(n+1)
for i in range(2,n+1): fib[i] = fib[i-1] + fib[i-2]
print(fib[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,376 |
s444679213 | p02233 | u044232230 | 1586580815 | Python | Python3 | py | Accepted | 20 | 5600 | 128 | N = int(input())
fib = [None] * (N+1)
fib[0] = 1
fib[1] = 1
for i in range(2,N+1):
fib[i] = fib[i-1] + fib[i-2]
print(fib[N])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,377 |
s336316965 | p02233 | u844375937 | 1586538750 | Python | Python3 | py | Accepted | 40 | 8300 | 7,872 | mod = 10 ** 9 + 7
mod2 = 2 ** 61 + 1
from collections import deque
import heapq
import time
from bisect import bisect_left, insort_left, bisect_right
import sys
import random
import itertools
input = sys.stdin.readline
_NUMINT_ALL = list(range(10))
_START_TIME = time.time()
INDEX_KETA = 10**12
def main():
ans = s... | p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,378 |
s548632808 | p02233 | u546267901 | 1586503755 | Python | Python3 | py | Accepted | 20 | 5600 | 251 | def makeFibonacci(n):
F = [0] * (n+1)
if n == 0:
F[0] = 1
else:
F[0] = 1
F[1] = 1
for i in range(2, n+1):
F[i] = F[i-2]+F[i-1]
return F
n = int(input())
Ans = makeFibonacci(n)
print(Ans[n])
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,379 |
s151786572 | p02233 | u013374192 | 1586421996 | Python | Python3 | py | Accepted | 50 | 6896 | 1,033 | import math
import copy
import sys
import fractions
# import numpy as np
# import statistics
import decimal
import heapq
import collections
import itertools
import bisect
# from operator import mul
sys.setrecursionlimit(100001)
# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)
# ===FUNCTION===
def getIn... | p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,380 |
s420016659 | p02233 | u940492895 | 1586374583 | Python | Python3 | py | Accepted | 20 | 5604 | 247 | # ใใฃใใใใๆฐๅ Fibonacci number
DP = [-1 for i in range(45)]
DP[0] = 1
DP[1] = 1
def fib(i):
if DP[i] != -1:
return DP[i]
else:
DP[i] = fib(i-1) + fib(i-2)
return DP[i]
n = int(input())
print(fib(n))
| p02233 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<H1>Fibonacci Number</H1>
<p>
... | 3
| 3
| 28,381 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.