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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s713469396 | p02233 | u017237693 | 1594124088 | Python | Python3 | py | Accepted | 20 | 5600 | 121 | 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[-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,182 |
s988516418 | p02233 | u849721539 | 1594121908 | Python | Python3 | py | Accepted | 20 | 5604 | 113 | N=int(input())
L=[0 for i in range(N+1)]
L[0]=1
L[1]=1
for i in range(2,N+1):
L[i]=L[i-1]+L[i-2]
print(L[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,183 |
s824490904 | p02233 | u259416836 | 1594084568 | Python | Python3 | py | Accepted | 20 | 5596 | 73 | n=int(input())
a=b=1
for i in 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,184 |
s209871560 | p02233 | u680047335 | 1594082052 | Python | Python3 | py | Accepted | 20 | 5592 | 179 | a = int(input())
f1 = int(2)
f2 = int(1)
f = int(1)
if a == 1:
print("1")
elif a == 2:
print("2")
else:
for b in range(2,a):
f= f1+f2
f2 = f1
f1 = f
print(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,185 |
s170547669 | p02233 | u361745995 | 1594081632 | Python | Python3 | py | Accepted | 20 | 5600 | 245 |
n=int(input())
f=[0]*45
def Fib(n):
if n==0:
return 1
elif 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,186 |
s985649787 | p02233 | u940983140 | 1594044024 | Python | Python3 | py | Accepted | 20 | 5628 | 177 | n=int(input())
if n == 1:
print(1)
elif n == 2:
print(2)
else:
p=n+1
a=((1+5**(1/2))/2)**p
b=((1-5**(1/2))/2)**p
c=1/(5**(1/2))
print(int(c*(a-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,187 |
s869611455 | p02233 | u878424017 | 1594040435 | Python | Python3 | py | Accepted | 20 | 5600 | 133 | def fib(n):
global F
if n not in F:
F[n] = fib(n-1)+fib(n-2)
return F[n]
F = {0:1,1:1}
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,188 |
s049179409 | p02233 | u514242733 | 1594037459 | Python | Python3 | py | Accepted | 20 | 5600 | 107 | n=int(input())
def fib(n):
a,b=1,1
for i in range(n):
a,b=b,a+b
return 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,189 |
s823008841 | p02233 | u036641996 | 1594033671 | Python | Python3 | py | Accepted | 20 | 5600 | 267 | n = int(input())
L = [-1]*(n+1)
def fib(i,L):
if i <= 1:
return 1
else:
if L[i] != -1:
return L[i]
else:
L[i] = fib(i-1,L)+fib(i-2,L)
return L[i]
return fib(i-1,L)+fib(i-2,L)
print(fib(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,190 |
s527621458 | p02233 | u626932242 | 1594028621 | Python | Python3 | py | Accepted | 20 | 5608 | 331 | import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7
def resolve():
n = int(input())
fib = [0] * (n + 1)
fib[0], fib[1] = 1, 1
for i in range(2, n + 1):
fib[i] = fib[i - 1] + fib[i - 2]
print(fib[-1])
if __name__ == '__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,191 |
s895903602 | p02233 | u357050809 | 1594022298 | Python | Python3 | py | Accepted | 20 | 5596 | 148 | n = int(input())
dp = [0] * (n+1)
dp[0] = 1
for i in range(1, n+1):
if i == 1:
dp[1] = 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,192 |
s845799299 | p02233 | u320921262 | 1594019914 | Python | Python3 | py | Accepted | 20 | 5600 | 290 | memo={}
def fib(n) :
if n == 0 :
return 1
elif n == 1 :
return 1
else :
if n-1 not in memo:
memo[n-1] = fib(n-1)
if n-2 not in memo:
memo[n-2] = fib(n-2)
return memo[n-1] + memo[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,193 |
s663859000 | p02233 | u586171604 | 1594009613 | Python | Python3 | py | Accepted | 20 | 5592 | 75 | N = int(input())
a = b = 1
while 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,194 |
s003117615 | p02233 | u869208015 | 1594009326 | Python | Python3 | py | Accepted | 30 | 5596 | 152 | def fibo(n):
fibo = [1,1]
for i in range(2,n+1):
fibo.append(fibo[i-2]+fibo[i-1])
return fibo[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,195 |
s638542410 | p02233 | u748843150 | 1593958380 | Python | Python3 | py | Accepted | 20 | 5600 | 131 | n=int(input())
F=[None for i in range(n+1)]
F[0],F[1]=1,1
for i in range(2,n+1):
F[i]=F[i-2]+F[i-1]
answer=F[n]
print(answer)
| 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,196 |
s629912444 | p02233 | u272080389 | 1593910893 | Python | Python3 | py | Accepted | 20 | 5600 | 127 | n=int(input())
a,b=1,1
if n<=1:
print(1)
else:
for i in range(n-1):
c=a+b
a=b
b=c
print(c)
| 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,197 |
s563903292 | p02233 | u917514663 | 1593863914 | Python | Python3 | py | Accepted | 20 | 5600 | 106 | n=int(input())
dp=[0]*(n+1)
dp[0],dp[1]=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,198 |
s322521213 | p02233 | u121616304 | 1593858903 | Python | Python3 | py | Accepted | 20 | 5596 | 114 | N=int(input())
DP=[]
DP.append(1)
DP.append(1)
for i in range(2,N+1):
DP.append(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,199 |
s350828172 | p02233 | u798363880 | 1593858404 | Python | Python3 | py | Accepted | 20 | 5600 | 205 | N=int(input())
DP=[0]*(N+1)
def fin(n):
if DP[n]!=0:
return DP[n]
if n<=1:
DP[n]=1
return DP[n]
else:
DP[n]=fin(n-1)+fin(n-2)
return DP[n]
print(fin(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,200 |
s096892803 | p02233 | u822440951 | 1593830575 | Python | Python3 | py | Accepted | 20 | 5600 | 189 | _fib = [0] * 45
def fib(n):
if n < 2:
return 1
if _fib[n] > 0:
return _fib[n]
_fib[n] = fib(n-1) + fib(n-2)
return _fib[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,201 |
s282028945 | p02233 | u562926655 | 1593786103 | Python | Python3 | py | Accepted | 20 | 5600 | 236 | import sys
input = sys.stdin.readline
def main():
n = int(input())
fib = [1] * 46
for i in range(2, 46):
fib[i] = fib[i - 1] + fib[i - 2]
ans = fib[n]
print(ans)
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,202 |
s598926816 | p02233 | u189528630 | 1593754134 | Python | Python3 | py | Accepted | 20 | 5600 | 133 | n=int(input())
a=1
b=1
list=[]
list.append(a)
list.append(b)
for i in range(n):
list.append(a+b)
d=b
b+=a
a=d
print(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,203 |
s368499155 | p02233 | u842787189 | 1593704612 | Python | Python3 | py | Accepted | 30 | 5596 | 128 | 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,204 |
s777516497 | p02233 | u057134693 | 1593611911 | Python | Python3 | py | Accepted | 20 | 5596 | 130 | # 34
n = int(input())
dp = [None] * (n+1)
dp[0] = 1
dp[1] = 1
for i in range(n-1):
dp[i+2] = dp[i] + 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,205 |
s821323444 | p02233 | u918401227 | 1593609478 | Python | Python3 | py | Accepted | 20 | 5596 | 269 | def fib(n):
nums = []
for i in range(n+1):
if i <= 1:
nums.append(1)
else:
nums.append(nums[i-1]+nums[i-2])
return nums[n]
def main():
n = int(input())
print(fib(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,206 |
s141197306 | p02233 | u287942899 | 1593601108 | Python | Python3 | py | Accepted | 20 | 5600 | 123 | n = int(input())
dp = [0] * 45
dp[0], dp[1] = 1, 1
for i in range(2, 44+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,207 |
s932193654 | p02233 | u976648183 | 1593564016 | Python | Python3 | py | Accepted | 20 | 5596 | 159 | list=[1,1]
n=int(input())
t=0
sum=0
if n==0 or n==1:
print(1)
else:
for i in range(n):
list.append(list[i]+list[i+1])
print(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,208 |
s556424207 | p02233 | u799752967 | 1593487280 | Python | Python3 | py | Accepted | 20 | 5600 | 127 | a=1
b=1
c=[]
n=int(input())
c.append(a)
c.append(b)
for i in range(n):
c.append(a+b)
d=b
b+=a
a=d
print(c[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,209 |
s263302971 | p02233 | u457539618 | 1593478269 | Python | Python3 | py | Accepted | 20 | 5600 | 142 | n=int(input())
def func(n):
fib=[1,1]
for i in range(2,n):
fib.append(fib[i-2]+fib[i-1])
return fib[n-1]
print(func(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,210 |
s058003443 | p02233 | u973203074 | 1593470296 | Python | Python3 | py | Accepted | 20 | 5600 | 104 | n = int(input())
pair = [1, 1]
for i in range(n - 1):
pair[i % 2] = sum(pair)
print(pair[n % 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,211 |
s593529995 | p02233 | u138194441 | 1593410113 | Python | Python3 | py | Accepted | 20 | 5600 | 90 | x = [1,1]
n = int(input())
for i in range(n):
a=[x[i]+x[i+1]]
x = x+a
print(x[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,212 |
s813238472 | p02233 | u397004753 | 1593409772 | Python | Python3 | py | Accepted | 20 | 5600 | 138 | n=int(input())
a=1
b=1
mlist=[]
mlist.append(a)
mlist.append(b)
for i in range(n):
mlist.append(a+b)
d=b
b+=a
a=d
print(mlist[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,213 |
s273934205 | p02233 | u350481745 | 1593307473 | Python | Python3 | py | Accepted | 20 | 5600 | 216 | 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]
f=[0]*45
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,214 |
s191142836 | p02233 | u062640303 | 1593265610 | Python | Python3 | py | Accepted | 20 | 5600 | 111 | n=int(input())
def fib(n):
a=1
b=1
for _ in range(n):
a,b=b,a+b
return 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,215 |
s830580512 | p02233 | u368730827 | 1593219662 | Python | Python3 | py | Accepted | 20 | 5600 | 110 | fib=[0]*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,216 |
s161600081 | p02233 | u171087702 | 1593051371 | Python | Python3 | py | Accepted | 20 | 5596 | 132 | n = int(input())
fib = [-1] * (n+1)
fib[0], fib[1] = 1, 1
for i in range(2, n+1):
fib[i] = fib[i-1] + fib[i-2]
print(fib[-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,217 |
s369532956 | p02233 | u644959375 | 1592827463 | Python | Python3 | py | Accepted | 20 | 5600 | 199 | def fib(n):
if n==0:
return 1
elif n==1:
return 1
else:
a,b=1,2
for i in range(n-2):
a,b=b,a+b
return b
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,218 |
s405819089 | p02233 | u627612495 | 1592819486 | Python | Python3 | py | Accepted | 30 | 6284 | 185 | n = int(input())
from functools import lru_cache
@lru_cache(maxsize=None)
def fib(n):
if n == 0 or n == 1:
return 1
else:
return fib(n-2)+fib(n-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,219 |
s931286361 | p02233 | u064625546 | 1592809262 | Python | Python3 | py | Accepted | 20 | 5592 | 143 | n=int(input())
if n==0 or n==1:
print(1)
else:
N=1
m=1
for i in range(n-1):
M=N+m
m=N
N=M
print(M)
| 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,220 |
s315074111 | p02233 | u506949161 | 1592808452 | Python | Python3 | py | Accepted | 20 | 5600 | 245 | list=[1]*45
n=int(input())
def fib(n):
if n==0 or n==1:
return list[n]
else:
if list[n]==1:
list[n]=fib(n-1)+fib(n-2)
return list[n]
else:
return list[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,221 |
s000999824 | p02233 | u685887060 | 1592802470 | Python | Python3 | py | Accepted | 20 | 5600 | 117 | n=int(input())
def fib(n):
a=1
b=1
for _ in range(n):
a,b=b,a+b
return 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,222 |
s089136357 | p02233 | u826807985 | 1592789653 | Python | Python3 | py | Accepted | 20 | 5596 | 258 | n = int(input())
def fib(n):
m = [1,1]
if n==0 or n==1:
m=[1]
else:
for k in range(2,n+1):
m.append(m[-1]+m[-2])
return m
if n==0:
l = fib(n)[n]
elif n==1:
l = fib(n)[n-1]
else:
l = fib(n)[n]
print(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,223 |
s156849360 | p02233 | u233634805 | 1592721612 | Python | Python3 | py | Accepted | 20 | 5600 | 164 | n = int(input())
# dpใใผใใซใฎ็จๆ
dp = [-1]*(n+1)
# dpใฎๅๆๅค
dp[0], dp[1] = 1, 1
for i in range(2, n+1):
dp[i] = dp[i-1]+dp[i-2]
print(dp[-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,224 |
s029975343 | p02233 | u472664493 | 1592703420 | Python | Python3 | py | Accepted | 20 | 5600 | 101 | N = int(input())
dp = [1] * (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,225 |
s950901797 | p02233 | u893763407 | 1592645613 | Python | Python3 | py | Accepted | 20 | 5600 | 119 | 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[-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,226 |
s155093652 | p02233 | u838993229 | 1592637566 | 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,227 |
s641227086 | p02233 | u573698742 | 1592625541 | Python | Python3 | py | Accepted | 20 | 5600 | 126 | a=1
b=1
c=[]
n=int(input())
c.append(a)
c.append(b)
for i in range(n):
c.append(a+b)
d=b
b+=a
a=d
print(c[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,228 |
s368125051 | p02233 | u251716708 | 1592581137 | Python | Python3 | py | Accepted | 20 | 5592 | 64 | n = int(input())
a=b=1
while 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,229 |
s782154064 | p02233 | u420455834 | 1592579687 | Python | Python3 | py | Accepted | 30 | 6092 | 439 | import sys
import itertools
# import numpy as np
import time
import math
sys.setrecursionlimit(10 ** 7)
from collections import defaultdict
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(input())
dp = [0] * (N + 1)
dp[0] = 1
dp[1] = 1
def 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,230 |
s102076402 | p02233 | u562030778 | 1592472670 | Python | Python3 | py | Accepted | 20 | 5600 | 169 | n=int(input())
dp=[0]*(n+1)
dp[0]=1
dp[1]=1
def rec(x):
if dp[x]>0:
return dp[x]
res=rec(x-1)+rec(x-2)
dp[x]=res
return dp[x]
print(rec(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,231 |
s543320813 | p02233 | u931484744 | 1592376564 | Python | Python3 | py | Accepted | 20 | 5612 | 255 | # 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,232 |
s360326109 | p02233 | u497248335 | 1592321441 | Python | Python3 | py | Accepted | 20 | 5596 | 151 | n = int(input())
fib = []
for i in range (n+1) :
if i <= 1 :
fib.append(1)
else :
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,233 |
s735453835 | p02233 | u397395735 | 1592285920 | Python | Python3 | py | Accepted | 20 | 5596 | 158 | n = int(input())
l = [1,1]
if n in [0,1]:
print(1)
else:
for i in range(2, n+1):
fib = l[-1] + l[-2]
l.append(fib)
print(fib)
| 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,234 |
s882239668 | p02233 | u673183698 | 1592269994 | Python | Python3 | py | Accepted | 20 | 5584 | 81 | n=int(input())
x=1
y=1
a=0
for i in range(n):
a=x
x=y
y=a+y
print(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,235 |
s291673952 | p02233 | u926092389 | 1592269806 | Python | Python3 | py | Accepted | 20 | 5600 | 141 | a=1
b=1
list=[]
n=int(input())
list.append(a)
list.append(b)
for i in range(n):
list.append(a+b)
c=b
b+=a
a=c
print(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,236 |
s865262506 | p02233 | u695568874 | 1592268677 | Python | Python3 | py | Accepted | 20 | 5600 | 114 | n=int(input())
a=1
b=1
if n==0 or n==1:
print(1)
else:
for i in range (n):
a,b=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,237 |
s222221968 | p02233 | u221550784 | 1592267065 | Python | Python3 | py | Accepted | 20 | 5596 | 212 | n=int(input())
MAX_N=n
X = [None] * (MAX_N + 1)
def f(n):
if n==0:
return 1
if n==1:
return 1
if X[n]:
return X[n]
r=f(n-1)+f(n-2)
X[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,238 |
s309190158 | p02233 | u593772041 | 1592238069 | Python | Python3 | py | Accepted | 20 | 5600 | 118 | 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,239 |
s143604820 | p02233 | u131892700 | 1592218020 | Python | Python3 | py | Accepted | 20 | 5600 | 217 | def Fibonacci(n):
if n == 0 or n == 1:
dic[n] = 1
if n in dic.keys():
return dic[n]
dic[n] = Fibonacci(n-1) + Fibonacci(n-2)
return dic[n]
a = int(input())
dic ={}
print(Fibonacci(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,240 |
s440953477 | p02233 | u444626963 | 1592209417 | Python | Python3 | py | Accepted | 20 | 5600 | 138 | def fibonacci(n):
a, b = 1, 0
for _ in range(0, n):
a, b = b, a + b
return b
n=int(input())
n+=1
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,241 |
s622432781 | p02233 | u442912414 | 1592207076 | Python | Python3 | py | Accepted | 20 | 5600 | 203 | n=int(input())
a=[1]*45
def fib(n):
if n==0 or n==1:
return 1
else:
if a[n]==1:
a[n]=fib(n-1)+fib(n-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,242 |
s719428930 | p02233 | u711365732 | 1592202673 | Python | Python3 | py | Accepted | 20 | 5600 | 216 | n = int(input())
memo = [None]*(n+1)
def Fib(n):
if n==0 or n==1:
return 1
elif memo[n]:
return memo[n]
else:
r=Fib(n-1)+Fib(n-2)
memo[n]=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,243 |
s581248102 | p02233 | u981910313 | 1592200359 | 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.pop())
| 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,244 |
s385822316 | p02233 | u511292942 | 1592198386 | Python | Python3 | py | Accepted | 20 | 5592 | 71 | n = int(input())
a = b = 1
for i in range(n):
a,b = 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,245 |
s558239249 | p02233 | u596129030 | 1592198378 | Python | Python3 | py | Accepted | 20 | 5600 | 107 | n=int(input())
def Fib(n):
a,b=0,1
for i in range(n):
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,246 |
s662837381 | p02233 | u491421284 | 1592112202 | Python | Python3 | py | Accepted | 20 | 5596 | 102 | n = int(input())
A = [1]*(n+1)
for i in range(2, n+1):
A[i] = A[i-1] + A[i-2]
print(A[-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,247 |
s902050223 | p02233 | u636645824 | 1592069631 | Python | Python3 | py | Accepted | 20 | 5600 | 107 | n = int(input())
arr = [1, 1]
for i in range(2, 45):
arr.append(arr[i - 1] + arr[i - 2])
print(arr[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,248 |
s333977101 | p02233 | u476858890 | 1592064486 | Python | Python3 | py | Accepted | 30 | 5600 | 242 | n = int(input())
num = [-1] * 100
def fibonacci(n):
if n == 0:
num[0] = 1
elif n == 1:
num[1] = 1
if num[n] == -1:
num[n] = fibonacci(n - 1) + fibonacci(n - 2)
return num[n]
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,249 |
s771503261 | p02233 | u795882061 | 1592018011 | Python | Python3 | py | Accepted | 20 | 5600 | 125 | n = int(input())
def fb(num):
a, b = 1, 0
for i in range(num):
a, b = a + b, a
return b
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,250 |
s485336521 | p02233 | u528682978 | 1591878707 | Python | Python3 | py | Accepted | 20 | 5600 | 136 | def solve(n):
dp=[1]*(n+1)
for i in range(2,n+1):
dp[i]=dp[i-1]+dp[i-2]
return dp[n]
n=int(input())
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,251 |
s938605010 | p02233 | u390052013 | 1591850111 | Python | Python3 | py | Accepted | 20 | 5600 | 141 | def resolve():
n = int(input())
A = [1, 1]
for i in range(1, 45):
A.append(A[i - 1] + A[i])
print(A[n])
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,252 |
s659541098 | p02233 | u658049730 | 1591787346 | Python | Python3 | py | Accepted | 20 | 5600 | 329 | def main():
def fib(n):
a = 1
b = 1
if n == 0:
return a
elif n == 1:
return b
else:
for i in range(n-1):
a, b = b, a + b
return b
n = int(input())
print(fib(n))
if __name__ == '__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,253 |
s428539511 | p02233 | u210664395 | 1591707015 | Python | Python3 | py | Accepted | 20 | 5608 | 246 | def main():
import sys
N = int(sys.stdin.readline())
L = [0 for i in range(45)]
L[0], L[1] = 1, 1
for i in range(2, 45):
L[i] = L[i-1] + L[i-2]
#print(L)
print(L[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,254 |
s834742512 | p02233 | u257570657 | 1591674928 | Python | Python3 | py | Accepted | 20 | 5596 | 101 | n=int(input())
a=list(range(n+1))
a[0]=1
i=2
while i<=n:
a[i]=a[i-1]+a[i-2]
i+=1
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,255 |
s874902327 | p02233 | u662362547 | 1591665260 | Python | Python3 | py | Accepted | 20 | 5604 | 136 | import sys
input = sys.stdin.readline
n=int(input())
fib=[1]*50
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,256 |
s260669724 | p02233 | u061207034 | 1591631161 | Python | Python3 | py | Accepted | 20 | 5600 | 249 | def main():
N = int(input())
if N <= 1:
print(1)
return
fib = [0]*(N+1)
fib[0], fib[1] = 1, 1
for i in range(2, N+1):
fib[i] = fib[i-1] + fib[i-2]
print(fib[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,257 |
s527726139 | p02233 | u502283627 | 1591622497 | Python | Python3 | py | Accepted | 30 | 5600 | 202 | n = int(input())
N =[1, 1, 2]
if n < 3:
print(N[n])
else:
i = 2
while i < n:
n0, n1, n2 = N
N[2] = n1 + n2
N[1] = n2
N[0] = n1
i += 1
print(N[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,258 |
s555627163 | p02233 | u333382219 | 1591587629 | Python | Python3 | py | Accepted | 30 | 5600 | 105 | n = int(input())
fib = [1, 1]
for i in range(2, n+1):
fib.append(fib[i-1] + fib[i-2])
print(fib.pop())
| 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,259 |
s241457918 | p02233 | u924322815 | 1591586523 | Python | Python3 | py | Accepted | 20 | 5600 | 127 | n=int(input())
fib=[0 for i in range(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,260 |
s216407692 | p02233 | u923142875 | 1591464490 | Python | Python3 | py | Accepted | 20 | 5604 | 128 | n = int(input())
dp = [0 for _ in range(46)]
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,261 |
s657265942 | p02233 | u206985725 | 1591432323 | Python | Python3 | py | Accepted | 20 | 5600 | 190 | n = int(input())
a = 1
b = 1
c = []
c.append(a)
c.append(b)
#print(c)
for i in range(n):
c.append(a+b)
#print(c)
d = b
b += a
a = d
print(c[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,262 |
s619757239 | p02233 | u874049078 | 1591431800 | Python | Python3 | py | Accepted | 20 | 5600 | 360 | #40 ใใฃใใใใๆฐๅ - Time Limit Exceeded
n = int(input())
a = 1
b = 1
c = []
c.append(a) #ใชในใcใฎๆๅพใซaใฎๅคใไปๅ
c.append(b) #ใชในใcใฎๆๅพใซbใฎๅคใไปๅ
for i in range(n):
c.append(a+b) #ใชในใcใฎๆๅพใซa+bใฎๅคใไปๅ
d = b
b += a
a = d
print(c[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,263 |
s698177063 | p02233 | u565737280 | 1591428248 | Python | Python3 | py | Accepted | 20 | 5600 | 160 | n = int(input())
F = [0]*50
F[0] = 1
F[1] = 1
if n== 0 or n==1:
print(F[n])
else:
for i in range(2,n+1):
F[i] = F[i-1]+ F[i-2]
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,264 |
s472884644 | p02233 | u275486335 | 1591348040 | Python | Python3 | py | Accepted | 20 | 5600 | 126 | n=int(input())
x=0
y=1
if n==0 or n==1:
print(1)
else:
for i in range(n):
x,y=y,x+y
i+=1
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,265 |
s038496555 | p02233 | u895355432 | 1591275565 | Python | Python3 | py | Accepted | 20 | 5600 | 229 | def solve(n):
if n <= 1:
print(1)
return
a, b = 1, 1
for _ in range(2, n + 1):
c = a + b
b = a
a = c
print(c)
if __name__ == "__main__":
n = int(input())
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,266 |
s659537760 | p02233 | u367619546 | 1591135655 | Python | Python3 | py | Accepted | 20 | 5600 | 221 | # ALDS_10_A - ใใฃใใใใๆฐ
n = int(input())
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[-1])
# print(dp)
| 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,267 |
s039989044 | p02233 | u356546564 | 1591106522 | Python | Python3 | py | Accepted | 20 | 5600 | 104 | n = int(input())
dp = [1, 1]
for i in range(2, n + 1):
dp = [dp[-1], dp[-2] + dp[-1]]
print(dp[-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,268 |
s819882032 | p02233 | u781474375 | 1591060815 | Python | Python3 | py | Accepted | 20 | 5600 | 319 | def fibonacci(N, dp):
if dp[N] != 0:
return dp[N]
if N == 1 or N == 0:
dp[N] = 1
else:
dp[N] = fibonacci(N - 1, dp) + fibonacci(N - 2, dp)
return dp[N]
def main():
N = int(input())
dp = [0] * (N + 1)
print(fibonacci(N, dp))
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,269 |
s814831859 | p02233 | u179629761 | 1591058466 | Python | Python3 | py | Accepted | 20 | 5592 | 62 | n=int(input())
a=b=1
while 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,270 |
s012323764 | p02233 | u845612949 | 1591017555 | Python | Python3 | py | Accepted | 20 | 5600 | 206 | N = int(input())
memo = []
memo = [1,1] + [0] * (N - 1)
def f(n):
if memo[n] == 0:
memo[n] = f(n-1) + f(n-2)
return(memo[n])
if memo[n] != 0:
return(memo[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,271 |
s668631451 | p02233 | u784691615 | 1591013668 | Python | Python3 | py | Accepted | 30 | 5604 | 405 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# https://qiita.com/e869120/items/eb50fdaece12be418faa
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_10_A&lang=ja
def main():
n = int(input().strip())
print(fib(n))
def fib(n):
dp = [1] * (n + 1)
for i in range(2, n + 1):
dp[... | 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,272 |
s041099746 | p02233 | u114583562 | 1590997808 | Python | Python3 | py | Accepted | 20 | 5668 | 264 | n = int(input())
l = [0 for _ in range(10**4)]
def fib(n):
if n==0:
l[0]=1
return 1
if n==1:
l[1]=1
return 1
if l[n]!=0:
return l[n]
else:
l[n]=fib(n-1)+fib(n-2)
return fib(n-1)+fib(n-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,273 |
s121047940 | p02233 | u371026526 | 1590996267 | Python | Python3 | py | Accepted | 20 | 5596 | 166 | n = int(input())
def fib(i):
if i<=1: return 1
else:
a=0
b=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,274 |
s668080193 | p02233 | u173393391 | 1590993057 | Python | Python3 | py | Accepted | 20 | 5600 | 174 | n=int(input())
dp=[1,1]
def fib(n):
if n==0 and n==1:
return dp[n]
for i in range(2,n+1):
dp.append(dp[i-1]+dp[i-2])
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,275 |
s933889766 | p02233 | u156732351 | 1590941377 | Python | Python3 | py | Accepted | 20 | 5600 | 141 | n = int(input())
fib = [0] * (n + 1)
fib[0] = 1
if n > 0: 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,276 |
s434690429 | p02233 | u286314212 | 1590926011 | Python | Python3 | py | Accepted | 20 | 5600 | 304 | n = int(input())
DP = [None] * (n + 1) # ่จ็ฎ็ตๆใไฟๅญใใ้
ๅ
DP[0] = 1 # ๅฎ็พฉใใ
DP[1] = 1 # ๅฎ็พฉใใ
def fib(n):
# ใใฃใใใใๆฐใ2ใใnใพใง้ ใซๆฑใใฆใใ
for i in range(2, n + 1):
DP[i] = DP[i-1] + DP[i-2]
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,277 |
s046215161 | p02233 | u171326376 | 1590912980 | Python | Python3 | py | Accepted | 20 | 5600 | 227 | def fib(n):
a = 1
b = 1
if n == 0:
print(a)
elif n == 1:
print(b)
else:
for i in range(n-1):
c = a + b
a , b = b , c
print(c)
n = int(input())
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,278 |
s709990558 | p02233 | u800829827 | 1590853717 | Python | Python3 | py | Accepted | 20 | 5600 | 185 |
f = [-1]*45
f[0]=1
f[1]=1
def fib(i):
global f
if i<=1:
return f[i]
if f[i] == -1:
f[i] = fib(i-1)+fib(i-2)
return f[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,279 |
s997613062 | p02233 | u917391429 | 1590828563 | Python | Python3 | py | Accepted | 20 | 5600 | 116 | n = int(input())
dp = [1, 1]
if n >1:
for i in range(2, n + 1):
dp.append(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,280 |
s682310372 | p02233 | u545131994 | 1590677307 | Python | Python3 | py | Accepted | 20 | 5596 | 124 | n=int(input())
fib=[0]*(n+1)
fib[0]=1
fib[1]=1
for ni in range(2,n+1):
fib[ni]=fib[ni-1]+fib[ni-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,281 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.