![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
背包
SHOUXIN11111
这个作者很懒,什么都没留下…
展开
-
背包问题模板(背包九讲)
01背包 题目:有 N 件物品和一个容量为 V 的背包。第 i 件物品的体积(费用)是 c[i],价值是 w[i]。求解将哪些物品装入背包可使这些物品的费用总和不超过背包容量,且价值总和最大。 代码如下 (一维数组) #include<stdio.h> #include<string.h> #include<algorithm> using namespace std; #define M 100010 int c[M],w[M],dp[M]; int main() {原创 2020-10-15 18:27:57 · 155 阅读 · 0 评论 -
Cash Machine(多重背包)
A Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly N distinct bill denominations, say Dk, ...原创 2019-07-26 21:21:16 · 209 阅读 · 0 评论 -
Proud Merchants
Recently, iSea went to an ancient country. For such a long time, it was the most wealthy and powerful kingdom in the world. As a result, the people in this country are still very proud even if their ...原创 2019-07-26 21:22:28 · 156 阅读 · 0 评论 -
A Mini Locomotive
A train has a locomotive that pulls the train with its many passenger coaches. If the locomotive breaks down, there is no way to pull the train. Therefore, the office of railroads decided to distribu...原创 2019-07-28 15:04:46 · 193 阅读 · 0 评论 -
FATE(命运)
最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd还说了他最多只杀s只怪。请问他能升掉这最后一级吗? I...原创 2019-07-28 15:57:19 · 300 阅读 · 0 评论