贪心
文章平均质量分 85
ZCY19990813
不断丰富自己,变得有底气!
展开
-
tai贪心^^
1. 试设计一个用回溯法搜索子集空间树的函数。该函数的参数包括结点可行性判定函数和上界函数等必要的函数,并将此函数用于解0-1背包问题。 0-1 背包问题描述如下:给定n 种物品和一个背包。物品i 的重量是wi ,其价值为vi ,背包的容量为C。应如何选择装入背包的物品,使得装入背包中物品的总价值最大? 在选择装入背包的物品时,对每种物品i只有2 种选择,即装入背包或不装入背包。不能将物品i 装...原创 2018-03-27 17:33:02 · 357 阅读 · 2 评论 -
The Child and Toy
Sample Input Input 4 3 10 20 30 40 1 4 1 2 2 3 Output 40 Input 4 4 100 100 100 100 1 2 2 3 2 4 3 4 Output 400 Input 7 10 40 10 20 10 20 80 40 1 5 4 7 4 5 5 2 5 7 6 4 1 6 1 3 4 3 1 4 Output 160 题意:...原创 2019-07-29 17:53:02 · 217 阅读 · 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 · 644 阅读 · 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 · 492 阅读 · 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 · 455 阅读 · 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 · 264 阅读 · 0 评论