W
W
weranda2016-07-21 10:44:25
Python
weranda, 2016-07-21 10:44:25

What is the algorithm for solving the problem of buying a given quantity of goods from several goods?

Hello
, I am facing a problem:

Write a program that determines how many bulls, cows and calves can be bought, paying 10 rubles for a bull, 5 rubles for a cow, and 50 kopecks for a calf, if 100 heads of cattle need to be bought for 100 rubles?

But I can not come up with an algorithm for solving it. Any ideas?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mikhail_404, 2016-07-21
@mikhail_404

Dynamic programming. https://habrahabr.ru/post/109384/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question