动态规划
Vas_Sago
这个作者很懒,什么都没留下…
展开
-
(牛客网)双核处理
どこでもドア:传送门一个裸的0-1背包问题,可以参考《算法竞赛入门经典》。这里使用滚动数组的方法。code#include<bits/stdc++.h> using namespace std;int dp[102411]; int main() { int n,ma[55],sum=0; cin>>n; for(int i=1;i<=n;i++){ cin>原创 2017-04-21 19:58:55 · 525 阅读 · 0 评论 -
(HDU1227)Fast Food(DP)
どこでもドア:http://acm.hdu.edu.cn/showproblem.php?pid=1227 一共有n个商店,有k个仓库,设计仓库位置,使每个商店到,离当前商店最近,的一个仓库的距离和最小。 code#include<bits/stdc++.h> using namespace std; typedef long long LL; const int INF = 0x3f3f3f3原创 2017-04-26 14:33:44 · 275 阅读 · 0 评论