codeforces 543A 完全背包
安排n個人寫m行代碼,每個人每行會出a[i]個bug,求最多出現b個bug的方案數。一個二維的完全背包,每個人有兩個狀態:寫j行代碼出k個bugdp[i][j]
hdu 1505 City Game(hdu1506的二維推廣)
1.輸入的時候數據的時候要注意2.1506的二維推廣代碼:#include#include#includeusing namespace std;const i
HDU ACM 4255 A Famous Grid
A Famous GridTime Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/32768 K
poj 1154 LETTERS dfs入門題
//poj 1154//sep9#include using namespace std;const int maxR=32;char a[maxR][maxR
acdream 1726 A Math game (部分和問題 DFS剪枝)
A Math gameTime Limit: 2000/1000MS (Java/Others)Memory Limit: 256000/12800
解題報告 之 POJ2891 Strange Way to Express Integers
解題報告 之 POJ2891 Strange Way to Express IntegersDescription Elina is reading
POJ1019:Number Sequence
DescriptionA single positive integer i is given. Write a program to find the dig
LeetCode Minimum Size Subarray Sum
題目思路O(n)的思路比較簡單,直接用兩個下標掃一遍即可;O(nLogn)有點難,個人感覺應該是先得到Sum[i](前i+1)個數的和,因為數字都是正數,那麼S
UVA 10271 Chopsticks(線性DP)
In China, people use a pair of chopsticks to get food on the table, but Mr. L is