diff --git a/algorithms/CPlusPlus/Dynamic-Programming/bookshopcses.cpp b/algorithms/CPlusPlus/Dynamic-Programming/bookshopcses.cpp new file mode 100644 index 00000000..6f37b910 --- /dev/null +++ b/algorithms/CPlusPlus/Dynamic-Programming/bookshopcses.cpp @@ -0,0 +1,45 @@ +#include +using namespace std; + +//bottom_up approach + +void solve() +{ + int n,x; + cin>>n>>x; + vector(price)(n+1); + vector(pages)(n+1); + for(int i=1;i>price[i]; + for(int i=1;i>pages[i]; + int dp[n+1][x+1]; + for(int j=0;j