from functools import lru_cache as cache
import sys
sys.setrecursionlimit(10000000)
# class blocks:
# def __init__(self):
# self.n = int(input())
# self.memo = [0]*10000000
# self.viewer(self.n)
#
# def viewer(self, k):
# print(self.fillBlock(k) % 100000007)
#
# def fillBlock(self, n):
# if n == 1:
# self.memo[n] = 1
# return self.memo[n]
# if n == 2:
# self.memo[n] = 2
# return self.memo[n]
# if n == 3:
# self.memo[n] = 3
# return self.memo[n]
#
# if self.memo[n] != 0:
# return self.memo[n]
#
# self.memo[n] = self.fillBlock(n-1)%100000007 + self.fillBlock(n-2)%100000007
# return self.memo[n]
#
# a = blocks()
# class block:
# def __init__(self, n):
# self.n = n
#
# def viewer(self, n):
# print(self.main(n) % 100007)
#
# def main(self):
#a = block(int(input()))
class block:
def __init__(self, n):
self.n = n
self.memo = [0]*10000000
self.viewer(n)
def viewer(self, n):
print(self.mainBlock(n)%100007)
def mainBlock(self, x):
if x == 1:
self.memo[x] = 1
return self.memo[x]
if self.memo[x]:
return self.memo[x]
self.memo[x] = self.mainBlock(x-3)%100007 + self.mainBlock(x-1)%100007
return self.memo[x]
a = block(int(input()))
top of page
기능을 테스트하려면 라이브 사이트로 이동하세요.
211221
211221
댓글 0개
좋아요
댓글(0)
bottom of page