原创 Fibonacci

Description In the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn − 1 + Fn − 2 for n ≥ 2. For exampl

原创 HDU5477 A Sweet Journey

Description Master Di plans to take his girlfriend for a travel by bike. Their journey, which can be seen as a

原创 Dave

Description Recently, Dave is boring, so he often walks around. He finds that some places are too crowded, for

原创 UVA 108 Maximum Sum 最大連續子矩陣和

Description Background A problem that is simple to solve in one dimension is often much more difficult to so

原创 POJ - 1222 EXTENDED LIGHTS OUT高斯消元

Description In an extended version of the game Lights Out, is a puzzle with 5 rows of 6 buttons each (the actual pu

原创 Lweb and String

Problem Description Lweb has a string S. Oneday, he decided to transform this string to a new sequence.  You need he

原创 HDU4277 USACO ORZ

Description Like everyone, cows enjoy variety. Their current fancy is new shapes for pastures. The old rectangu

原创 優先隊列 The kth great number

Description Xiao Ming and Xiao Bao are playing a simple Numbers game. In a round Xiao Ming can choose to write

原创 概率dp UVA 11762 Race to 1

這題就是尋找各種可能到達1的路徑,然後求期望值,我們可以把它分解來看,因爲路徑長度爲它走過的所有的點所需路徑加上如果到達某一點可以繼續走下去的話所增加的路徑,然後期望就是總的路徑除以所有有可能往下走的點(如果到達1,那麼可能的點就是0,除