d080: P_6_11 Catalan number
Tags : ch6
Accepted rate : 1人/1人 ( 100% ) [非即時]
評分方式:
Tolerant

最近更新 : 2022-11-25 18:33

Content

Catalan number的遞迴式定義:

$C_0 = 1$ and $\displaystyle C_n= \sum_{i=0}^{n-1} C_i \times C_{n-1-i}$ for $n \geq 1$


計算$C_n$ 除以 $P$ 的餘數,$P=10^9+9$。

Input

輸入一個非負整數 $n$,$n < 100$。

Output

$C_n$ 除以 $P$ 的餘數

Sample Input #1
3
Sample Output #1
5
Sample Input #2
20
Sample Output #2
564120366
測資資訊:
記憶體限制: 256 MB
公開 測資點#0 (20%): 1.0s , <1K
公開 測資點#1 (20%): 1.0s , <1K
公開 測資點#2 (20%): 1.0s , <1K
公開 測資點#3 (20%): 1.0s , <1K
公開 測資點#4 (20%): 1.0s , <1K
Hint :
Tags:
ch6
出處:
Prof. Wu [管理者:
ktlai (K.我已霸榜.Tlai)
]


ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」