
动态规划
MrFox_
1.少说话, 多做事。
2.现在就是将来, 本来现实, 何必幻想!
展开
-
HDU 1203 I NEED A OFFER!
//加油!#include#include#include#include#includeusing namespace std;const int maxn = 10000 + 5;struct node{ int n; double p;}res[maxn];double dp[maxn];int main(){ int n, m;原创 2015-08-27 09:38:30 · 419 阅读 · 0 评论 -
HDU 2955 Robberies
//加油!#include#include#include#include#include#include#includeusing namespace std;const int maxn = 10000 + 5;double dp[maxn];struct node{ int w; double p;}res[maxn/100];int main(原创 2015-08-27 08:40:21 · 432 阅读 · 0 评论 -
HDU 2602
//加油!#include#include#include#include#includeusing namespace std;const int maxn = 1000 + 5;int dp[maxn];int w[maxn];int v[maxn];int main(){ int T, N, V; cin >> T; while(T--)原创 2015-08-27 08:54:30 · 357 阅读 · 0 评论 -
HDU 1171 Big Event in HDU
//加油!#include#include#include#include#includeusing namespace std;const int maxn = 250000 + 5;int dp[maxn];int cnt[5000+5];int main(){ int n; while(scanf("%d", &n) == 1 && n > 0)原创 2015-08-28 09:32:32 · 422 阅读 · 0 评论 -
收藏DP题目
HDU:点击打开链接原创 2015-08-31 09:16:17 · 578 阅读 · 0 评论 -
UVA 1213 Sum of Different Primes
#include#include#include#includeusing namespace std;const int maxn = 1120 + 5;bool prime[maxn];vector res;void init(){ memset(prime,0,sizeof(prime)); for(int i = 2; i f原创 2015-10-08 18:48:29 · 473 阅读 · 0 评论 -
UVA 10118 Free Candies
//开始以为是个数塔。。。//记忆化搜索:dp[a][b][c][d]的意义是第一堆选了a, 第二堆选了b个, 。。。。。之后剩下的最大值;#include#include#include#include#includeusing namespace std;const int maxn = 40 + 5;int vis[maxn][4];int dp[maxn][maxn原创 2015-09-21 19:34:01 · 471 阅读 · 0 评论