100% Guaranteed Results


Exercises – Programming assignment 7 Solved
$ 24.99
Category:

Description

5/5 – (1 vote)

Rodcutting

Input (Standard input)
In the first line, an integer N is given which means the length of Rod (1 ≤ N ≤ 100). In the second line, N integers are given which means pi (pi-1 ≤ pi ≤ pi+1). pi is the value when the length of Rod is i.

Output (Standard output)
In the first line, print the maximum profit which could be made by the Rod’s length of
N.
In the next line, print the lengths of Rod for the maximum profit in non-decreasing order.

[Example]
Sample Input Sample Output
10
1 5 8 9 10 17 17 20 24 30 30
10

Sample Input Sample Output
4
1 5 8 9 10 2 2

Description
1. File name must be Rodcutting.cpp
2. Make a comment of your student ID, name and class in the first line of the source code. ex) 2014601028_Honggildong_A
3. Please keep the source code that you have submitted for some unexpected accident.

Reviews

There are no reviews yet.

Be the first to review “Exercises – Programming assignment 7 Solved”

Your email address will not be published. Required fields are marked *

Related products