#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int coinChange(vector<int>& coins, int amount) {
int Max = amount+100;
vector<int> dp(amount+1, Max);
dp[0] = 0;
for(int i=0; i<=amount; i++){
for(int j=0; j<coins.size(); j++){
if(i-coins[j] >= 0){
int index = i-coins[j];
dp[i] = dp[index]+1 < dp[i] ? dp[index]+1 : dp[i] ;
}
}
}
return dp[amount]>amount ? -1 : dp[amount];
}
};
int main(){
int amount =0;
vector<int> coins= {2,3};
Solution S;
int r = S.coinChange(coins, amount);
cout<<"最少使用的硬币数量为:"<<r<<endl;
system("pause");
return 0;
}