Answer : http://ide.geeksforgeeks.org/TIe2ve
my answer is coming correct in devc++ but in GeeksForGeeks it is showing segmentation fault
Question : http://www.geeksforgeeks.org/dynamic-programming-set-7-coin-change/
Answer : http://ide.geeksforgeeks.org/TIe2ve
my answer is coming correct in devc++ but in GeeksForGeeks it is showing segmentation fault
Question : http://www.geeksforgeeks.org/dynamic-programming-set-7-coin-change/
Your code isnt following input format.
It clearly says-
But you are taking input as-
int v,n;//Assuming v is value?
cin>>v>>n;
int a[n];
for(int i=0;i<n;i++)
cin>>a[i];