
动态规划
Merry_hj
不完美小孩的完美梦想
展开
-
hud Rikka with Subset 2017 多校第五场 (背包)
Problem Description As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them:Yuta has n positive A1−An and their su原创 2017-08-08 20:54:19 · 375 阅读 · 0 评论 -
hud 1171 Big Event in HDU(基础0_1背包)
原题链接 Problem Description Nowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don’t know that Computer College had ever been split into Computer College and So原创 2017-11-15 17:09:39 · 336 阅读 · 0 评论 -
hud 2602 Bone Collector (0_1背包模板题)
原题链接题目大意:给你一个T代表有T组测试用例,第二行有两个数n,v分别代表物品个数和背包容量,然后一行的n个数代表每个物品的价值,最后一行的n个数代表物品所占背包的体积,题目要求输出背包最多能装多少价值的东西。解题思路:标准的0_1背包模板。#include <bits/stdc++.h> #define INF 0x3f3f3f3fusing namespace std; int dp[2555原创 2017-11-15 17:35:22 · 371 阅读 · 0 评论 -
hdu 2159 FATE(二维费用背包)
原题链接 Problem Description 最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd还说了他原创 2017-11-15 17:49:06 · 301 阅读 · 0 评论