Question
there are N piles of stones arranged in a row, stones[i], K is merging stone, and cost is equal to the total number of stones
there are N piles of stones arranged in a row, stones[i], K is merging stone, and cost is equal to the total number of stones in these K piles. find the best minimum but is the maximum cost in piles possible p_i value. (do not need to write the code for this problem. see questions below )
input: stone (S) = [3,2,4,1], k= 3
Explanation:
piles=<2,3,4>=>
p1 piles=2, p1 to p2 stone [3,2] , cost 5
p2 piles=3, p3 to p3, stone [4], cost 4
p3 piles=4, p4 to p4, stone [1], cost 1
maxmum cost at this one is 5, but maybe is not minimum cost at all possible solutions
Questions:
- What is the objective function for this problem? Be precise and mathematical (ideally it should be a single formula).(A function that takes the inputs values (the s_i values and k) and a solution (the p_i) values, and computes how good that solution is.)
- For an input with n stones and k piles, how many feasible solutions are there?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started