摘要: 有 N 件物品和一个容量是 V 的背包,背包能承受的最大重量是 M。 每件物品只能用一次。体积是 vi,重量是 mi,价值是 wi。 求解将哪些物品装入背包,可使物品总体积不超过背包容量,总重量不超过背包可承受的最大重量,且价值总和最大。输出最大价值。 输入格式 第一行两个整数,N,V,M,用空格隔 阅读全文
posted @ 2020-10-26 23:19 莳曳 阅读(92) 评论(0) 推荐(0)
摘要: https://www.acwing.com/problem/content/7/ 有 NN 种物品和一个容量是 V 的背包。 物品一共有三类: 第一类物品只能用1次(01背包); 第二类物品可以用无限次(完全背包); 第三类物品最多只能用 si 次(多重背包); 每种体积是 vi,价值是 wi。 阅读全文
posted @ 2020-10-26 19:36 莳曳 阅读(124) 评论(0) 推荐(0)
摘要: Carneginon was a chic bard. But when he was young, he was frivolous and had joined many gangs. Recently, Caneginon was to be crowned, because the king 阅读全文
posted @ 2020-10-26 12:36 莳曳 阅读(63) 评论(0) 推荐(0)
摘要: Cyclic Nacklace Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 25249 Accepted Submission(s): 101 阅读全文
posted @ 2020-10-26 12:26 莳曳 阅读(80) 评论(0) 推荐(0)
摘要: A. Crazy Computer time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ZS the Coder is coding 阅读全文
posted @ 2020-10-26 11:39 莳曳 阅读(162) 评论(0) 推荐(0)
摘要: Alice has a cute cat. To keep her cat fit, Alice wants to design an exercising walk for her cat! Initially, Alice's cat is located in a cell (x,y)(x,y 阅读全文
posted @ 2020-10-26 11:34 莳曳 阅读(97) 评论(0) 推荐(0)
摘要: Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s 阅读全文
posted @ 2020-10-25 23:21 莳曳 阅读(95) 评论(0) 推荐(0)
摘要: 对于吃货来说,过年最幸福的事就是吃了,没有之一! 但是对于女生来说,卡路里(热量)是天敌啊! 资深美女湫湫深谙“胖来如山倒,胖去如抽丝”的道理,所以她希望你能帮忙制定一个食谱,能使她吃得开心的同时,不会制造太多的天敌。 当然,为了方便你制作食谱,湫湫给了你每日食物清单,上面描述了当天她想吃的每种食物 阅读全文
posted @ 2020-10-25 23:11 莳曳 阅读(96) 评论(0) 推荐(0)
摘要: Consider an arbitrary sequence of integers. One can place + or - operators between integers in the sequence, thus deriving different arithmetical expr 阅读全文
posted @ 2020-10-25 22:47 莳曳 阅读(72) 评论(0) 推荐(0)
摘要: Whuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided t 阅读全文
posted @ 2020-10-25 20:32 莳曳 阅读(75) 评论(0) 推荐(0)