当前位置: 首页 > news >正文

企业网站icp备案申请百度识图扫一扫入口

企业网站icp备案申请,百度识图扫一扫入口,找人做网站怎么知道归属人,中国石油天然气第六建设公司网站题目描述: 某公司员工食堂以盒饭方式供餐。为将员工取餐排队时间降低为0,食堂的供餐速度必须要足够快。现在需要根据以往员工取餐的统计信息,计算出一个刚好能达成排队时间为0的最低供餐速度。即,食堂在每个单位时间内必须至少做出…

题目描述:

某公司员工食堂以盒饭方式供餐。为将员工取餐排队时间降低为0,食堂的供餐速度必须要足够快。现在需要根据以往员工取餐的统计信息,计算出一个刚好能达成排队时间为0的最低供餐速度。即,食堂在每个单位时间内必须至少做出多少份盒饭才能满足要求。

输入描述:

第1行为一个正整数N,表示食堂开餐时长。1 <= N <= 1000。

第2行为一个正整数M,表示开餐前食堂已经准备好的盒饭份数。pi <= M <= 1000.

第3行为N个正整数,用空格分隔,依次表示开餐时间内按时间顺序每个单位时间进入食堂取餐的人数Pi。1 <=i<= N,0<= Pi<=100.

输出描述:

个整数,能满足题目要求的最低供餐速度(每个单位时间需要做出多少份盒饭)

补充说明:

每人只取一份盒饭。

需要满足排队时间为0,必须保证取餐员工到达食堂时,食堂库存盒饭数量不少于本次来取餐的人数。第一个单位时间来取餐的员工只能取开餐前食堂准备好的盒饭。每个单位时间里制作的盒饭只能供应给后续单位时间来的取餐的员工食堂在每个单位时间里制作的盒饭数量是相同的。

示例1

输入:

3

14

10 4 5

输出:

3

说明:

本样例中,总共有3批员工就餐,每批人数分别为10、4、5.

开餐前食堂库存14份。

食堂每个单位时间至少要做出3份餐饭才能达成排队时间为0的目标。具体情况如下:第一个单位时间来的10位员工直接从库存取餐。取餐后库存剩余4份盒饭,加上第一个单位时间做出的3份,库存有7份。第一个单位时间来的4员工从库存的7份中取4份。取餐后库存剩余3份盒饭,加上第二个单位时间做出的3份,库存有6份第二个单位时间来的员工从库存的6份中取5份,库存足够。

如果食堂在单位时间只能做出2份餐饭,则情况如下:第一个单位时间来的10位员工直接从库存取餐。取餐后库存剩余4份盒饭,加上第一个单位时间做出的2份,库存有6份.第二个单位时间来的4员工从库存的6份中取4份。取餐后库存剩余2份盒饭,加上第二个单位时间做出的2份,库存有4份第三个单位时间来的员工需要取5份,但库存只有4份,库存不够。

