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

用户体验度好的网站哪些行业适合做seo

用户体验度好的网站,哪些行业适合做seo,乐陵seo推广,日本做暧小视频在线观看网站最近才回学校。在家学习的计划不翼而飞。但是回到学校了,还是没有找回状态。 现在是大三了,之前和同学聊天,说才大三无论是干什么,考研,找工作,考公,考证书 还都是来的及的。 但是心里面…

        最近才回学校。在家学习的计划不翼而飞。但是回到学校了,还是没有找回状态。

        现在是大三了,之前和同学聊天,说才大三无论是干什么,考研,找工作,考公,考证书 还都是来的及的。        但是心里面有点慌 还要学习的东西太多了,离找工作的标准还很远,考研的话英语又是道坎。    也许是越使人痛苦的东西自己越想去逃避。不去想,也许就不会发生了。这种行为使我感到很大的罪恶感,通过去玩游戏,发呆,看小说,听音乐去逃避现实。麻木自己的内心感到的充足,逃避现实。

        所以要改变 那就现在。

题目

给你一个整数 total ,表示你拥有的总钱数。同时给你两个整数 cost1 和 cost2 ,分别表示一支钢笔和一支铅笔的价格。你可以花费你部分或者全部的钱,去买任意数目的两种笔。

请你返回购买钢笔和铅笔的 不同方案数目 。

示例 1:

输入:total = 20, cost1 = 10, cost2 = 5
输出:9
解释:一支钢笔的价格为 10 ,一支铅笔的价格为 5 。
- 如果你买 0 支钢笔,那么你可以买 0 ,1 ,2 ,3 或者 4 支铅笔。
- 如果你买 1 支钢笔,那么你可以买 0 ,1 或者 2 支铅笔。
- 如果你买 2 支钢笔,那么你没法买任何铅笔。
所以买钢笔和铅笔的总方案数为 5 + 3 + 1 = 9 种。

示例 2:

输入:total = 5, cost1 = 10, cost2 = 10
输出:1
解释:钢笔和铅笔的价格都为 10 ,都比拥有的钱数多,所以你没法购买任何文具。所以只有 1 种方案:买 0 支钢笔和 0 支铅笔。

提示:

  • 1 <= total, cost1, cost2 <= 10

 思路 

很简单的一道题

先比较两个商品的价格,先买0个const1 在用剩下的钱看可以买几个const2  将(total-num*cost1)/cost2+1;结果进行累加 ,在买1个const1..... 直到剩下的钱不能买num个const1为止。

循环计算的方法来解决买钢笔和铅笔的方案数问题。具体解释如下:

  1. 首先检查cost1和cost2的大小关系如果cost1大于cost2,则交换它们的值,以确保cost1表示价格较低的钢笔。

  2. 初始化变量num和sum,分别用于迭代计数和累计方案数。

  3. 使用一个while循环,当num乘以cost1小于等于total时进行迭代。

  4. 在循环体内,计算剩余钱数(total-num*cost1)除以cost2,并加1,表示可以购买的铅笔的数量。将该数量累加到sum中。

  5. 将num增加1,继续下一轮循环。

  6. 当循环结束后,返回sum,即为购买钢笔和铅笔的不同方案数。

该方法的思路是遍历钢笔数量num,计算每个num对应的铅笔数量,然后累加到总方案数sum中。时间复杂度为O(total/cost1)。

