Closed ji-0630 closed 1 year ago
import math
def solution(n):
answer = 1
i = 1
while True:
s = n - 2*i
if s == 0:
answer += 1
break
elif s < 0:
break
else:
answer += int(math.factorial(s+i) // math.factorial(s) // math.factorial(i))
i += 1
return answer % 1234567
def jumpCase(num):
a, b = 0, 1
for i in range(2,num):
a, b = b, a+b
return b
문제 설명