
背包
永夜莫明
菜是原罪
展开
-
Knapsack Cryptosystem(超大01背包——二分+状压)
链接:https://ac.nowcoder.com/acm/contest/889/D来源:牛客网时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述Amy asks Mr. B problem D. Please help Mr. B to solve the follow...原创 2019-08-15 18:05:59 · 638 阅读 · 0 评论 -
codeforces(dp/01背包)
链接:https://ac.nowcoder.com/acm/problem/21314来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 524288K,其他语言1048576K64bit IO Format: %lld题目描述牛牛正在打一场CF比赛时间为T分钟,有N道题,可以在比赛时间内的任意时间提交代码第i道题的分数为maxPoints[i],...原创 2019-08-08 02:09:31 · 383 阅读 · 0 评论 -
牛牛去买球(思维+背包)
链接:https://ac.nowcoder.com/acm/problem/21668来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 524288K,其他语言1048576K64bit IO Format: %lld题目描述一个人如果在他很小的时候就自己赚过钱,他的一生都会过得非常节俭,因为他知道财富来之不易.作为一个勤俭节约的好孩子,牛牛决定在...原创 2019-08-04 23:54:18 · 470 阅读 · 0 评论 -
Transport Ship(多重背包)
问题 K: Transport Ship时间限制: 1 Sec内存限制: 128 MB提交: 124解决: 39[提交] [状态] [命题人:admin]题目描述There are N different kinds of transport ships on the port. The i^th kind of ship can carry the weight of...原创 2019-08-02 19:40:05 · 177 阅读 · 0 评论 -
Space Elevator(贪心+多重背包)
https://cn.vjudge.net/problem/POJ-2392The cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have K (1 <= K <= 400) differe...原创 2019-07-17 21:44:59 · 352 阅读 · 0 评论 -
I love sneakers!(分组背包,好题)
https://cn.vjudge.net/problem/HDU-3033After months of hard working, Iserlohn finally wins awesome amount of scholarship. As a great zealot of sneakers, he decides to spend all his money on them in a...原创 2019-07-16 18:27:16 · 279 阅读 · 0 评论 -
Cash Machine(多重背包)
https://cn.vjudge.net/problem/POJ-1276A 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 ...原创 2019-07-16 15:58:38 · 235 阅读 · 0 评论 -
Knapsack problem(超大01背包)
题目链接https://cn.vjudge.net/problem/FZU-2214Given a set of n items, each with a weight w[i] and a value v[i], determine a way to choose the items into a knapsack so that the total weight is less than...原创 2019-07-16 15:09:37 · 225 阅读 · 0 评论 -
CD(01背包+简单路径输出)
链接:https://cn.vjudge.net/problem/UVA-624vis[i][j]==true表示第i件物品在体积为j时是最优解本题只要输出任意一种最优解即可#include<cstdio>#include<cstring>using namespace std;int dp[1005];bool vis[25][1005];int ...原创 2019-07-04 15:16:40 · 515 阅读 · 0 评论 -
Chat(分组背包)
链接:https://ac.nowcoder.com/acm/contest/893/H来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述在Casya生活的世界里,一天由m个小时组成。最近Casya的女神终于答应在接下来的n天中与Casya聊天,Casya非常激动。...原创 2019-05-07 03:03:12 · 171 阅读 · 0 评论 -
简单的麻烦(搜索/背包)
链接:https://ac.nowcoder.com/acm/contest/642/D来源:牛客网网易云音乐推出了定时关闭播放的功能,假设到了定时关闭播放的时间,当前这首歌还没有播放完,那就把它播放完关闭;如果到了定时关闭的时间,当前歌恰好播放完,那就立即关闭。xrc 在知道网易云这个算法后,想知道如果自己定时 t 时间后关闭播放,那最多能听多长时间的歌,已知 xrc 歌单中一共有 n...原创 2019-04-21 14:50:53 · 203 阅读 · 0 评论 -
Interesting Dart Game(鸽巢原理+完全背包)
题目链接:https://cn.vjudge.net/problem/ZOJ-2955Recently, Dearboy buys a dart for his dormitory, but neither Dearboy nor his roommate knows how to play it. So they decide to make a new rule in the dormit...原创 2019-03-27 23:31:43 · 361 阅读 · 0 评论 -
The Fewest Coins (多重背包+完全背包)(鸽巢原理)
Farmer John has gone to town to buy some farm supplies. Being a very efficient man, he always pays for his goods in such a way that the smallest number of coins changes hands, i.e., the number of coin...原创 2018-12-11 19:55:53 · 486 阅读 · 0 评论 -
Dividing(多重背包01背包)
Marsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the marbles had the same v...原创 2018-12-08 20:16:16 · 249 阅读 · 0 评论