s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time stringlengths 1 5 | memory stringlengths 1 7 | code_size stringlengths 1 6 | code stringlengths 1 539k |
|---|---|---|---|---|---|---|---|---|---|---|---|
s744920074 | p03544 | u951480280 | 1567477846 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 126 | num = list(range(86))
num[0] = 2
num[1] = 1
for i in range(2,86):
num[i] = num[i-2] + num[i-1]
print(num[int(input())])
|
s594268439 | p03544 | u655048024 | 1567367358 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3188 | 136 | N = int(input())
i = 2
m = 2
n = 1
ans = 0
while True:
ans = m + n
if(i == N):
break
k = m
m = ans
n = k
print(l[-1])
|
s141775176 | p03544 | u346629192 | 1567102935 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 93 | N = int(input())
L0 = 2
L1 = 1
for i in range(N-1):
L = L0 + L1
L0,L1 = L1,L
print(L) |
s420334795 | p03544 | u703890795 | 1567060666 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 115 | N = int(input())
L = [0 for i in range(N)]
L[0]=2
L[1]=1
for i in range(2, N):
L[i] = L[i-1]+L[i-2]
print(L[N-1]) |
s110109419 | p03544 | u521866787 | 1566874554 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 106 | N = int(input())
a =[0]*86
a[0] = 2
a[1] = 1
for i in range(2,86):
a[i]=a[i-2]+a[i-1]
print(a[N] )
|
s170061656 | p03544 | u948524308 | 1566427445 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 149 | N = int(input())
L = [0] * (N + 1)
L[0] = 2
L[1] = 1
if N ==1:
print(L[1])
for i in range(2, N + 1):
L[i] = L[i - 2] + L[i - 1]
print(L[i]) |
s173429917 | p03544 | u948524308 | 1566427349 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 124 | N = int(input())
L = [0] * (N + 1)
L[0] = 2
L[1] = 1
for i in range(2, N + 1):
L[i] = L[i - 2] + L[i - 1]
print(L[i])
|
s056540184 | p03544 | u661983922 | 1566179235 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 102 | N = int(input())
L0 = 2
L1 = 1
for i in range(N-1):
ans = L0 + L1
L0 = L1
L1 = ans
print(ans) |
s959582956 | p03544 | u248670337 | 1565794862 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 56 | a,b=2,1
for i in range(int(input()):a,b=b,(a+b)
print(a) |
s852031796 | p03544 | u753803401 | 1565646010 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 90 | l = [2, 1]
for i in range(2, int(input()) + 1)
l.append(l[i-1] + l[i-2])
print(l[-1])
|
s545933741 | p03544 | u647522078 | 1565430428 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 116 | n = int(input())
tmp1 = 2
tmp2 = 1
for i in range(n-1):
luc = tmp1 + tmp2
tmp1,tmp2 = tmp2,luc
print(luc)
|
s227276918 | p03544 | u797016134 | 1564701174 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 131 | def ryuka(n):
if n == 0:
return 2
elif n == 1:
return 1
return ryuka(n-1) + ryuka(n-2)
print(ryuka(n)) |
s063758878 | p03544 | u626337957 | 1564375106 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 112 | N = input()
dp = [0] * (87)
dp[0] = 2
dp[1] = 1
for i in range(2, N+1):
dp[i] = dp[i-1] + dp[i-2]
print(dp[N]) |
s648581778 | p03544 | u882359130 | 1563292020 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 113 | N = int(input())
L_i2 = 2
L_i1 = 1
for n in range(N-1):
L_i = L_i1 + L_i2
L_i2 = L_i1
L_i1 = L_i
print(L_i) |
s404344297 | p03544 | u668503853 | 1563111606 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 82 | n=int(input())
L=[2,1]
for i in range(n):
l=L[i]+[i+1]
L.append(l)
print(L)
|
s485512721 | p03544 | u792217717 | 1562700453 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 104 | n = int(input())
l1 = 2
l2 = 1
for i in range(1, n):
l3 = l1 + l2
l1 = l2
l2 = l3
print(l3)
|
s067501175 | p03544 | u448655578 | 1562479310 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 115 | N = int(input())
ans = [2,1]
for i in range(2,N):
a = ans[i-2] + ans[i-1]
ans.append(a)
print(ans[len(ans)])
|
s002323425 | p03544 | u314050667 | 1562004921 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 95 | n = int(input())
l2 = 2
l1 = 1
for i in range(2,n+1):
l = l2+l1
l2=l1
l1=l
print(l) |
s020435520 | p03544 | u671252250 | 1561993410 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 175 | # coding: utf-8
# Your code here!
#動的計画法
N = int(input())
Ni_2 = 2
Ni_1 = 1
for i in range(2, N + 1):
Ni = Ni_1 + Ni_2
Ni_2 = Ni_1
Ni_1 = Ni
print(Ni)
|
s957083275 | p03544 | u790812284 | 1561962332 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 203 | def lucas(n):
if n==0:
return 2
elif n==1:
return 1
else:
return lucas(n-1)+lucas(n-2)
n= int(input())
l=((1+math.sqrt(5))/2)**n+((1-math.sqrt(5))/2)**n
print(int(l)) |
s183915644 | p03544 | u681444474 | 1561059865 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 124 | N= int(input())
L=[0]*(N+1)
a=2
b=1
for i in range(1,N+1):
L[0]=2
L[1]=1
L[i]=L[i-1]+L[i-2]
print(L[N]) |
s040391705 | p03544 | u556589653 | 1560533151 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 323 | N,M,C = map(int,input().split())
B = list(map(int,input().split()))
K = []
S = 0
ans = 0
J = []
for i in range(N):
K.append(list(map(int,input().split())))
for i in range(N):
for j in range(M):
S += K[i][j]*B[j]
S = S + C
J.append(S)
for i in range(N):
if J[i] >0:
ans += 1
else:
ans += 0
print(a... |
s663424938 | p03544 | u556589653 | 1560531515 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 91 | N = int(input())
L0 = 2
L1 = 1
for i in range(N-1):
M = L0+L1
L0 = L1
L1 = M
print(M) |
s986233243 | p03544 | u556589653 | 1560531426 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 91 | N = int(input())
L0 = 2
L1 = 1
for i in range(N-1):
M = L0+L1
L0 = L1
L1 = M
print(M) |
s955190944 | p03544 | u193598069 | 1560309863 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 114 | N = int(input())
L = [ 0 ] * 86
L[0] = 2
L[1] = 1
for i in range(2, N+1):
L[i] = L[i-2] + L[i-1]
print (L[N]) |
s463070640 | p03544 | u193598069 | 1560309641 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 120 | N = int(input())
L = [ 0 ] * 86
L[0] = 2
L[1] = 1
for i in range(2, N):
L[i] = L[i-2] + L[i-1]
print (L[N])
|
s093377119 | p03544 | u430223993 | 1559946091 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 107 | n = int(input())
f = [0] * n
f[0] = 2
f[1] = 1
for i in range(2,n):
f[i] = f[i-1] + f[i-2]
print(f[-1]) |
s904264940 | p03544 | u778814286 | 1559690080 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 159 | n = int(input())
if n = 0:
print(2)
exit()
if n = 1:
print(1)
exit()
xx = 2
x = 1
for i in range(n-1):
ans = xx + x
xx = x
x = ans
print(ans) |
s506748953 | p03544 | u194894739 | 1559367266 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 167 | N = int(input())
if N == 0:
print(2)
elif N == 1:
print(1)
exit()
L0 = 2; L1 = 1
for _ in range(N-2):
L2 = L1 + L0
L1, L0 = L2, L1
print(L2)
|
s583192453 | p03544 | u360116509 | 1559268006 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 158 | def main():
N = int(input())
la = 2
lb = 1
for _ in range(N - 1):
lc = la + lb
la = lb
lb = lc
print(lc)
main()
|
s802753619 | p03544 | u405256066 | 1559107044 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 226 | from sys import stdin
N = int(tdin.readline().rstrip())
Lucas_number = [0]*(N+1)
Lucas_number[0] = 2
Lucas_number[1] = 1
for i in range(2,N+1):
Lucas_number[i] = Lucas_number[i-1] + Lucas_number[i-2]
print(Lucas_number[N]) |
s412169908 | p03544 | u405256066 | 1559107011 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 223 | from sys import stdin
N = (tdin.readline(),rstrip())
Lucas_number = [0]*(N+1)
Lucas_number[0] = 2
Lucas_number[1] = 1
for i in range(2,N+1):
Lucas_number[i] = Lucas_number[i-1] + Lucas_number[i-2]
print(Lucas_number[N]) |
s325913022 | p03544 | u007550226 | 1558477003 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 114 | N = int(input())
pre2 = 2
pre1 = 1
for i in range(2,N+1):
l = pre2 + pre1
pre2,pre1 = pre1,l
else:print(l) |
s644915772 | p03544 | u728498511 | 1558227057 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 93 | input(); a = sorted(map(int, input().split()), reverse=True)
print(sum(a[0::2])-sum(a[1::2])) |
s687552707 | p03544 | u330314953 | 1558129285 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 137 | n = int(input())
l = [2,1]
if n == 1:
print(1)
else:
for i in range(2,n+1):
l.append(int(l[i-1] +l[i-2]))
print(l[n])
|
s877921627 | p03544 | u330314953 | 1558129249 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 137 | n = int(input())
l = [2,1]
if n == 1:
print(1)
else:
for i in range(2,n+1):
l.append(int(l[i-1] +l[i-2]))
print(l[n])
|
s423216042 | p03544 | u767664985 | 1556257754 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 148 | N = int(input())
L = [0] * 86 # 86は制約から
L[0] = 2
L[1] = 1
if N >= 2:
for i in range(2, N + 1):
L[i] = L[i - 1] + L[i - 2]
print(L[N])
|
s595349463 | p03544 | u163320134 | 1555152072 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 113 | n=int(input())
list=[0]*n
list[0]=2
list[1]=1
for i in range(2,n):
list[i]=list[i-1]+list[i-2]
print(list[n-1]) |
s605645678 | p03544 | u501163846 | 1555018262 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 144 | n=int(raw_input())
if n==0:
print(2)
elif n==1:
print(1)
else:
ln=[2,1]
for i in range(2,n+1):
ln.append(ln[i-1]+ln[i-2])
print(ln[-1])
|
s428944398 | p03544 | u363610900 | 1554349490 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 102 | N = int(input())
L = [2, 1]
for i in range(2, N+1):
l = L[i-1] + L[i - 2]
L.append(l)
print(l) |
s106909765 | p03544 | u864900001 | 1553974349 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 214 | n = int(input())
if n==0:
print(2)
elif n==1:
print(1)
else:
temp1 = 2
temp2 = 1
ans = 0
for i in range(n-1):
ans = temp1 + temp2
temp1 = temp2
temp2 = ans
print(ans) |
s737797274 | p03544 | u865413330 | 1552425067 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 153 | n = int(input())
def calcLucas(n):
if n == 0:
return 2
if n == 1:
return 1
return calc(n-1) + calc(n-2)
print(calcLucas(n)) |
s754239994 | p03544 | u652081898 | 1551365371 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1049 | n = int(input())
LUKAS = [0, 2, 1, 3, 4, 7, 11, 18, 29, 47, 76, 123, 199, 322, 521, 843, 1364, 2207, 3571, 5778, 9349, 15127, 24476, 39603, 64079, 103682, 167761, 271443, 439204, 710647, 1149851, 1860498, 3010349, 4870847, 7881196, 12752043, 20633239, 33385282, 54018521, 87403803, 141422324, 228826127, 370248451, 59907... |
s214372054 | p03544 | u721316601 | 1550779313 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 102 | N = int(input())
L0 = 2
L1 = 1
for i in range(N-1):
L = L0 + L1
L0 = L1
L1 = L
print(L) |
s637058984 | p03544 | u543954314 | 1550329566 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 135 | def luca(n):
if n == 2:
return 1
elif n == 1:
return 2
luca(n) = luca(n-1) + luca(n-2)
return
print(luca(int(input())) |
s740960999 | p03544 | u543954314 | 1550329502 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 135 | def luca(n):
if n == 2:
return 1
elif n == 1:
return 2
luca(n) = luca(n-1) + luca(n-2)
return
print(luca(int(input())) |
s877386413 | p03544 | u174394352 | 1549517720 | Python | PyPy3 (2.4.0) | py | Runtime Error | 174 | 38768 | 296 | def memoize(f):
cache={}
def helper(*args):
if args not in cache:
cache[args] = f(*args)
return cache[args]
return helper
@memoize
def ans(N):
if N==0:
return 1
elif N==1:
return 2
else:
return ans(N-1)+ans(N-2)
N=int(input())
print(ans(N)) |
s205323602 | p03544 | u175034939 | 1548536078 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 90 | n = int(input())
a = 2
b = 1
for i in range(n-1):
c = a+b
a = b
b = c
print(c) |
s988222910 | p03544 | u620945921 | 1547524820 | Python | Python (3.4.3) | py | Runtime Error | 20 | 2940 | 84 | n=int(input())
l=[2,1]
for i in range(2,86):
l.append(l[i-1]+l[i-2])
print(l[n]) |
s383126993 | p03544 | u063052907 | 1545862944 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 115 | # coding: utf-8
N = int(input())
L0 = 2
L1 = 1
for _ in range(N-1):
L = L0 + L1
L0 = L1
L1 = L
print(L) |
s309730423 | p03544 | u173329233 | 1544972241 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 101 | n = int(input())
l0 = 2
l1 = 1
for i in range(n-1):
l = l0 + l1
l0 = l1
l1 = l
print(l)
|
s277708880 | p03544 | u397531548 | 1544840042 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 74 | n=int(input())
a=2
b=1
c=0
for i in range(N):
c=a+b
a=b
b=c
print(c) |
s883382703 | p03544 | u601522790 | 1543522832 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 125 | n = int(input())
l = [2,1]
if n == 0 or n == 1:
print(l[n])
for i in range(2,n):
l.append(l[i - 1] + l[i -2])
print(l[n]) |
s612322358 | p03544 | u601522790 | 1543522720 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 116 | n = int(input())
l = [2,1]
if n == 0 or n == 1:
print(l[n])
for i in n:
l.append(l[i - 1] + l[i -2])
print(l[n]) |
s950872938 | p03544 | u601522790 | 1543522641 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 136 | n = int(input())
l = [10^18]
l[0] = 2
l[1] = 1
if n == 0 or n == 1:
print(l[n])
for i in n:
l.append(l[i - 1] + l[i -2])
print(l[n]) |
s297763551 | p03544 | u601522790 | 1543522518 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 128 | n = int(input())
l = []
l[0] = 2
l[1] = 1
if n == 0 or n == 1:
print(l[n])
for i in n:
l[i] = l[i - 1] + l[i -2]
print(l[n]) |
s157968785 | p03544 | u518556834 | 1539910563 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 159 | def lucas(n):
if n == 0:
return 2
elif n == 1:
return 1
else:
a = lucas(n-1)
b = lucas(n-2)
c = a+b
return(c)
print(lucas(n))
|
s110681478 | p03544 | u933622697 | 1539779910 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 540 | def get_new_lucas(l_i_1, l_i_2):
"""
get a new Lucas number L_i
l_i_1: L_(i-1),
l_i_2: L_(i-2)
"""
return l_i_1 + l_i_2
def main():
n = int(input())
tmp_l_i_1 = 1
tmp_l_i_2 = 2
for i in range(1, n):
if i == 1:
new_lucas_num = get_new_lucas(tmp_l_i_1, tmp_l_... |
s500903731 | p03544 | u513081876 | 1539206192 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 87 | N = int(input())
L = = [2, 1]
for i in range(87):
L.append(L[i]+L[i+1])
print(L[N]) |
s121805379 | p03544 | u525423408 | 1536001717 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 116 | n=int(input())
a=2
b=1
if n==1:
print(1)
else:
for i in range(2,n+1):
c=a+b
a,b=b,c
print(c) |
s040930417 | p03544 | u185688520 | 1535868413 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 275 | n = int(input())
l0 = 2
l1 = 1
if n == 0:
print(l0)
return
if n == 1:
print(l1)
return
l_prev = l0
l_next = l1
i = 2
while True:
l_new = l_prev + l_next
if n == i:
print(l_new)
break
l_prev = l_next
l_next = l_new
i += 1
|
s804570910 | p03544 | u185688520 | 1535868074 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 157 | n = int(input())
l_prev = l0
l_next = l1
l_new = 0
for i in range(2, n+1):
l_new = l_prev + l_next
l_prev = l_next
l_next = l_new
print(l_new)
|
s548162145 | p03544 | u185688520 | 1535867946 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 225 | n = long(input())
l0 = 2L
l1 = 1L
if n == 0:
print(l0)
if n == 1:
print(l1)
l_prev = l0
l_next = l1
l_new = 0L
for i in range(2, n+1):
l_new = l_prev + l_next
l_prev = l_next
l_next = l_new
print(l_new)
|
s526942273 | p03544 | u123756661 | 1531798214 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 65 | l=[2,1]
for i in range(85):
l.append(l[-1]+l[-2])
n=int(input |
s195574593 | p03544 | u820351940 | 1530992908 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 199 | import numpy as np
n = int(input())
init = np.expand_dims(np.array([2, 1]), 0)
to_next = np.array([
[1, 1],
[1, 2],
])
for i in range(n // 2):
init = init @ to_next
print(init[0][n & 1])
|
s680133694 | p03544 | u986269893 | 1529614111 | Python | PyPy3 (2.4.0) | py | Runtime Error | 166 | 38640 | 124 | n=int(input())
def lucas(n):
if n=0:
return 2
if n=1:
return 1
if n>1:
return lucas(n-1)+lucas(n-2)
print(lucas(n)) |
s682149208 | p03544 | u186426563 | 1526326816 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 142 | n = int(input())-1
a, b = 2, 1
if(n==0):
print(2)
elif(n==1):
print(1)
while(n):
c = a + b
a = b
b = c
n -= 1
print(c) |
s961392964 | p03544 | u111202730 | 1526176700 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 273 | x = input()
x = int(x)
answer = []
for p in range(2, 7):
for i in range(1, x):
test = i**p
if test > x:
answer.append((i-1)**p)
break
elif test == x:
answer.append(i**p)
break
print(max(answer)) |
s019675080 | p03544 | u916806287 | 1525109320 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 101 | def fib(n):
a, b = 2, 1
for i in range(n):
a, b = b, a+b
print(b)
fib(int(input())-1) |
s828611930 | p03544 | u391875425 | 1523937734 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 108 | N = int(input())
L = [0]*100
L[0] = 2
L[1] = 1
for i in range(2,N+1):
L[i] = L[i-1] + L[i-2]
print(L[i]) |
s020557551 | p03544 | u319612498 | 1519447867 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 93 | n=int(input())
L=[2,1]
for i in range(n-1):
Lu=L[-1]+L[-2]
L.append(Lu)
print(Lu[-1]) |
s129225673 | p03544 | u594290430 | 1516812527 | Python | Python (3.4.3) | py | Runtime Error | 149 | 12396 | 125 | import numpy as np
a=np.zeros(87)
a[0]=2
a[1]=1
N=int(input())
for i in range(2,N+1):
a[i]=a[i-1]+a[i-2]
print(int(a[i])) |
s083020669 | p03544 | u865646085 | 1516745798 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 296 | import time
def fib(n):
memo = [0] * n
memo[0:2] = [2, 1]
for i in range(2, n):
memo[i] = memo[i - 1] + memo[i - 2]
return memo[i]
def main():
N = input()
if(N == 0):
print(2)
else:
print(fib(int(N)+1))
if __name__ == '__main__':
main()
|
s374209564 | p03544 | u865646085 | 1516745632 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 249 | import time
def fib(n):
memo = [0] * n
memo[0:2] = [2, 1]
for i in range(2, n):
memo[i] = memo[i - 1] + memo[i - 2]
return memo[i]
def main():
N = input()
print(fib(int(N)+1))
if __name__ == '__main__':
main()
|
s448002770 | p03544 | u350179603 | 1516509202 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 167 | n = int(input())
l0 = 2
l1 = 1
if n == 1:
print(l1)
else:
for i in range(2, n+1):
if i == 2:
li = l0
lj = l1
l = li + lj
li = lj
lj = l
print(l)
|
s550980308 | p03544 | u350179603 | 1516509127 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 167 | n = int(input())
l0 = 2
l1 = 1
if n == 1:
print(l1)
else:
for i in range(2, n+1):
if i == 2:
li = l0
lj = l1
l = li + lj
li = lj
lj = l
print(l)
|
s149323518 | p03544 | u350179603 | 1516508900 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 133 | n = int(input())
l0 = 2
l1 = 1
for i in range(2, n+1):
if i == 2:
li = l0
lj = l1
l = li + lj
li = lj
lj = l
print(l) |
s638065281 | p03544 | u401093859 | 1514778246 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 231 | N = int(input())
ryuka = [0]*86
ryuka[0] = 2
ryuka[1] = 1
def culc_ryuka(N, ryuka):
for i in range(2, N+1):
ryuka[i] = ryuka[i-1]+ryuka[i-2]
return ryuka
ryuka = culc_ryuka(N, ryuka)
print(ryuka[N])
|
s731210092 | p03544 | u046136258 | 1514007705 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 112 |
n=int(input())
rec=[2,1]
if n>=2:
for i in range(2,n):
rec.append(rec[i-2]+rec[i-1])
print(rec[n])
|
s801969971 | p03544 | u046136258 | 1514007603 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 91 | n=int(input())
rec=[2,1]
for i in range(2,n):
rec.append(rec[i-2]+rec[i-1])
print(rec[n]) |
s380254998 | p03544 | u744021017 | 1513399061 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 156 | N = int(input())
Lx = 2
Ly = 1
if N == 1:
print(Ly)
else:
for i in range(N-1):
tmp = Lx + Ly
Lx = Ly
Ly = tmp
print(tmp)
|
s495496751 | p03544 | u707500405 | 1512795674 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 121 | N = int(input())
l_im2, l_im1 = 2, 1
for i in range(2, N + 1):
l_i = l_im1 + l_im2
l_im1, l_im2 = l_i, l_im1
print(l_i) |
s101280025 | p03544 | u905872604 | 1512510369 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 193 | # N = list(map(int, input().split()))
# print(N[0], N[1], N[2])
# print(N[1])
# print(N[2])
N = int(input())
i = 2
a = 2
b = 1
while i <= N:
c = a + b
a = b
b = c
i = i + 1
print(c)
|
s605991952 | p03544 | u966000628 | 1512448710 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 124 | N = int(raw_input())
lis = [None]*86
lis[0] = 2
lis[1] = 1
for i in xrange(84):
lis[i+2] = lis[i-1] + lis[i]
print lis[N-1] |
s689496120 | p03544 | u048904090 | 1512265061 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 99 | N = raw_input()
L = [2, 1]
for i in range(2, N + 1):
L.append(L[i - 2] + L[i - 1])
print L[N] |
s962780069 | p03544 | u052363612 | 1511505047 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 325 | N = input()
# N = 86
def f(n):
if n == 0:
return 2
elif n == 1:
return 1
elif n == 2:
return 3
return 2 * f(n - 2) + f(n - 3)
def g(n):
L = [0] * (n + 1)
L[0] = 2
L[1] = 1
for i in range(2, n + 1):
L[i] = L[i - 1] + L[i - 2]
return L[-1]
print(g... |
s192909223 | p03544 | u813450984 | 1511115551 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 230 | N = int(input())
pre = 1
luca = 3
if N == 2:
print(4)
break
elif N == 1:
print(1)
break
elif N == 0:
print(2)
break
else:
for i in range(N - 2):
temp = luca
luca = pre + luca
pre = temp
print(luca) |
s918672723 | p03544 | u250157310 | 1511091679 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 2777 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long int ulli;
typedef long long int lli;
#define pb(a) push_back(a)
#define pbb(a) pop_back(a)
#define ph(a) push_heap(a.begin(), a.end())
#define pph(a) pop_heap(a.begin(), a.end())
#define si set<int>
... |
s543621626 | p03544 | u517327166 | 1511065730 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 101 | import sys
N = int(input())
L0=2
L1=1
for i in range(N-1):
temp=L0+L1
L0=L1
L1=temp
print(temp) |
s119952023 | p03544 | u865646085 | 1511062266 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 190 | import time
def fib(n):
memo = [0] * n
memo[0:2] = [2, 1]
for i in range(2, n):
memo[i] = memo[i - 1] + memo[i - 2]
return memo[i]
a = input()
print(fib(int(a)+1))
|
s611772891 | p03544 | u865646085 | 1511061906 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 190 | import time
def fib(n):
memo = [0] * n
memo[0:2] = [2, 1]
for i in range(2, n):
memo[i] = memo[i - 1] + memo[i - 2]
return memo[i]
a = input()
print(fib(int(a)+1))
|
s835600853 | p03544 | u619384481 | 1511061864 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2696 | 82 | a=input()
x=2
y=1
for i in range(a-1):
z=x+y
x=y
y=z
z=str(z)
print z |
s510072256 | p03544 | u619384481 | 1511061445 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 73 | a=input()
x=2
y=1
for i in range(a-1):
z=x+y
x=y
y=z
print z |
s649768970 | p03544 | u619384481 | 1511061251 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 73 | a=input()
x=2
y=1
for i in range(a-1):
z=x+y
x=y
y=z
print z |
s661229331 | p03544 | u227791232 | 1511059800 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 227 | #!/user/bin/python
# coding: UTF-8
N = int(raw_input())
L = [2, 1]
flag = 0
i = 0
while flag == 0:
l = 0
l = L[i] + L[i + 1]
L.append(l)
i = i + 1
print l
if l > 86:
flag = flag + 1
print L[N] |
s384703073 | p03544 | u767873777 | 1511059124 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3992 | 457 | # coding: utf-8
import math
def test(n,dict):
left = n - 1
right = n - 2
leftValue = 0
rightValue = 0
if left in dict:
leftValue = dict[left]
else:
leftValue = test(left, dict)
if right in dict:
rightValue = dict[right]
else:
rightValue = test(right, di... |
s782584741 | p03544 | u676264453 | 1511058992 | Python | PyPy3 (2.4.0) | py | Runtime Error | 164 | 38384 | 149 | N = int(input())
def fibn(a, b, k, n):
if k < n:
return fibn(b, a+b, k+1, n)
else:
return a+b
print(fibn(2,1,2,N))
|
s119672235 | p03544 | u867069435 | 1511058684 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 181 | import functools
@functools.lru_cache()
def f(n):
if n == 0:
return 2
elif n == 1:
return 1
else:
return f(n-1)+f(n-2)
print(f(int(input()) |
s634177037 | p03544 | u486232694 | 1511058608 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 92 | N = int(input())
L0, L1 = 2,1
for _ in range(N-1):
L = L0 + L1
L0, L1 = L1, L
print(L) |
s477611532 | p03544 | u486232694 | 1511058563 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 94 | N = int(input())
L0, L1 = 2,1
for _ in range(N-1):
L = L0 + L1
L0 = L1
L1 = L
print(L) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.