[Huawei OD test questions] The maximum number of text messages obtained (cloud SMS platform promotion) (python) 100% pass rate super detailed code comment code optimization

[Huawei OD machine test real questions 2022&2023] real test catalog @click here @
[Huawei OD machine test real questions] signal transmission and reception & trial reading & @click here @
[Huawei OD machine real test questions] rent a car to ride the greenway & trial reading & @点here@

Cloud SMS platform promotions

Knowledge point hash table queue array statistics greedy
time limit: 1s space limit: 256MB limited language: unlimited

Title description:

A cloud SMS manufacturer launched a recharge promotion to celebrate the National Day. Now given the customer's budget and the series of preferential selling prices, find the maximum number of SMS messages that can be obtained.

Enter a description:

The first line of customer budget M, where 0<=M<=1000000
The second line gives the price list, P1, P2...Pn, where 1<=n<=100 pi is the number of text messages obtained by recharging i yuan 1< =Pi<=1000, 1<=n

Guess you like

Origin blog.csdn.net/weixin_45541762/article/details/130671756