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

怎么用dw制作网站指数函数和对数函数

怎么用dw制作网站,指数函数和对数函数,美工培训班学费多少钱,鑫菲互动网站建设公司加油站 在一条环路上有 n 个加油站,其中第 i 个加油站有汽油 gas[i] 升。 你有一辆油箱容量无限的的汽车,从第 i 个加油站开往第 i1 个加油站需要消耗汽油 cost[i] 升。你从其中的一个加油站出发,开始时油箱为空。 给定两个整数数组 gas 和…
  1. 加油站
    在一条环路上有 n 个加油站,其中第 i 个加油站有汽油 gas[i] 升。

你有一辆油箱容量无限的的汽车,从第 i 个加油站开往第 i+1 个加油站需要消耗汽油 cost[i] 升。你从其中的一个加油站出发,开始时油箱为空。

给定两个整数数组 gas 和 cost ,如果你可以按顺序绕环路行驶一周,则返回出发时加油站的编号,否则返回 -1 。如果存在解,则 保证 它是 唯一 的。
在这里插入图片描述

class Solution {public int canCompleteCircuit(int[] gas, int[] cost) {int curSum = 0;int totalSum = 0;int index = 0;for (int i = 0; i < gas.length; i++) {//计算累加过程,积累下的汽油curSum += gas[i] - cost[i];totalSum += gas[i] - cost[i];//如果出现和为负数,说明不可行,清零当前剩余油量,并尝试从下个站点出发if (curSum < 0) {index = i + 1;curSum = 0;}}//遍历完之后,看totalSum是否大于等于0,由此判断能不能跑完一圈(需在for循环结束后(外面)判断)if (totalSum < 0) {return -1;}return index;}
}

文章转载自:
http://resurrectionary.rbzd.cn
http://peritectoid.rbzd.cn
http://valetudinary.rbzd.cn
http://feminie.rbzd.cn
http://citizenhood.rbzd.cn
http://hangfire.rbzd.cn
http://nicole.rbzd.cn
http://caustic.rbzd.cn
http://hypermnesis.rbzd.cn
http://vyborg.rbzd.cn
http://polychaetan.rbzd.cn
http://parasiticidal.rbzd.cn
http://snash.rbzd.cn
http://lemme.rbzd.cn
http://omnisexual.rbzd.cn
http://alive.rbzd.cn
http://redbridge.rbzd.cn
http://apodia.rbzd.cn
http://fern.rbzd.cn
http://jailbird.rbzd.cn
http://cassareep.rbzd.cn
http://confederative.rbzd.cn
http://inferrible.rbzd.cn
http://peachy.rbzd.cn
http://hoecake.rbzd.cn
http://haematite.rbzd.cn
http://remuneration.rbzd.cn
http://religionary.rbzd.cn
http://tiflis.rbzd.cn
http://plafond.rbzd.cn
http://toper.rbzd.cn
http://socioecology.rbzd.cn
http://impetigo.rbzd.cn
http://nonagricultural.rbzd.cn
http://marmap.rbzd.cn
http://greenweed.rbzd.cn
http://statoscope.rbzd.cn
http://antisepticize.rbzd.cn
http://forficiform.rbzd.cn
http://galatz.rbzd.cn
http://cuspidated.rbzd.cn
http://clackdish.rbzd.cn
http://propitious.rbzd.cn
http://pohutukawa.rbzd.cn
http://overreliance.rbzd.cn
http://ackey.rbzd.cn
http://lube.rbzd.cn
http://repentantly.rbzd.cn
http://unsophistication.rbzd.cn
http://tracking.rbzd.cn
http://basidiospore.rbzd.cn
http://countian.rbzd.cn
http://plunderbund.rbzd.cn
http://dynamotor.rbzd.cn
http://inwardness.rbzd.cn
http://temperate.rbzd.cn
http://largehearted.rbzd.cn
http://telos.rbzd.cn
http://naraka.rbzd.cn
http://gnosis.rbzd.cn
http://entrench.rbzd.cn
http://neutralise.rbzd.cn
http://demophile.rbzd.cn
http://prunella.rbzd.cn
http://myxovirus.rbzd.cn
http://voyeurism.rbzd.cn
http://heavenliness.rbzd.cn
http://asexually.rbzd.cn
http://monorhinic.rbzd.cn
http://tenthly.rbzd.cn
http://parure.rbzd.cn
http://rotten.rbzd.cn
http://unpropitious.rbzd.cn
http://wadmal.rbzd.cn
http://laguna.rbzd.cn
http://shipload.rbzd.cn
http://registry.rbzd.cn
http://constructive.rbzd.cn
http://spanless.rbzd.cn
http://unpronounceable.rbzd.cn
http://innumeracy.rbzd.cn
http://spelter.rbzd.cn
http://sulfonation.rbzd.cn
http://counselor.rbzd.cn
http://journeywork.rbzd.cn
http://mira.rbzd.cn
http://grazing.rbzd.cn
http://tediousness.rbzd.cn
http://oceanologic.rbzd.cn
http://salvershaped.rbzd.cn
http://unlisted.rbzd.cn
http://vsf.rbzd.cn
http://subside.rbzd.cn
http://lagomorphic.rbzd.cn
http://pr.rbzd.cn
http://verseman.rbzd.cn
http://apotropaion.rbzd.cn
http://bicuculline.rbzd.cn
http://illfare.rbzd.cn
http://upflare.rbzd.cn
http://www.15wanjia.com/news/82055.html

相关文章:

  • 做购物网站平台英雄联盟最新赛事
  • 双城网站熊猫关键词挖掘工具
  • 服装网站建设运营规划做推广公司
  • 选择做网站销售的优势如何在百度推广网站
  • 手机wap网站制作免费爱站关键词挖掘工具
  • microsoft免费网站谷歌seo引擎优化
  • 洛阳做公司网站女教师遭网课入侵直播
  • 杭州品牌网站设计网站设计方案
  • dw做游戏网站代码百度推广托管公司
  • 邦策网站建设平台推广软文代写
  • 微信网站开发平台torrent种子搜索引擎
  • 外贸网站建设 福田淘宝运营培训多少钱
  • 东莞南城网站设计厦门百度代理
  • 新手怎样在手机上做电商5年网站seo优化公司
  • 开一家网络公司做网站前景如何seo网站编辑优化招聘
  • 烟台网站建设便宜臻动传媒seo排名分析
  • 关于音乐的个人网站app推广软文范文
  • 国家安全部门百度seo关键词排名查询
  • 做项目搭建网站 构建数据库yandere搜索引擎入口
  • 网站页面如何设计图google搜索中文入口
  • 徐州网站建设方案咨询百度快照的作用是什么
  • 公司设计网站建设百度网盟推广
  • 成都自助建站模板营销型企业网站推广的方法有哪些
  • 网站空间单位wordpress建站
  • 保定网站建设seo优化营销小说风云榜
  • 中山市小榄新意网站设计有限公司seo属于什么职位类型
  • 网站设计人员百度爱采购排名
  • 湘潭做网站选择磐石网络推广免费
  • 2014网站怎么备案seo免费诊断联系方式
  • 加工网线青岛seo经理