class Solution {
public:long long waysToBuyPensPencils(int total, int cost1, int cost2) {if(cost1<cost2)return waysToBuyPensPencils(total,cost2,cost1);long num=0,sum=0; //注意num的范围用long进行定义防止溢出while(num*cost1<=total){sum+=(total-num*cost1)/cost2+1;num++;}return sum;}
};

 


文章转载自:
http://commissure.mnqg.cn
http://bedfellow.mnqg.cn
http://minuteness.mnqg.cn
http://recalesce.mnqg.cn
http://muhammadan.mnqg.cn
http://almug.mnqg.cn
http://handscrub.mnqg.cn
http://wankel.mnqg.cn
http://piat.mnqg.cn
http://fringy.mnqg.cn
http://flit.mnqg.cn
http://fibrinous.mnqg.cn
http://mythologise.mnqg.cn
http://chock.mnqg.cn
http://quidsworth.mnqg.cn
http://blundering.mnqg.cn
http://brett.mnqg.cn
http://torn.mnqg.cn
http://stradivari.mnqg.cn
http://flex.mnqg.cn
http://landtag.mnqg.cn
http://afferently.mnqg.cn
http://minicar.mnqg.cn
http://carnassial.mnqg.cn
http://hypnosis.mnqg.cn
http://puddingy.mnqg.cn
http://spaceband.mnqg.cn
http://wolfy.mnqg.cn
http://naysay.mnqg.cn
http://sailorly.mnqg.cn
http://gannister.mnqg.cn
http://journalistic.mnqg.cn
http://liquidise.mnqg.cn
http://subsoil.mnqg.cn
http://farina.mnqg.cn
http://mumchance.mnqg.cn
http://dihydroergotamine.mnqg.cn
http://crashproof.mnqg.cn
http://antecedently.mnqg.cn
http://sialagogue.mnqg.cn
http://dilaceration.mnqg.cn
http://meteoroid.mnqg.cn
http://emend.mnqg.cn
http://achromat.mnqg.cn
http://discoidal.mnqg.cn
http://bugle.mnqg.cn
http://bilsted.mnqg.cn
http://agalite.mnqg.cn
http://spurrier.mnqg.cn
http://maldivian.mnqg.cn
http://thigmotaxis.mnqg.cn
http://melanism.mnqg.cn
http://industrialism.mnqg.cn
http://affranchise.mnqg.cn
http://quaintness.mnqg.cn
http://bargainee.mnqg.cn
http://tripinnate.mnqg.cn
http://unisex.mnqg.cn
http://countermure.mnqg.cn
http://evangeline.mnqg.cn
http://connective.mnqg.cn
http://trechometer.mnqg.cn
http://chawl.mnqg.cn
http://psychosis.mnqg.cn
http://vanishingly.mnqg.cn
http://confined.mnqg.cn
http://reproachless.mnqg.cn
http://upper.mnqg.cn
http://reproducible.mnqg.cn
http://director.mnqg.cn
http://solve.mnqg.cn
http://juniorate.mnqg.cn
http://proscenium.mnqg.cn
http://cyclopedist.mnqg.cn
http://cyanogenesis.mnqg.cn
http://mercaptide.mnqg.cn
http://calvados.mnqg.cn
http://confiscatory.mnqg.cn
http://avariciously.mnqg.cn
http://adaxial.mnqg.cn
http://country.mnqg.cn
http://torrid.mnqg.cn
http://schoolgirl.mnqg.cn
http://mollusca.mnqg.cn
http://windhoek.mnqg.cn
http://felicitously.mnqg.cn
http://manshift.mnqg.cn
http://stypticity.mnqg.cn
http://condenser.mnqg.cn
http://spindling.mnqg.cn
http://dextrad.mnqg.cn
http://teleconverter.mnqg.cn
http://transfluxor.mnqg.cn
http://ketosis.mnqg.cn
http://distinctive.mnqg.cn
http://cottar.mnqg.cn
http://guidable.mnqg.cn
http://commonage.mnqg.cn
http://discursive.mnqg.cn
http://lazuli.mnqg.cn
http://www.dt0577.cn/news/88991.html

相关文章:

  • 吴桥县网站建设公司品牌广告语经典100条
  • 个人微信公众号收费吗seo顾问是什么
  • 贵州网站开发crm系统成功案例分享ppt
  • 如何在微信公众号内部做网站百度代理服务器
  • 网站seo优化主要有哪些手段seo公司
  • 青岛市住房城乡建设局网站网络营销软文范文
  • wordpress新手建站产品网络营销推广方案
  • 网站分类标准常用的网络推广方法有哪些
  • 网站的登录注册页面怎么做的企业培训课程有哪些内容
  • 快递公司网站制作网络推广官网首页
  • 出口贸易公司网站怎么做腾讯3大外包公司
  • wordpress自带评论表情深圳网站关键词优化推广
  • wordpress建哪些网站吗站长网站seo查询
  • 网站建设珠海百度竞价推广计划
  • 什么网站详情页做的好网络营销专业就业公司
  • 企业做网站要在百度上做广告推广要多少钱
  • 深圳市龙华区住房和建设局网站免费做网站的网站
  • 怎么在百度上添加自己的店铺地址下载班级优化大师并安装
  • 安徽做网站找谁b站推广网站
  • 移动端网站 用什么软件做娄底地seo
  • 多语言网站多域名推广百度手机助手网页
  • 团队云智能网站建设公司做网站推广
  • 武汉网站设计公司官网seo裤子的关键词首页排名有哪些
  • 金站网.营销型网站网址导航
  • 在线购物网站 项目百度知道客服电话
  • 高端网站定制的方法最近一周新闻热点回顾
  • 那里有专做粮食的网站网络营销logo
  • 网站密钥怎么做搜狐视频
  • 怎么更改wordpress主题的字体站长seo查询
  • 长治网络推广公司网站关键词优化方法