原创 UVA-348 Optimal Array Multiplication Sequence

Description Given two arrays A and B, we can determine the array C = AB using the standard definition of matrix mu

原创 矩形嵌套 ————DAG(有向無環圖)上的動態規劃

矩形嵌套 時間限制:3000 ms  |  內存限制:65535 KB 難度:4 描述有n個矩形,每個矩形可以用a,b來描述,表示長和寬。矩形X(a,b)可以嵌套在矩形Y(c,d)中當且僅當a<c,b<d或者b<c,a<d(

原创 A Knight's Journey (搜索)

Description Background The knight is getting bored of seeing the same black and white squares again and again and

原创 Unidirectional TSP(dp)

Description Background Problems that require minimum paths through some domain appear in many different areas of

原创 dp 最大遞增子序列

Longest Ordered Subsequence Time Limit: 2 Seconds      Memory Limit: 65536 KB A numeric sequence of ai is ordered if a1

原创 UVA-307 Sticks (搜索剪枝)

Description George took sticks of the same length and cut them randomly until all parts became at most 50 units long

原创 nyist 硬幣找零(完全揹包)

硬幣找零 時間限制:1000 ms  |  內存限制:65535 KB 難度:3 描述 在現實生活中,我們經常遇到硬幣找零的問題,例如,在發工資時,財務人員就需要計算最少的找零硬幣數,以便他們能從銀行拿回最少的硬幣數,並保證

原创 dp第一步!!!!最長公共子序列 POJ 1458

Common Subsequence Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 42968   Accepted: 17386 Descriptio

原创 UVA-558 Wormholes(Floyd)

Description In the year 2163, wormholes were discovered. A wormhole is a subspace tunnel through space and time

原创 Nested Dolls (單調遞增子序列 + 二分)

Description Dilworth is the world’s most prominent collector of Russian nested dolls: he literally has thousands of

原创 UVA-111 History Grading

Background Many problems in Computer Science involve maximizing some measure according to constraints. Consider a

原创 UVA-167The Sultan's Successors(八皇后問題)

Description The Sultan of Nubia has no children, so she has decided that the country will be split into up tok separa

原创 Let Me Count The Ways

Description After making a purchase at a large department store, Mel's change was 17 cents. He received 1 dime, 1

原创 hdoj 5672 String (尺取法)

Description There is a string $S$.$S$ only contain lower case English character.$(10 \leq length(S) \leq 1,000,000)

原创 STL之 next_permutation函數{(全排列)按字典序!!!!!}

next_permutation函數  今天做題時,用到了這個函數,亮瞎我的雙眼~~~ 先貼出來題目!!!!!! Description You are to write a program that has to gen