摘要: 【算法】背包DP 【题解】f[j]=(f[j-w[i]]+v[i]) 记得倒序(一个物品只能取一次) #include<cstdio> #include<algorithm> #include<cstring> using namespace std; const int maxn=10010; i 阅读全文
posted @ 2017-06-01 18:38 ONION_CYC 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 【算法】树状数组(区间和) 【题解】记得开long long #include<cstdio> #include<cstring> #include<algorithm> #define lowbit(x) (x&(-x)) using namespace std; const int maxn=5 阅读全文
posted @ 2017-06-01 18:28 ONION_CYC 阅读(160) 评论(0) 推荐(0) 编辑