subject

Design, code, and test a C program that uses dynamic programming to determine two separate subsequences of the input such that the first subsequence sums to the first target value and the second subsequence sums to the second target value. The input should be read from standard input (which will be one of (1) keyboard typing, (2) a shell redirect (<) from a file, or (3) cut - and - paste. Do NOT prompt for a file name!
The first line of the input will give n , the length of the sequence , along with the two target values . Each of the remaining input lines will include one sequence value. All values will be positive integers. Your program should echo the target values and the input sequence. If a problem instance has a solution, each of the two subsequences should be output and clearly labeled. A message should be provided for instances without a solution.
Getting Started:
1. Unlike the one-dimensional situation for ordinary subset sums, this problem is two-dimensional.
2. Dynamic programming is the only acceptable method for doing this lab.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:00, juandguardado7045
Your company has 1,500 desktop computers running windows 7. you want to upgrade them to windows 10. which type of microsoft license would be best suited in this situation?
Answers: 3
image
Computers and Technology, 23.06.2019 12:00, lyn94
Using the list, you can select the number of photos that will appear on each slide. a. theme b. frame shape c. pictures in album d. picture layout
Answers: 1
image
Computers and Technology, 23.06.2019 16:00, keyonaemanieevans
Helen is having a meeting with her colleagues in her company. they are working on the goals and objectives for the coming year. they want to ensure that these goals and objectives of the processes involved are properly evaluated. which system can helen and her colleagues apply to evaluate this? helen and her colleagues require a blank to evaluate the goals and objectives.
Answers: 2
image
Computers and Technology, 24.06.2019 20:20, isaiahromero15
Write python code that prompts the user to enter his or her favorite color and assigns the user’s input to a variable named color.
Answers: 1
You know the right answer?
Design, code, and test a C program that uses dynamic programming to determine two separate subsequen...

Questions in other subjects:

Konu
Mathematics, 01.02.2021 07:40
Konu
English, 01.02.2021 07:40
Konu
Mathematics, 01.02.2021 07:40
Konu
Mathematics, 01.02.2021 07:40