原创 SPOJ DISUBSTR - Distinct Substrings 後綴數組,轉化

DISUBSTR - Distinct Substrings no tags  Given a string, we need to find the total number of its distinct substring

原创 100道動態規劃——38 HDU 5763 Another Meaning KMP + DP

Problem Description As is known to all, in many cases, a word has two meanings. Such as “hehe”, which not only means

原创 100道動態規劃——37 UVA 1218 Perfect Service 樹形DP 分析問題

        樹形DP         老實說一開始是考慮用點的個數減去最大獨立集的點的個數,但是很快就發現不對,數據如下:         6         1 2         1 3         1 4         1

原创 POJ 3261 Milk Patterns 後綴數組

Description Farmer John has noticed that the quality of milk given by his cows varies from day to day. On further inv

原创 POJ 1743 Musical Theme 後綴數組 二分

A musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each repre

原创 CSUOJ 1849 Comparing answers 哈希,hash,計算技巧

Description In a place in Southwestern Europe, the name of which I do not wish to recall, not long ago there were n

原创 100道動態規劃——36 UVA 1220 Party at Hali-Bula 樹形DP 最大獨立集 思考欠妥

        題目的地址是:https://uva.onlinejudge.org/external/12/1220.pdf         pdf不是很好放上來就只給出鏈接了         好吧,這道題目我覺得我應該是可以做出來的,

原创 100道動態規劃——35 CSUOJ 1846 Assembly Line 區間DP,增加狀態

Description The last worker in a production line at the factory of Automated Composed Machinery is worried. She know

原创 CSUOJ 1843 Jumping Monkey BFS,狀態壓縮

        CSUOJ 1843 Jumping Monkey          題目大意:有一個n個點的圖,對手可以在圖上的任意一個點放下一個物品,你每一次有機會查看一個點上是否存在物品,假若你查看之後點內沒有物品,則對手必須把物品

原创 100道動態規劃——39 hihoCoder 1475 數組拆分 前綴和 DP

#1475 : 數組分拆 Time Limit:10000ms Case Time Limit:1000ms Memory Limit:256MB Description 小Ho得到了一個數組作爲他的新年禮物,他非常喜

原创 UVA 1605 Building for UN 機智題。。

  題目:https://uva.onlinejudge.org/external/16/1605.pdf   題意比較簡單。。。就不說了   書上的方法太棒了。。。感覺這個機智得特別棒。。    一共兩層,第一層第i行全是國家i,第二行

原创 POJ 2631 Roads in the North 樹上最長路 樹型DP

Building and maintaining roads among communities in the far North is an expensive business. With this in mind, the roa

原创 CSUOJ 1891 Full Tank? 有約束條件下的最短路 分支限界法?

Description After going through the receipts from your car trip through Europe this summer, you realised that the g

原创 UVA 11134 Fabled Rook 枚舉 multiset加速

        題意說的是給出一個長度爲n的國際象棋的棋盤,然後給出n個車的可以放置的範圍,範圍是一個矩形,用左上和右下兩對數來描述,問是否存在方式使得每個車都放在他自己的範圍裏面且相互不衝突         這裏x方向和y方向是不相關的

原创 100道動態規劃——40 CSUOJ 1889 Copying DNA 記憶化搜索 DP的感覺

Description Evolution is a seemingly random process which works in a way which resembles certain approaches we use