




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、ACM程序設計程序設計n杭州電子科技大學 劉春英n 2022-4-62每周一星(每周一星(11):):杭電一名2022-4-63第十二講第十二講特殊的數特殊的數(Special Number)2022-4-64Fibonacci NumbernThe series begins with 0 and 1. After that, use the simple rule: Add the last two numbers to get the next. n0 , 1 , 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987,. L
2、eonardo Fibonacci 1175-1250 2022-4-65Key Words:Key Words:1225; 1225; Pisa;Pisa;Fibonacci & Fibonacci & Frederick II;Frederick II;Math Math Competition.Competition.Where this came Where this came from? from? 2022-4-66JanuaryJanuary2022-4-67February2022-4-68MarchMarch2022-4-69AprilApril2022-4-610MayMa
3、y、JuneJune?2022-4-611The number series isThe number series is1 1、1 1、2 2、3 3、55This is fibonacci numberThis is fibonacci number!Some other pictures2022-4-6122022-4-6132022-4-6142022-4-6152022-4-616Fibonacci & Golden SectionFibonacci & Golden Section2022-4-617Fibonacci & plants2022-4-618Fibonacci & p
4、lants2022-4-619Fibonacci & plants2022-4-620Fibonacci & plants2022-4-621sunflowers (向日葵)2022-4-6222022-4-6232022-4-6242022-4-625Question:Question:編程實現這類遞編程實現這類遞歸問題時應該注歸問題時應該注意什么問題?意什么問題?空間空間 換換 時間!時間!2022-4-626Catalan Catalan numbernumber2022-4-627HDOJ_1134: Game of HDOJ_1134: Game of Connections Con
5、nections 634251782022-4-628Catalan numbers (1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012, 742900, 2674440, 9694845, .)Catalan NumberCatalan Number(18141894 Belgium)(18141894 Belgium)2022-4-629CatalanCatalan數數有有哪哪些些應應用用? ?2022-4-6301. 1. 多邊形的三角剖分數目多邊形的三角剖分數目 4 sides, 2 ways2022-4-6315
6、sides, 5 ways2022-4-6326 sides, 14 ways2022-4-6337 sides, 42 ways:2022-4-6342. 2. 加括號的方式數目加括號的方式數目3 numbers: (1 (2 3) (1 2) 3)4 numbers: (1 (2 (3 4) (1 (2 3) 4) (1 2) (3 4) (1 (2 3) 4) (1 2) 3) 4)2022-4-635 (1 (2 (3 (4 5) (1 (2 (3 4) 5) (1 (2 3) (4 5) (1 (2 (3 4) 5) (1 (2 3) 4) 5) (1 2) (3 (4 5) (1
7、2) (3 4) 5) (1 (2 3) (4 5) (1 (2 (3 4) 5) (1 (2 3) 4) 5) (1 2) 3) (4 5) (1 2) (3 4) 5) (1 (2 3) 4) 5) (1 2) 3) 4) 5) 2022-4-6363.the number of rooted, trivalent 3.the number of rooted, trivalent trees with n+1 nodes trees with n+1 nodes 3 nodes:2022-4-6375 nodes: 4 nodes:2022-4-6384. the number of p
8、aths of length 2n through an n-by-n grid that do not rise above the main diagonal 2 x 2 grid:2022-4-6393 x 3 grid: 4 x 4 grid: 2022-4-6405. 不同形態(tài)二叉樹的數目 There are 5 binary trees with 3 nodes.There are 5 binary trees with 3 nodes.2022-4-6416. 其它應用(1 1)The number of ways 2n people, The number of ways 2n
9、 people, seated round a table, can shake seated round a table, can shake hands in n pairs, without their arms hands in n pairs, without their arms crossing. crossing. (2 2)The self-convolving sequence, The self-convolving sequence, c0=1, cn+1 = c0cn + c1cn-1 c0=1, cn+1 = c0cn + c1cn-1 + . + cnc0 + .
10、 + cnc0 2022-4-642(3) The recurring sequence c0=1, (n+2)cn+1 = (4n+2)cn, (n=0). (4)Another disguise is the number of ways n votes can come in for each of two candidates A and B in an election, with A never behind B.2022-4-643HDOJ_1133 Buy the Ticket HDOJ_1133 Buy the Ticket 2022-4-644算法分析:算法分析:n首先假設人無區(qū)別n令f(m,n)表示有m個人手持¥50的鈔票,n個人手持¥100的鈔票時共有的方案總數。則可以分以下情況討論這個問題:n(1)當n=0時n N=0意味著排隊購票的所有人手中拿的都是 ¥50的鈔票,那么這m個人排隊方案總數為1。n(2)當m=n0m=n0)可以推出
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 等保檢測機構管理辦法
- 葡萄酒消費稅管理辦法
- 宜賓小區(qū)管理辦法細則
- 規(guī)劃建設條件管理辦法
- 西安擔保借貸管理辦法
- 育人故事課件視頻
- 股癬護理課件視頻教學
- 壓瘡培訓課件5
- 培訓課件首頁布局
- 高質量高考數學試卷
- 兒科質控中心建設方案
- 2013免疫吸附治療知情同意書
- 鍍鋅鋼管壁厚及重量
- 區(qū)塊鏈金融學習通超星課后章節(jié)答案期末考試題庫2023年
- 2023年司法鑒定程序通則
- 2023年宜賓市敘州區(qū)區(qū)內外考試選調在編在職教師考試題庫
- 2023屆大連市瓦房店市數學四下期末質量檢測試題含解析
- 保安員在崗培訓法律
- 大學生心理健康教育(第二版)PPT全套完整教學課件
- 期貨市場行情及技術分析課件
- 3輸變電工程施工質量驗收統(tǒng)一表式(變電工程電氣專業(yè))
評論
0/150
提交評論