Memory-constrained coin changing for numbers up to one billion
问题 I faced this problem on one training. Namely we have given N different values ( N<= 100 ). Let's name this array A[N] , for this array A we are sure that we have 1 in the array and A[i] ≤ 10 9 . Secondly we have given number S where S ≤ 10 9 . Now we have to solve classic coin problem with this values. Actually we need to find minimum number of element which will sum to exactly S . Every element from A can be used infinite number of times. Time limit: 1 sec Memory limit: 256 MB Example: S =