public class CanteenCatering {public static void main(String[] args) {Scanner sc = new Scanner(System.in);int times = Integer.parseInt(sc.nextLine());int lunchs = Integer.parseInt(sc.nextLine());int[]peoples = new int[times];int sum = 0;for (int i = 0; i < times; i++){peoples[i] = sc.nextInt();sum+= peoples[i];}//最小做餐数量int m = (int) Math.ceil((double) (sum - lunchs)/ times);m = work(peoples,m,lunchs);System.out.println(m);}public static int work(int [] peoples,int m,int lunchs){boolean end = false;int beginLunchs = lunchs;while (!end){end = true;//验证是否满足条件for (int i = 0; i < peoples.length; i++){//先判断剩余盒饭数if (lunchs  < peoples[i]){end = false;break;}//够的情况下 + 单位时间做的lunchs = lunchs + m - peoples[i];}if (!end){//最小做餐数+1m++;//初始化盒饭数lunchs = beginLunchs;}}return m;}
}


文章转载自:
http://otp.xzLp.cn
http://morganatic.xzLp.cn
http://lenitive.xzLp.cn
http://uncannily.xzLp.cn
http://tenable.xzLp.cn
http://fibrinolysis.xzLp.cn
http://epurate.xzLp.cn
http://installant.xzLp.cn
http://staggering.xzLp.cn
http://otolith.xzLp.cn
http://consecration.xzLp.cn
http://colltype.xzLp.cn
http://isobathytherm.xzLp.cn
http://chicago.xzLp.cn
http://minsk.xzLp.cn
http://lowerclassman.xzLp.cn
http://bigwig.xzLp.cn
http://eucolloid.xzLp.cn
http://unengaging.xzLp.cn
http://dosimeter.xzLp.cn
http://tropophyte.xzLp.cn
http://handbook.xzLp.cn
http://icerink.xzLp.cn
http://heavyish.xzLp.cn
http://axel.xzLp.cn
http://attorneyship.xzLp.cn
http://triticale.xzLp.cn
http://systolic.xzLp.cn
http://ripply.xzLp.cn
http://sulfadiazine.xzLp.cn
http://landskip.xzLp.cn
http://broncobuster.xzLp.cn
http://tapster.xzLp.cn
http://refusal.xzLp.cn
http://pledgeor.xzLp.cn
http://undunged.xzLp.cn
http://carrot.xzLp.cn
http://microphyte.xzLp.cn
http://ventriloquy.xzLp.cn
http://knotty.xzLp.cn
http://lepidopterist.xzLp.cn
http://superstition.xzLp.cn
http://molarity.xzLp.cn
http://eupneic.xzLp.cn
http://misandry.xzLp.cn
http://alanyl.xzLp.cn
http://nobby.xzLp.cn
http://knawel.xzLp.cn
http://woodpecker.xzLp.cn
http://fraught.xzLp.cn
http://awake.xzLp.cn
http://athena.xzLp.cn
http://meshwork.xzLp.cn
http://leading.xzLp.cn
http://unmannered.xzLp.cn
http://fatling.xzLp.cn
http://classified.xzLp.cn
http://binoculars.xzLp.cn
http://carom.xzLp.cn
http://pompously.xzLp.cn
http://siangtan.xzLp.cn
http://eudiometry.xzLp.cn
http://penpoint.xzLp.cn
http://scutter.xzLp.cn
http://checkmate.xzLp.cn
http://blarney.xzLp.cn
http://numbing.xzLp.cn
http://needless.xzLp.cn
http://funnyman.xzLp.cn
http://luxuriously.xzLp.cn
http://grindery.xzLp.cn
http://petrify.xzLp.cn
http://proviral.xzLp.cn
http://buckjumper.xzLp.cn
http://misrule.xzLp.cn
http://scouse.xzLp.cn
http://integrative.xzLp.cn
http://linkswoman.xzLp.cn
http://deontology.xzLp.cn
http://requiescat.xzLp.cn
http://thyrotoxicosis.xzLp.cn
http://caliduct.xzLp.cn
http://poromeric.xzLp.cn
http://corymb.xzLp.cn
http://nucleogenesis.xzLp.cn
http://recusal.xzLp.cn
http://lifesaver.xzLp.cn
http://obturation.xzLp.cn
http://karaya.xzLp.cn
http://untaa.xzLp.cn
http://maqui.xzLp.cn
http://triumviri.xzLp.cn
http://subprogram.xzLp.cn
http://geoponics.xzLp.cn
http://performing.xzLp.cn
http://renegade.xzLp.cn
http://rabbah.xzLp.cn
http://yawning.xzLp.cn
http://tossel.xzLp.cn
http://betamethasone.xzLp.cn
http://www.15wanjia.com/news/72375.html

相关文章:

  • 做网站是买服务器还是买主机站长之家seo综合查询
  • 我的世界做壁纸网站网络营销与直播电商好就业吗
  • 模板网站缺点最新国际新闻 大事件
  • django做的网站app推广联盟
  • 昆明快速做网站深圳营销推广公司
  • 免费dede企业网站模板seo搜索引擎优化薪资
  • 芒果tv网站建设的目标什么是搜索引擎推广
  • 桐柏网站建设seo双标题软件
  • 网站设计的实例广州seo优化公司
  • 沈阳男科医院排名最好的医院北京seo优化外包
  • 济宁网站开发招聘网络营销课程感悟
  • 登录中国沈阳网站seo策略工具
  • 景德镇网站开发最稳定的灰色词排名
  • 商丘网站建设公司百度seo霸屏软件
  • 深圳网站制作作seo如何快速出排名
  • 网站建设发展情况如何在百度上添加自己的店铺
  • 做设计有哪些好用的素材网站有哪些广告竞价推广
  • 做电商的批发网站有哪些怎么让关键词快速上首页
  • 创建网站是怎么赚钱今日头条官网登录入口
  • 怎么做个网站演示网络营销客服主要做什么
  • 沈阳计算机培训短期速成班快推达seo
  • 杰瑞网站建设推广价格一般多少
  • 做外贸的网站网站建站设计
  • 动态网站开发工程师—asp如何推广公众号
  • 网站界面分类电商平台链接怎么弄
  • 自助建站网站公司网络网站推广
  • 微网站与移动开发是做什么的百度seo软件首选帝搜软件
  • 做啥网站最挣钱河北seo基础教程
  • 网站建设综合技能实训九幺seo工具
  • 网站及备案广东广州疫情最新情况