You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Motivation: given a rod of length N and the prices of all pieces of size smaller than N, determine the maximum value obtainable by cutting up the rod and selling the pieces.
*/
#include<bits/stdc++.h>
usingnamespacestd;
constint INF = 1 << 30;
/* input */
vector<int> prices = {1, 5, 8, 9}; // prices[i] = price of rod of length i+1