74.5k views
2 votes
a company plans to shift its infrastructure to the cloud. as a result, they will rent k computing cores per day for n days. the company is provided with m pricing plans for this duration. each pricing plan has a l[i] and r[in] representing the days when its available, c[i] cores available each day, and its costs p[i] to rent one core per day. the company can rent an arbitrary number of cores on each day from each available plan, ranging from 0 to c[i] cores. given n,k, and plans as a 2d array, the function returns the minimum cost to complete the process.

1 Answer

4 votes

Final answer:

The question involves finding the minimum cost for a company to rent cloud computing cores per day across multiple pricing plans, using dynamic programming.

Step-by-step explanation:

The question pertains to a scenario where a company plans to shift its infrastructure to the cloud. For this, they require renting k computing cores per day for n days and are evaluating m pricing plans. To calculate the minimum cost, one could write an algorithm that iterates through the days and selects the combination of plans that yields the lowest cost while meeting the core requirements each day. It would involve checking each plan's availability l[i] to r[i], the number of cores provided c[i], and the cost per core p[i]. This problem is a form of dynamic programming, where the function would return the accumulated minimum cost after processing all the plans while ensuring that the core requirements are met each day.

User Vincent Tjeng
by
8.8k points