One against a hundred

Выполнен
Заказ
3761404
Раздел
Программирование
Предмет
Python
Антиплагиат
70%
eTXT
Срок сдачи
24 Дек 2020 в 10:00
Цена
0 ₽
Блокировка
10 дней
Размещен
22 Дек 2020 в 17:40
Просмотров
40
Описание работы
You participate in a competition in which you have one hundred opponents. The competition will last for rounds. In each round, you can exclude some opponents from the competition (always at least one) and you will be rewarded for their elimination.
The reward for elimination in opponents from the number p is
100.000, - * v / p
Calculated in whole numbers (ie the lower whole part).
So, for example, if you eliminate 50 opponents from the initial 100 in the first round, you will get 50,000. If you eliminate 30 of the remaining 50 in the second round, you get 100.000, - * 30/50 = 60.000, - and you have a total of 110.000, - If you eliminate the last 20 opponents in the last round, you get 100.000, - * 20/20 = 100.000, - and your total profit will be 210,000
Write a program that determines and prints the maximum possible profit for the specified number of rounds and on the next line the numbers of opponents (separated by a space) that you have to eliminate in each round.
Example:
Input:
3
Exit:
280000
90 9 1
Hint
Solve the problem with the help of recursion, ie if you have NN opponents and KK rounds, recursively calculate the cases when you have 11, 22, and from N - 1N ? 1 opponents and K - 1K ? 1 rounds - select the maximum from all these cases.
Due to the number of possibilities, it is necessary to memorize the results once and not to calculate them again.
Нужна такая же работа?
  • Разместите заказ
  • Выберите исполнителя
  • Получите результат
Гарантия на работу1 год
Средний балл4.52
СтоимостьНазначаете сами
ЭкспертВыбираете сами
Уникальность работыот 70%
Время выполнения заказа:
1 день 10 часов 20 минут
Выполнен в срок
Отзыв о выполненном заказе
Нужна аналогичная работа?
Оформи быстрый заказ и узнай стоимость
Гарантированные бесплатные доработки в течение 1 года
Быстрое выполнение от 2 часов
Проверка работы на плагиат
Прямой эфир