Poj (2184) -- Cow Exhibition (01 backpack deformation)
In fact, I don't think I have a deep understanding of this question. However, after doing this today, we will first record our current ideas.
The general meaning of the question is:
There is a nheaded ox, each of which has a s value representing the IQ value, and a f value representing its humorous value.
Then, ask you what the total and maximum values of the IQ and humor values are, and ensure th
contains four numbers N (1 N M (1 W (1 W X (1 X lt;= N )-The starting point ofNitori.Then followed N by lines, each line contains the integers which means the shop on tourist attraction i sells the c2/> TVi and Things (1 TWi TVi Next, there is M lines, each line contains three numbers, Xi , Yi and Li , which means there is a one-way road From tourist attraction Xi to Yi , and the length is Li (1 Xi , Yi Li OutputFor each test case, output the answer as the description required.Sample Input4 4
There are n items and a backpack with a capacity of M, with unlimited pieces available for each item. The volume of the article I is weight, and the value is values. The solution of which items are loaded into the backpack allows the volume of these items to be no more than the backpack capacity, and the value of the largest sum.1 //"n" is the number of kinds.2 /
Description
There are n items and a backpack with a capacity of V. The cost of item I is c[i], value is w[i]. These items are divided into groups, and items in each group conflict with each other, with a maximum of one selected. To find out what items to pack into the backpack can make the sum of these items does not exceed the backpack capacity, and the total va
Problem: There are n items and a backpack with a capacity of V. The cost of item I is c[i], value is w[i]. These items are divided into groups, and items in each group conflict with each other, with a maximum of one selected. To find out what items to pack into the backpack can make the sum of these items does not exceed the backpack capacity, and the total value
Title Link: https://vjudge.net/problem/POJ-1276Test instructions: There are now cash, and n kinds of coins, each coin has NI, the value of Di, for all kinds of coins composed of not more than cash of the largest amount of money ....Idea: binary split into 01 backpack, or converted to a full backpack are all possibleFull backpack://This problem can let w,v start f
"Problem description"The backpack is a good thing, I hope I have it.Give you a two-dimensional backpack, its volume is? X?. Now you have some size for 1x2 and 1x3 of the items, each item has its own value. You want to put some items in your backpack so that theyValue and maximum, ask the maximum value and is how much."Input Format"The first line an integer? The n
This question is about money-saving pig, empty quality W1, money quality W2, and then the value and weight of various types of money, asking how much money a piggy bank needs to store is a classic topic for getting started with a full backpack. Now I don't fully understand it. Let's talk about my understanding. The full backpack is to put every kind of data in it as much as possible, and every kind of data
Crazy Shopping (topological sort + full backpack)Because of the 90th anniversary of the coherent Cute patchouli (C.C.P), Kawashiro Nitori decides t o buy a lot of rare things to celebrate.Kawashiro Nitori is a very shy kappa (a type of water sprite this live in rivers) and she lives on YOukai Mountain. Youkai Mountain is a dangerous place full of Youkai, so normally humans was unable to being close to the MO Untain. But because of the financial crisi
Method recursively searches in the solution space until the required solution or solution space has no dynamic knots.
(2) solving 0-1 knapsack algorithm analysis
The 0-1 knapsack problem is the subset selection problem. Generally, the 0-1 backpack problem is NP-hard. The solution space of the 0-1 knapsack problem can be represented by a subset tree. When searching for a spatial tree, as long as its left son node is a feasible node, the search enters
Question: Click to open the link
Question:
There are n items, each of which has two attributes: volume and value. A thief carries a V-sized backpack and wants to steal these items, q: What is the maximum value of K that thieves can steal?
Ideas:
This is different from the typical 01 backpack to find the optimal solution. It requires a K-level solution. Therefore, the most intuitive idea is to add one dim
Http: // 202.120.106.94/onlinejudge/problemshow. php? Pro_id = 542
Backpack exercise questions
Briefly summarize the question
There is a function f (x)
There are n unknown numbers X1 X2 x3.... XN
SIGMA (xi) = s
Evaluate the maximum value of F (X1) + f (X2) + f (X3) +... + f (Xn)
The maximum value of n s is 100.
Isn't that a general backpack? The value of each item changes as the volume you a
Link: http://acm.hdu.edu.cn/showproblem.php? PID = 1, 3033
There are n kinds of shoes, m yuan in the hand, and N kinds of shoes belong to k brands, (1
Train of Thought: the variant of the backpack problem divides the items to be loaded into several categories, and there are limits on the selection of each item (generally choose at least one or more, because all items are grouped, the results of the previous I-1 class subcontracting will be processed
Question: poj 2484 cow Exhibition
Question: Give the nheaded ox. Each ox has a lucky Si and a smart ti. Now we need to select some cows to maximize the sum of the two values, provided that sum (SI) and sum (Ti) are both non-negative values.
Analysis: The data volume of this question is small, and it can be searched and trimmed.
Here we will talk about the idea of a 0-1 backpack. The obvious deformation of this question is that the item has two attri
Tags: Dynamic Planning 0-1 backpack ACM
Question:
There are a lot of monsters on each land on some independent land. It takes some time to kill every monster and get a certain amount of money to give the specified money M, find the minimum time required to get m money and select only one land to kill monsters.
Question:
Regardless of the data range, it is easy to think of a 0-1 backpack (dp (I, j) =
Question Link: Http://acm.hdu.edu.cn/showproblem.php? PID = 1, 1561
Theme: Get the vertex from the root of the tree. The maximum value is m points.
Solutions:
Cost = 1 tree type backpack.
There is a virtual root 0, and cost is required to take this virtual root, so the final result is DP [0] [M + 1].
This is a special backpack problem with cost = 1. There is an optimization on two for loops.
For (F + 1... j
Question Link: Http://poj.org/problem? Id = 1155
Theme: TV station broadcast program. For each root, its subnode may be a user or a transfer station. If it is a transfer station, you will spend money. If it is a user, you will receive money. Ask how many users can view the program at most without losing money.
Solutions:
Tree Type backpack. Cost = 1.
There is a virtual root 0, and cost is required to take this virtual root, so the final result is
.
Sample Input
2
10 1
20 1
3
10 1
20 2
30 1
-1
Sample output
20 10
40 40
Author
Lcy
There are n kinds of devices, each of which has a value and quantity. First, you need to calculate the total value of the N devices.
The two schools are equally divided as much as possible. If the average score is not completely equal, the first school should be divided into one more point.
Q: How many valuable devices can the two schools share?
Idea: Each device has a quantity and value. Each device can be
Getting started with a classic full backpack
Question link: http://acm.hdu.edu.cn/showproblem.php? PID = 1, 1114
Piggy-bank
Time Limit: 2000/1000 MS (Java/others) memory limit: 65536/32768 K (Java/Others)Total submission (s): 5450 accepted submission (s): 2714Problem descriptionbefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. the main income for this action comes from irreversibly bound money (IBM ).
Question link: http://acm.hdu.edu.cn/showproblem.php? PID = 1, 4003
Given a tree with N nodes, traversing each number of edges requires cost. Now, given K robots, we need to use these K robots to traverse the entire tree, minimum and cost, n
Solution: tree-like DP + grouping backpack. The grouping backpack in this question is not a general choice of at most one item, but must be selected and can only be se
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.