小慕有一辆货车,为50000。现在他需要运送一批重量不一的快递,请你帮他计算这辆货车最多能运载多少个快递。快递数量最多为1000个。 注:不考虑快递的体积。
提示:带虚线的词点一下有通俗解释。
输入描述
<div data-page-id="AIvEd5MWRoSw5QxwQPycGXLunvf" data-docx-has-block-data="false"> <div style="white-space-collapse:preserve;" class="ace-line ace-line old-record-id-Zqiydk48coUOcSxwPJecSvNJnfg"> 第一行输入每个快递的重量,用英文逗号隔开,如 <code>5,10,2,11</code> 第二行输入货车的最大载重量,如 <code>20</code> </div> </div> <span data-lark-record-data="{"rootId":"AIvEd5MWRoSw5QxwQPycGXLunvf","text":{"initialAttributedTexts":{"text":{"0":"第一行输入每个快递的重量,用英文逗号隔开,如 5,10,2,11\n第二行输入货车的最大载重量,如 20"},"attribs":{"0":"*0+n*0*1+9*0|1+1*0+g*0*1+2"}},"apool":{"numToAttrib":{"0":["author","7115054903550050305"],"1":["inlineCode","true"]},"nextNum":2}},"type":"text","referenceRecordMap":{},"extra":{"mention_page_title":{},"external_mention_url":{}},"isKeepQuoteContainer":false,"isFromCode":false,"selection":[{"id":7,"type":"text","selection":{"start":0,"end":51},"recordId":"Zqiydk48coUOcSxwPJecSvNJnfg"}],"payloadMap":{},"isCut":false}" data-lark-record-format="docx/text" class="lark-record-clipboard"></span>
输出描述
<div data-page-id="AIvEd5MWRoSw5QxwQPycGXLunvf" data-docx-has-block-data="false"> <div style="white-space-collapse:preserve;" class="ace-line ace-line old-record-id-GgIyd8Owqos26gxGqElcOoYWnId"> 输出最多能装多少个快递,如 <code>3</code> </div> </div> <span data-lark-record-data="{"rootId":"AIvEd5MWRoSw5QxwQPycGXLunvf","text":{"initialAttributedTexts":{"text":{"0":"输出最多能装多少个快递,如 3"},"attribs":{"0":"*0+e*0*1+1"}},"apool":{"numToAttrib":{"0":["author","7115054903550050305"],"1":["inlineCode","true"]},"nextNum":2}},"type":"text","referenceRecordMap":{},"extra":{"mention_page_title":{},"external_mention_url":{}},"isKeepQuoteContainer":false,"isFromCode":false,"selection":[{"id":9,"type":"text","selection":{"start":0,"end":15},"recordId":"GgIyd8Owqos26gxGqElcOoYWnId"}],"payloadMap":{},"isCut":false}" data-lark-record-format="docx/text" class="lark-record-clipboard"></span>
示例
示例 1
输入
5,10,2,11 20
输出
3
时间限制 1000 ms · 内存限制 128 MB