问题1:找硬币,换钱的方法 输入: penny数组代表所有货币的面值,正数不重复 aim小于等于1000,代表要找的钱 输出:换钱的方法总数 解法1:经典dp,空间复杂度O(n*aim) class Exchange { public: int countWays(vector<int> penny, int n, int aim) { if (penny.empty()||n == 0) return 0; vector<vector<int> > dp(n,vect…
HDU 2084:https://vjudge.net/problem/HDU-2084 Problem Describe : When it comes to the DP algorithm, a classic example is the tower problem, which is described as:There are towers as shown below, which require walking from the top to the bottom. If eac…