揹包 poj2184

將si當作體積,fi當作價值,dp[j]表示si和爲j時fi的和的最大值。把負數的區間映射到正數區間。html   #include<stdio.h> #include<iostream> #include<algorithm> #include<string.h> #include<math.h> using namespace std; const int M=100000; int dp[M
相關文章
相關標籤/搜索