原创 搜索算法8之1014

1 題目編號:1014 2 題目內容: Problem Description There is a strange lift.The lift can stop can at every floor as you want,

原创 動態規劃2之1003

1 題目編號:10023 2 題目內容: Problem Description Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is

原创 搜索算法6之1011

1 題目編號:1011 2 題目內容: Problem Description The GeoSurvComp geologic survey company is responsible for detecting undergroun

原创 搜索算法14之總結

    做了近兩週的搜索專題,感覺收穫頗大。首先就是知道了主要的知識點或者說是搜索方法,嚴格來說,其實就是深搜和廣搜,當然也夾雜着二分查找與三分算法,當然偶爾也遇到了回溯算法。     BFS用的是隊列,DFS用的是遞歸。遞歸之前寫程序的

原创 動態規劃1之1010

1 題目編號:1010 2 題目內容: Problem Description 有一樓梯共M級,剛開始時你在第一級,若每次只能跨上一級或二級,要走上第M級,共有多少種走法?   Input 輸入數據首先包含一個整數N,表示測試實

原创 動態規劃9之1014

1 題目編號:1014 2 題目內容: Problem Description 我們看到過很多直線分割平面的題目,今天的這個題目稍微有些變化,我們要求的是n條折線分割平面的最大數目。比如,一條折線可以將平面分成兩部分,兩條折線最多可

原创 搜索算法13之1012

1題目編號:1012 2 題目內容: Problem Description Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison

原创 搜索算法7之1013

1 題目編號:1013 2 題目內容: Problem Description There is a strange lift.The lift can stop can at every floor as you want, an

原创 搜索算法12之1015

1 題目編號:1015 2 題目內容: Problem Description A friend of you is doing research on the Traveling Knight Problem (TKP) wher

原创 搜索算法10之1017

1 題目編號:1017 2 題目內容: Problem Description 大家一定覺的運動以後喝可樂是一件很愜意的事情,但是seeyou卻不這麼認爲。因爲每次當seeyou買了可樂以後,阿牛就要求和seeyou一起分享這一瓶可

原创 動態規劃0之1006

1 題目編號:1006 2 題目內容: Problem Description 在講述DP算法的時候,一個經典的例子就是數塔問題,它是這樣描述的:<br><br>有如下所示的數塔,要求從頂層走到底層,若每一步只能走到相鄰的結點,則經

原创 動態規劃3之1002

1 題目編號:1002 2 題目內容: Problem Description A subsequence of a given sequence is the given sequence with some elements (

原创 動態規劃4之1004

1 題目編號:1004 2 題目內容: Problem Description A number whose only prime factors are 2,3,5 or 7 is called a humble number.

原创 動態規劃6之1011

1 題目編號:1011 2 題目內容: Problem Description 有一只經過訓練的蜜蜂只能爬向右側相鄰的蜂房,不能反向爬行。請編程計算蜜蜂從蜂房a爬到蜂房b的可能路線數。<br>其中,蜂房的結構如下所示。<br><im

原创 動態規劃7之1012

1 題目編號:1012 2 題目內容: Problem Description 在2×n的一個長方形方格中,用一個1× 2的骨牌鋪滿方格,輸入n ,輸出鋪放方案的總數.<br>例如n=3時,爲2× 3方格,骨牌的鋪放方案有三種,如下