
贪心
文章平均质量分 85
ZCY19990813
不断丰富自己,变得有底气!
展开
-
tai贪心^^
1.试设计一个用回溯法搜索子集空间树的函数。该函数的参数包括结点可行性判定函数和上界函数等必要的函数,并将此函数用于解0-1背包问题。 0-1 背包问题描述如下:给定n 种物品和一个背包。物品i 的重量是wi ,其价值为vi ,背包的容量为C。应如何选择装入背包的物品,使得装入背包中物品的总价值最大? 在选择装入背包的物品时,对每种物品i只有2 种选择,即装入背包或不装入背包。不能将物品i 装...原创 2018-03-27 17:33:02 · 418 阅读 · 2 评论 -
The Child and Toy
Sample InputInput4 310 20 30 401 41 22 3Output40Input4 4100 100 100 1001 22 32 43 4Output400Input7 1040 10 20 10 20 80 401 54 74 55 25 76 41 61 34 31 4Output160题意:...原创 2019-07-29 17:53:02 · 258 阅读 · 0 评论 -
Fight Against Monsters(贪心)
It is my great honour to introduce myself to you here. My name is Aloysius Benjy Cobweb Dartagnan Egbert Felix Gaspar Humbert Ignatius Jayden Kasper Leroy Maximilian. As a storyteller, today I decide ...原创 2019-08-19 09:44:35 · 722 阅读 · 1 评论 -
A - Cats and Fish (2017年ICPC中国大陆区域赛真题)
There are many homeless cats in PKU campus. They are all happy because the students in the cat club of PKU take good care of them. Li lei is one of the members of the cat club. He loves those cats ver...原创 2019-08-15 10:19:56 · 582 阅读 · 2 评论 -
Lovers(ACM-ICPC 2017 Asia Xi'an)
One daynngirls andnnboys come to Xi’an to look for a mate . Each girl has a valuea[i], each boy has a valueb[i]. Girliand boyj will fall in love only if a[i]+b[j]≥k.Please help them make...原创 2019-08-16 17:11:58 · 511 阅读 · 0 评论 -
Rabbits (2017ACM/ICPC亚洲区沈阳站)
Here N (N ≥ 3) rabbits are playing by the river. They are playing on a number line, each occupying a different integer. In a single move, one of the outer rabbits jumps into a space between any other ...原创 2019-08-18 09:19:49 · 319 阅读 · 0 评论