摘要: 完全背包#include#include#include#includeusing namespace std;int dp[10010];int main(){ int i; memset(dp,0,sizeof(dp)); dp[0]=1; for(i=0;i=0;i--... 阅读全文
posted @ 2015-07-14 21:35 Fighting_Heart 阅读(146) 评论(0) 推荐(0)
摘要: #include#include#include#includeusing namespace std;const int maxn=32768+10;long long DP[maxn];int main(){ int n; int i,j; DP[0]=1; for(i=... 阅读全文
posted @ 2015-07-14 21:20 Fighting_Heart 阅读(102) 评论(0) 推荐(0)
摘要: 0-1背包#include#include#include#includeusing namespace std;const int maxn=10000+10;const int INF=0x7FFFFFFF;int n,m;int a[maxn];double b[maxn];double DP... 阅读全文
posted @ 2015-07-14 20:18 Fighting_Heart 阅读(119) 评论(0) 推荐(0)
摘要: 0-1背包#include#include#include#includeusing namespace std;#define maxn 105double p[maxn];int m[maxn];double DP[maxn*maxn];int main(){ int T; scan... 阅读全文
posted @ 2015-07-14 19:26 Fighting_Heart 阅读(109) 评论(0) 推荐(0)
摘要: 简单0-1背包#include#include#include#includeusing namespace std;int N,V;const int maxn=1000+10;int dp[maxn],cost[maxn],value[maxn];int main(){ int i,j,T... 阅读全文
posted @ 2015-07-14 18:30 Fighting_Heart 阅读(113) 评论(0) 推荐(0)
摘要: 简单0-1背包#include#include#include#includeusing namespace std;const int maxn=1000+10;int A[maxn],dp[50000+10];int main(){ int i,j,n,m; while(~scanf... 阅读全文
posted @ 2015-07-14 18:08 Fighting_Heart 阅读(140) 评论(0) 推荐(0)