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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s247697475 | p02233 | u782850731 | 1380245750 | Python | Python | py | Accepted | 20 | 4220 | 224 | #!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin
def fibo(n):
a, b = 1, 1
while n:
a, b = b, a + b
n -= 1
return a
print(fibo(int(stdin.readline()))) | 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,082 |
s784502962 | p02233 | u140201022 | 1387891753 | Python | Python | py | Accepted | 20 | 4192 | 64 | a,b=1,1,
for i in range(int(raw_input())):
a,b=a+b,a
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,083 |
s144299160 | p02233 | u920513163 | 1597762648 | Python | Python3 | py | Accepted | 20 | 5600 | 104 | f = [1, 1] + [0] * (int(input()) - 1)
for i in range(2, len(f)):f[i] = f[i - 2] + f[i - 1]
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,084 |
s227929757 | p02233 | u709176169 | 1597760673 | Python | Python3 | py | Accepted | 30 | 6292 | 204 | 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,085 |
s043194101 | p02233 | u342624490 | 1597758901 | Python | Python3 | py | Accepted | 30 | 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,086 |
s357663886 | p02233 | u365131854 | 1597754475 | Python | Python3 | py | Accepted | 20 | 5592 | 55 | a=b=1
for _ in range(int(input())): 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,087 |
s657988985 | p02233 | u159581881 | 1597750557 | Python | Python3 | py | Accepted | 20 | 5616 | 516 | def mul(A,B):
C=[[0]*len(B) for i in range(len(A[0]))]
for i in range(len(A)):
for j in range(len(B[0])):
for k in range(len(B)):
C[i][j]=(C[i][j]+A[i][k]*B[k][j])
return C
def matpow(vec,n):
B=[[0]*len(vec) for i in range(len(vec))]
for i in range(len(vec)):
... | 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,088 |
s090431585 | p02233 | u885258138 | 1597748717 | Python | Python3 | py | Accepted | 20 | 5588 | 72 | n=int(input())
a=1
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,089 |
s088506837 | p02233 | u363460225 | 1597738603 | Python | Python3 | py | Accepted | 20 | 5600 | 110 | n=int(input())
a=[None] * (n+1)
a[0] = 1
a[1] = 1
for i in range(n-1):
a[i+2]=a[i]+a[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,090 |
s180433569 | p02233 | u327396500 | 1597729321 | Python | Python3 | py | Accepted | 20 | 5600 | 205 | ####
n = int(input())
memo = [-1]*(n+10)
def fib(i):
if i==0 or i == 1:
return 1
if memo[i] != -1:
return memo[i]
memo[i] = fib(i-1) + fib(i-2)
return memo[i]
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,091 |
s579323796 | p02233 | u852547520 | 1597715298 | Python | Python3 | py | Accepted | 30 | 6292 | 198 | from functools import lru_cache
n = int(input())
@lru_cache(maxsize=None)
def fib(n):
if n==0 or n==1:
return 1
else:
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,092 |
s887562777 | p02233 | u326077502 | 1597714724 | Python | Python3 | py | Accepted | 20 | 5600 | 90 | n = int(input())
F = [1]*50
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,093 |
s331344363 | p02233 | u275308599 | 1597662217 | Python | Python3 | py | Accepted | 20 | 5600 | 201 | n = int(input())
fib = []
ans = 0
for i in range(n+1):
if i == 0 or i == 1:
ans = 1
fib.append(ans)
else:
ans = fib[i-1] + fib[i-2]
fib.append(ans)
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,094 |
s217786554 | p02233 | u799076010 | 1597643819 | Python | Python3 | py | Accepted | 20 | 5604 | 111 | A=[0 for i in range(45)]
A[0]=1
A[1]=1
for i in range(2,45):
A[i]=A[i-1]+A[i-2]
B=int(input())
print(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,095 |
s740064197 | p02233 | u762022668 | 1597625865 | Python | Python3 | py | Accepted | 20 | 5588 | 74 | 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,096 |
s537557087 | p02233 | u991830357 | 1597546857 | Python | Python3 | py | Accepted | 20 | 5600 | 176 | n=int(input())
if n==0 or n==1:
print(1)
else:
a=[]
a.append(1)
a.append(1)
for i in range(2,n+1):
m=a[i-2]+a[i-1]
a.append(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,097 |
s694689510 | p02233 | u925445050 | 1597504419 | Python | Python3 | py | Accepted | 20 | 5600 | 127 | n = int(input())
if n < 2:
print(1)
else:
a, b = 1, 1
for k in range(n - 1):
a, b = b, a + b
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,098 |
s748900577 | p02233 | u609694002 | 1597496704 | Python | Python3 | py | Accepted | 30 | 6292 | 188 | from functools import lru_cache
@lru_cache(maxsize=None)
def fibo(n):
if n == 0 or n == 1:
return 1
return fibo(n - 1) + fibo(n - 2)
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,099 |
s685482373 | p02233 | u439569116 | 1597473384 | Python | Python3 | py | Accepted | 20 | 5600 | 125 | n = int(input())
dp = [0] * (n+10)
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,100 |
s846304292 | p02233 | u799016206 | 1597435970 | Python | Python3 | py | Accepted | 30 | 5596 | 145 | def fib(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(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,101 |
s541538846 | p02233 | u427834127 | 1597413112 | Python | Python3 | py | Accepted | 20 | 5592 | 162 | x=int(input())
a=1
b=1
i=1
if x==0:
print(1)
elif x==1:
print(1)
else:
while i<=x-1:
c=a+b
a=b
b=c
i+=1
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,102 |
s049032098 | p02233 | u754923116 | 1597389640 | Python | Python3 | py | Accepted | 20 | 5600 | 231 | def fibonacci(F,n):
F[0] = 1
F[1] = 1
for i in range(2,n+1,1):
F[i] = F[i-1] + F[i-2]
return F[n]
def main():
n = int(input())
F = [0]*(n+1)
ans = fibonacci(F,n)
return ans
print(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,103 |
s557042446 | p02233 | u645852846 | 1597370607 | Python | Python3 | py | Accepted | 20 | 5600 | 133 | 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,104 |
s530595889 | p02233 | u053015104 | 1597348705 | Python | Python3 | py | Accepted | 20 | 5600 | 108 | n = int(input())
f = [0]*45
f[0] = f[1] = 1
for i in range(2, 45):
f[i] = f[i-2] + f[i-1]
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,105 |
s103202730 | p02233 | u419548414 | 1597338457 | Python | Python3 | py | Accepted | 20 | 5600 | 133 | a=1
b=1
list=[]
n=int(input())
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,106 |
s573133696 | p02233 | u828164095 | 1597336059 | Python | Python3 | py | Accepted | 20 | 5604 | 472 | f=[None for i in range(45)]
def fib(n):
if n==0 or n==1:
if f[n] is None:
f[n] = 1
return 1
else:
if f[n-2] is not None:
f_n_2 = f[n-2]
else:
f_n_2 = fib(n-2)
f[n-2] = f_n_2
if f[n-1] is not None:
f_n_1 = 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,107 |
s683662837 | p02233 | u884758681 | 1597333983 | Python | Python3 | py | Accepted | 30 | 5592 | 66 | 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,108 |
s255483542 | p02233 | u940828136 | 1597222481 | 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,109 |
s361790424 | p02233 | u880802684 | 1597219221 | Python | Python3 | py | Accepted | 30 | 6288 | 197 | from functools import lru_cache
@lru_cache(None)
def fibo(n: int):
if n == 0 or n == 1:
return 1
else:
return fibo(n - 1) + fibo(n - 2)
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,110 |
s227601820 | p02233 | u571995157 | 1597190922 | Python | Python3 | py | Accepted | 20 | 5600 | 138 | n = int(input())
dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1
for i in range(1, n):
i += 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,111 |
s699360480 | p02233 | u278236319 | 1597043308 | Python | Python3 | py | Accepted | 20 | 5600 | 231 | N = int(input())
x = [0]*(N+1)
def fibo(n):
if n ==0 or n==1:
return 1
else:
if x[n] != 0:
return x[n]
else:
x[n] = fibo(n-1)+fibo(n-2)
return x[n]
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,112 |
s228510835 | p02233 | u389047838 | 1597042788 | Python | Python3 | py | Accepted | 30 | 6368 | 803 | import sys
import math
from collections import defaultdict, deque
from copy import deepcopy
input = sys.stdin.readline
def RD(): return input().rstrip()
def F(): return float(input().rstrip())
def I(): return int(input().rstrip())
def MI(): return map(int, input().split())
def MF(): return map(float,input().split(... | 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,113 |
s521755929 | p02233 | u250040203 | 1597042083 | Python | Python3 | py | Accepted | 20 | 5600 | 266 | N = int(input())
X = [0]*45
def fib(n):
while 1:
if n ==0 or n==1:
return 1
else:
if X[n] != 0:
return X[n]
else:
X[n] =fib(n-1)+fib(n-2)
return X[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,114 |
s786054417 | p02233 | u695386605 | 1597039904 | Python | Python3 | py | Accepted | 20 | 5600 | 336 | n = int(input())
data = []
x = []
if n == 0:
print('1')
data.append(1)
if n == 1:
print('1')
data.append(1)
if n >= 2:
for i in range(2, n+1):
#print(sum(data[i-2:i+1]))
#print(data[1])
#data.append(data[i])
x = sum(data[i-2:i+1])
data.append(x)
#print(i, x)
i = i +... | 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,115 |
s415393239 | p02233 | u733357255 | 1596998248 | Python | Python3 | py | Accepted | 20 | 5600 | 99 | n = int(input())
f = [1,1]
for i in range(2,n+1):
f.append(f[i-2] + f[i-1])
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,116 |
s425430289 | p02233 | u793520502 | 1596946117 | Python | Python3 | py | Accepted | 20 | 5604 | 278 | import sys
input = sys.stdin.readline
m = [1, 1] + [None]*50
def fibonacci(n):
if m[n-2]:
pass
else:
fibonacci(n-2)
if m[n-1]:
pass
else:
fibonacci(n-1)
m[n] = m[n-1] + m[n-2]
N = int(input())
fibonacci(44)
print(m[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,117 |
s810936147 | p02233 | u574841425 | 1596865661 | Python | Python3 | py | Accepted | 30 | 6372 | 279 | from collections import deque
from enum import Enum
import sys
import math
BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
table = [0] * 45
table[0] = 1
table[1] = 1
for i in range(2,45):
table[i] = table[i-1]+table[i-2]
N = int(input())
print("%d"%(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,118 |
s842211989 | p02233 | u743876353 | 1596831321 | Python | Python3 | py | Accepted | 20 | 5608 | 263 | # coding: utf-8
# Your code here!
def fibo(n):
if n==0:
return 1
if n==1:
return 1
if memo[n] != 0:
return memo[n]
memo[n]=fibo(n-1)+fibo(n-2)
return memo[n]
n=int(input())
memo=[0 for i in range(n+1)]
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,119 |
s941214194 | p02233 | u392970366 | 1596671717 | Python | Python3 | py | Accepted | 20 | 5604 | 131 | import sys
input = sys.stdin.readline
n = int(input())
F = [1]*50
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,120 |
s382357894 | p02233 | u421274895 | 1596631297 | Python | Python3 | py | Accepted | 20 | 5600 | 141 | #(40)フィボナッチ数列
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,121 |
s826631285 | p02233 | u309196579 | 1596612255 | Python | Python3 | py | Accepted | 20 | 5604 | 131 | import sys
input = sys.stdin.readline
n = int(input())
F = [1]*50
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,122 |
s211638226 | p02233 | u969835950 | 1596611972 | Python | Python3 | py | Accepted | 20 | 5596 | 153 | def fib(n):
if n==0 or n==1:
return 1
x=[1,1]
for i in range(2,n+1):
x.append(x[i-1]+x[i-2])
return x[-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,123 |
s828202567 | p02233 | u000551081 | 1596551641 | Python | Python3 | py | Accepted | 20 | 5596 | 97 | a=int(input())
n=[0]*(a+1)
n[0]=1
n[1]=1
for i in range(2,a+1):
n[i]=n[i-1]+n[i-2]
print(n[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,124 |
s564646890 | p02233 | u848597983 | 1596535609 | Python | Python3 | py | Accepted | 20 | 5600 | 147 | n = int(input())
fib_ls = [0] * (n+1)
fib_ls[0], fib_ls[1] = 1,1
for i in range(2,n+1):
fib_ls[i] = fib_ls[i-1] + fib_ls[i-2]
print(fib_ls[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,125 |
s306534670 | p02233 | u918533241 | 1596501165 | Python | Python3 | py | Accepted | 20 | 5600 | 105 | n=int(input())
num=[1,1]
for i in range(43):
b=(num[-2])+(num[-1])
num.append(b)
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,126 |
s661587095 | p02233 | u879371540 | 1596467466 | Python | Python3 | py | Accepted | 20 | 5604 | 142 | import sys
n = int(input())
if n < 2:
print(1)
sys.exit()
a, b = 1, 1
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,127 |
s949844154 | p02233 | u919773430 | 1596460699 | Python | Python3 | py | Accepted | 20 | 5604 | 131 | import sys
input = sys.stdin.readline
n = int(input())
F = [1]*50
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,128 |
s536132881 | p02233 | u204119336 | 1596439988 | Python | Python3 | py | Accepted | 20 | 5600 | 100 | N=int(input())
D=[0]*(N+1)
D[0]=1
D[1]=1
for i in range(2,N+1):
D[i]=D[i-1]+D[i-2]
print(D[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,129 |
s100046531 | p02233 | u056263240 | 1596429891 | Python | Python3 | py | Accepted | 20 | 5600 | 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,130 |
s817517684 | p02233 | u896809383 | 1596384564 | 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,131 |
s659529144 | p02233 | u900012957 | 1596369843 | Python | Python3 | py | Accepted | 20 | 5600 | 118 | 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,132 |
s914523680 | p02233 | u914515588 | 1596346951 | Python | Python3 | py | Accepted | 40 | 7112 | 1,195 | import sys, os, math, bisect, itertools, collections, heapq, queue, copy, array
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
# from decimal import Decimal
# from collections import defaultdict, deque
sys.setrecursionlimit(10000000)
ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = ... | 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,133 |
s337799524 | p02233 | u529477970 | 1596330043 | Python | Python3 | py | Accepted | 20 | 5592 | 59 | a=b=1
for i in range(int(input())):
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,134 |
s583924755 | p02233 | u834258010 | 1596329802 | Python | Python3 | py | Accepted | 20 | 5588 | 59 | a=b=1
for i in range(int(input())):
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,135 |
s215879363 | p02233 | u782152619 | 1596302272 | Python | Python3 | py | Accepted | 20 | 5592 | 74 | 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,136 |
s115497192 | p02233 | u082412851 | 1596263709 | Python | Python3 | py | Accepted | 20 | 5596 | 153 | 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,137 |
s879329780 | p02233 | u574014462 | 1596261090 | Python | Python3 | py | Accepted | 20 | 5604 | 283 | def fib(n):
if n == 0 or n == 1:
return 1
else:
seq = [0 for _ in range(n+1)]
seq[0], seq[1] = 1, 1
for i in range(2,n+1):
seq[i] = seq[i-1] + seq[i-2]
return seq[n]
if __name__ == '__main__':
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,138 |
s646497659 | p02233 | u413704014 | 1596182640 | Python | Python3 | py | Accepted | 20 | 5600 | 213 | n = int(input())
def Fib(n):
a, b = 0, 1
if n == 0:
return a + 1
elif n == 1:
return b
else:
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,139 |
s722166064 | p02233 | u525205447 | 1596028250 | Python | Python3 | py | Accepted | 20 | 5600 | 137 | N = int(input())
dp = [0]*50
for i in range(N+1):
if i < 2:
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,140 |
s841079849 | p02233 | u104259918 | 1596026151 | Python | Python3 | py | Accepted | 20 | 5608 | 308 | # -*- coding: utf-8 -*-
# 標準入力を取得
n = int(input())
# 求解処理
# dp[i+1]: フィボナッチ数列の第i項
dp = [0 for _ in range(n + 1)]
# 初期条件
dp[0] = 1
dp[1] = 1
for i in range(1, n):
# DP漸化式
dp[i + 1] = dp[i] + dp[i - 1]
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,141 |
s350126314 | p02233 | u037566157 | 1596018048 | Python | Python3 | py | Accepted | 20 | 5600 | 177 | a=1
b=1
c=[]
n = int(input())
c.append(a)
c.append(b)
for i in range(n-1):
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,142 |
s287322843 | p02233 | u438043982 | 1595895952 | Python | Python3 | py | Accepted | 20 | 5588 | 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,143 |
s596027655 | p02233 | u677563181 | 1595857215 | Python | Python3 | py | Accepted | 20 | 5600 | 118 | 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,144 |
s282310521 | p02233 | u868699775 | 1595834689 | Python | Python3 | py | Accepted | 20 | 5592 | 343 | import sys
read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7
def main():
N = int(readline())
dp = [0] * 47
dp[0] = 1
dp[1] = 1
for i in range(2,N+1):
dp[i] = dp[i-1] + dp[i-2]
print(dp[N])
if __name__ == '_... | 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,145 |
s951657254 | p02233 | u319403848 | 1595830857 | Python | Python3 | py | Accepted | 20 | 5596 | 68 | 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,146 |
s350582428 | p02233 | u210251354 | 1595767301 | Python | Python3 | py | Accepted | 20 | 5600 | 182 | n = int(input())
dict = {0:1,1:1}
def fib(n):
if n in dict.keys():
return dict[n]
else:
dict[n] = fib(n-1) + fib(n-2)
return dict[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,147 |
s766606298 | p02233 | u510165924 | 1595745935 | Python | Python3 | py | Accepted | 20 | 5596 | 100 | n = int(input())
dp = [1]*45
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,148 |
s291972746 | p02233 | u924938296 | 1595741389 | Python | Python3 | py | Accepted | 20 | 5600 | 172 | n=int(input())
def func(n):
fibonacci = [1,2]
for i in range(2,n):
fibonacci.append(fibonacci[i-2]+fibonacci[i-1])
return fibonacci[n-1]
print(func(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,149 |
s621057096 | p02233 | u847316328 | 1595651943 | Python | Python3 | py | Accepted | 20 | 5600 | 160 | n = int(input())
fib = [0]*(n+1)
fib[0] = 1
fib[1] = 1
if n<=1:
print(fib[n])
exit()
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,150 |
s142861156 | p02233 | u635020217 | 1595494509 | Python | Python3 | py | Accepted | 20 | 5604 | 201 | # coding: utf-8
# Your code here!
n = int(input())
m = [1,1]
if n == 0:
print(1)
elif n == 1:
print(1)
else:
for i in range(2, n+1):
m.append( m[i-1] + m[i-2] )
print(m.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,151 |
s257245249 | p02233 | u100874602 | 1595429869 | Python | Python3 | py | Accepted | 20 | 5596 | 118 | 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,152 |
s686974468 | p02233 | u965173609 | 1595397229 | Python | Python3 | py | Accepted | 20 | 5600 | 207 | 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,153 |
s745935327 | p02233 | u820092408 | 1595255647 | Python | Python3 | py | Accepted | 20 | 5596 | 107 | n = int(input())
memo = [1]*(n+1)
for i in range(2, n+1):
memo[i] = memo[i-1]+memo[i-2]
print(memo[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,154 |
s900418058 | p02233 | u118506623 | 1595226129 | Python | Python3 | py | Accepted | 20 | 5600 | 127 | n = int(input())
a =[1,1]
if n < 2:
pass
else:
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,155 |
s578304446 | p02233 | u413645175 | 1595215020 | 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,156 |
s997406183 | p02233 | u355413291 | 1595171453 | Python | Python3 | py | Accepted | 20 | 5600 | 122 | fib=[0]*45
fib[0]=1
fib[1]=1
n=int(input())
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,157 |
s512424704 | p02233 | u829520323 | 1595171290 | Python | Python3 | py | Accepted | 20 | 5600 | 122 | fib=[0]*45
fib[0]=1
fib[1]=1
n=int(input())
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,158 |
s803161744 | p02233 | u633358233 | 1595170961 | Python | Python3 | py | Accepted | 20 | 5600 | 122 | fib=[0]*45
fib[0]=1
fib[1]=1
n=int(input())
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,159 |
s247491187 | p02233 | u864060739 | 1595027662 | Python | Python3 | py | Accepted | 20 | 5596 | 237 | N = int(input())
memolist = [-1]*(N+1)
def fib(x):
if memolist[x] == -1:
if x == 0 or x == 1:
memolist[x] = 1
else:
memolist[x] = fib(x - 1) + fib(x - 2)
return memolist[x]
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,160 |
s493709586 | p02233 | u554271288 | 1594978904 | Python | Python3 | py | Accepted | 20 | 5600 | 244 | f=[0]*45
f[0]=f[1]=1
def fib(n):
if n ==0 or n==1:
return 1
else:
if f[n] == 0:
f[n] = fib(n-1)+fib(n-2)
return f[n]
else:
return f[n-1]+f[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,161 |
s836927817 | p02233 | u170051165 | 1594953008 | Python | Python3 | py | Accepted | 20 | 5604 | 236 | import sys
input = sys.stdin.readline
def fib2(n):
n0,n1 = 1,1
ans = 1
for i in range(2,n+1):
n0,n1 = n1,ans
ans = n0 + n1
return ans
if __name__ == "__main__":
n = int(input())
print(fib2(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,162 |
s885509169 | p02233 | u069030680 | 1594897109 | Python | Python3 | py | Accepted | 30 | 5596 | 118 | N = int(input())
one = 1
two = 1
for _ in range(1, N):
three = one + two
one, two = two, three
print(two)
| 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,163 |
s863172051 | p02233 | u053277556 | 1594764313 | Python | Python3 | py | Accepted | 20 | 5604 | 233 | n = int(input())
dp = [None for _ in range(n+1)]
def fib(i):
if dp[i] is not None:
return dp[i]
if i==0:
return 1
if i==1:
return 1
dp[i] = fib(i-1) + fib(i-2)
return dp[i]
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,164 |
s576340057 | p02233 | u108855621 | 1594755725 | Python | Python3 | py | Accepted | 20 | 5596 | 187 | def main():
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])
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,165 |
s220265256 | p02233 | u593595530 | 1594686338 | Python | Python3 | py | Accepted | 20 | 5596 | 110 | n=int(input())
num=[1,1]
for i in range(43):
b=(num[-2])+(num[-1])
num.append(b)
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,166 |
s211241687 | p02233 | u329155726 | 1594643390 | Python | Python3 | py | Accepted | 20 | 5600 | 134 | n = int(input())
p = [1,1]
if n <= 1:
print (1)
exit (0)
for i in range(2,n+1):
p.append(p[i-2] + p[i-1])
print (p[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,167 |
s912026905 | p02233 | u684583233 | 1594629535 | Python | Python3 | py | Accepted | 20 | 5600 | 124 | lis=[]
lis.append(1)
lis.append(1)
for i in range(2,45):
lis.append(lis[i-1]+lis[i-2])
n = int(input())
print(lis[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,168 |
s291771081 | p02233 | u272062354 | 1594624300 | Python | Python3 | py | Accepted | 20 | 5600 | 281 | a=[0]*45
def Fib(n):
if n == 0:
a[0]=1
return 1
elif n == 1:
a[1]=1
return 1
else:
if a[n]==0:
a[n]=Fib(n-1)+Fib(n-2)
return a[n]
else:
return a[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,169 |
s183426231 | p02233 | u034153923 | 1594619354 | Python | Python3 | py | Accepted | 20 | 5600 | 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,170 |
s056919492 | p02233 | u555228137 | 1594609060 | Python | Python3 | py | Accepted | 20 | 5608 | 208 | def fib(n,memo={}):
if n==0 or 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]
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,171 |
s525312981 | p02233 | u293306835 | 1594567013 | Python | Python3 | py | Accepted | 20 | 5596 | 92 | n = int(input())
F = [1]*50
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,172 |
s693349485 | p02233 | u508539251 | 1594464429 | Python | Python3 | py | Accepted | 20 | 5600 | 163 | n = int(input())
d = {0:1,1:1}
def calc(n):
if n not in d:
d[n] = calc(n-2)+calc(n-1)
return d[n]
for i in range(n):
calc(i)
print(calc(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,173 |
s184637863 | p02233 | u757541954 | 1594392841 | Python | Python3 | py | Accepted | 30 | 6292 | 186 | from functools import lru_cache
n = int(input())
@lru_cache(maxsize=None)
def rec(n):
if n <= 1:
return 1
else:
return rec(n - 1) + rec(n - 2)
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,174 |
s191832881 | p02233 | u630948380 | 1594376785 | Python | Python3 | py | Accepted | 20 | 5600 | 147 | def fib(n):
a=[1,1]
for i in range(2,n+1):
a.append(a[i-2]+a[i-1])
i+=1
return a[-1]
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,175 |
s883645462 | p02233 | u434132766 | 1594328437 | Python | Python3 | py | Accepted | 20 | 5600 | 123 | 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,176 |
s090821832 | p02233 | u075087498 | 1594300970 | Python | Python3 | py | Accepted | 20 | 5600 | 93 | n=int(input())
fib=[1,1]
for i in range(2,n+1):
fib.append(fib[-1]+fib[-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,177 |
s044346107 | p02233 | u802474686 | 1594295511 | Python | Python3 | py | Accepted | 20 | 5604 | 121 | n=int(input())
dp=[0 for _ in range(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,178 |
s136037428 | p02233 | u455994792 | 1594257748 | Python | Python3 | py | Accepted | 20 | 5588 | 221 | A=1
B=1
C=0 #2つ前の項
D=0 #1
N=int(input())
if N==0 or N==1:
print(1)
elif N==2:
print(2)
else:
C=B #1
D=A+B #2
for i in range (N-3):
B=C
C=D
D=B+C
print(C+D)
| 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,179 |
s612437034 | p02233 | u040807768 | 1594207219 | Python | Python3 | py | Accepted | 20 | 5600 | 94 | N = int(input())
dp = {0:1,1:1}
for i in range(1,N):
dp[i+1] = 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,180 |
s116994492 | p02233 | u684853980 | 1594178477 | Python | Python3 | py | Accepted | 20 | 5600 | 166 | n = int(input())
dp = [0]*(n+1)
def fibo(n):
if n <2:
return 1
if dp[n] > 0:
return dp[n]
dp[n] = fibo(n-1) + fibo(n -2)
return dp[n]
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,181 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.