Cody

Problem 43131. Which coins to give

Created by Jakub Mrowka in Community

I was in shop today. I admired, how shop assistant had to think, which coins to give me. The task is we have a vector v=[0.5 0.2 0.1 0.05 0.02 0.01] and we have a number in range x=0.01-1

return as output a vector of coins which can be given to get summary the "x" amount, also it should be the lowest amount of coins.

Example

x=0.63
v=[0.5 0.2 0.1 0.05 0.02 0.01]
y=[ 1   0   1    0    1    1 ]

Solution Stats

59.81% Correct | 40.19% Incorrect
Last solution submitted on May 21, 2019

Problem Comments

Solution Comments