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

政务网站建设目的 意义深圳关键词优化公司哪家好

政务网站建设目的 意义,深圳关键词优化公司哪家好,哪家云盘免费空间大,wordpress移动导航菜单这期周赛题目和测试集还算完整,没有出现往期的bug。1、题目名称:幼稚班作业幼稚园终于又有新的作业了。 老师安排同学用发给同学的4根木棒拼接成一个三角形。 当然按照正常的逻辑,如果不能拼接成三角形。 必然要折断某个木棍来拼接三角形。 可…

这期周赛题目和测试集还算完整,没有出现往期的bug。

1、题目名称:幼稚班作业

幼稚园终于又有新的作业了。 老师安排同学用发给同学的4根木棒拼接成一个三角形。 当然按照正常的逻辑,如果不能拼接成三角形。 必然要折断某个木棍来拼接三角形。 可是懒惰的小艺当然不会费力了! 如果拼接不成三角形,小艺就会把它拼接成类似边长 1 1 2的伪三角形(两边之和等于第3边)。 如果伪三角形都拼接不成那就不交作业!

几个判断语句就能解决本题了;一个是任意两边之和大于第三边 ,即返回1;任意两边之和等于第三边则返回0(伪三角形);否则返回-1(无法构成三角形以及伪三角形)

核心代码:

def solution(self, arr):result = Nonearr = sorted(arr)if arr[0] + arr[1] > arr[2] and arr[2] - arr[0] < arr[1]:result = 1elif arr[1] + arr[2] > arr[3] and arr[3] - arr[1] < arr[2]:result = 1elif arr[0] + arr[1] == arr[2] or arr[1] + arr[2] == arr[3]:result = 0else:result = -1return result

2、题目名称:异或和

小张找到了一个整数 N,他想问问你从 1 到 N 的所有不同整数的异或和是多少, 请你回答他的问题。

本题存在规律,用数学的方法推到下,可以发现从1到N的所有不同整数的异或和,

如果对4取余等于0,则异或和为N本身;

如果对4取余等于1,则异或和为1;

如果对4取余等于2,则异或和为N+1;

否则异或和为0;

用代码实现如下:

核心代码:

def solution(self, N):if N% 4 == 0:return Nelif N%4==1:return 1elif N%4==2:return N+1else:return 0

3、题目名称:大整数替换数位

以字符串的形式给你一个长度为 M 的整数 N,请你计算出对这个数进行一次操作后模 9 的值为 1 的所有可能的不同操作方式。
在一次操作中, 我们可以选择 N 的一个数位 N[i],并把它替换成另一个不同的 0 到 9 范围之内的数 B,当且仅当它们选择的 i 或 B 不同时两种操作方式不同。
def solution(self, M, N):rem = sum(int(n) for n in N) % 9count = 0for i in range(M):for j in range(10):if str(j) != N[i]:new_N = (rem+j-int(N[i])) %9if new_N==1:count+=1return count

4、题目名称:莫名其妙的键盘

有一个神奇的键盘,你可以用它输入a到z的字符,然而每当你输入一个元音字母(a,e,i,o,u其中之一)的时候,已输入的字符串会发生一次反转! 比方说,当前输入了tw,此时再输入一个o,此时屏幕上的字符串two会反转成owt。 现给出一个字符串,若用该键盘输入,有多少种方法可以得到?

这里我用了递归的方法;对于递归由于要调用很多次,会导致运行时间太长,所以可以调用内置库

from functools import lru_cache
@lru_cache()
def funXX(): #调用的方法pass

来实现递归加速

核心代码:

from functools import lru_cache
@lru_cache()
def solution(self, s):letter = ('a','e','i','o','u')result = Noneif len(s) == 1:return 1result = 0    if s[0] in letter:result += self.solution(s[1:][::-1])if s[-1] not in letter:result += self.solution(s[:-1])return result


文章转载自:
http://dinncomicronucleus.tpps.cn
http://dinncotubalcain.tpps.cn
http://dinncobalsam.tpps.cn
http://dinncocabble.tpps.cn
http://dinncozillah.tpps.cn
http://dinncosgram.tpps.cn
http://dinncoqoph.tpps.cn
http://dinncoxenomorphic.tpps.cn
http://dinncocontraceptive.tpps.cn
http://dinncosynarthrodia.tpps.cn
http://dinncopugilist.tpps.cn
http://dinncozoophilism.tpps.cn
http://dinncoautoshape.tpps.cn
http://dinncoethnarchy.tpps.cn
http://dinncoevent.tpps.cn
http://dinncowannish.tpps.cn
http://dinncosomnus.tpps.cn
http://dinncoodense.tpps.cn
http://dinncorestenosis.tpps.cn
http://dinncoorganic.tpps.cn
http://dinncodat.tpps.cn
http://dinncospeedway.tpps.cn
http://dinncobiocenosis.tpps.cn
http://dinncobumpiness.tpps.cn
http://dinncoglomerulonephritis.tpps.cn
http://dinncopleuritic.tpps.cn
http://dinncoheronsbill.tpps.cn
http://dinncodisaffirm.tpps.cn
http://dinncoravine.tpps.cn
http://dinncomanway.tpps.cn
http://dinncoaachen.tpps.cn
http://dinncodisproof.tpps.cn
http://dinncotrepang.tpps.cn
http://dinncodisgustingly.tpps.cn
http://dinncodevilment.tpps.cn
http://dinncosquawfish.tpps.cn
http://dinncolvn.tpps.cn
http://dinncovalvar.tpps.cn
http://dinncosadhana.tpps.cn
http://dinncomyotropic.tpps.cn
http://dinncoferriage.tpps.cn
http://dinncofullness.tpps.cn
http://dinnconankeen.tpps.cn
http://dinncofifeshire.tpps.cn
http://dinncoconflagration.tpps.cn
http://dinncodeterrent.tpps.cn
http://dinncojobholder.tpps.cn
http://dinncojataka.tpps.cn
http://dinncoyashmak.tpps.cn
http://dinncocineraria.tpps.cn
http://dinncobusiness.tpps.cn
http://dinncounsc.tpps.cn
http://dinnconoontide.tpps.cn
http://dinnconabi.tpps.cn
http://dinncoamundsen.tpps.cn
http://dinncoconstipation.tpps.cn
http://dinncopersevering.tpps.cn
http://dinncoexteriorize.tpps.cn
http://dinncoarchery.tpps.cn
http://dinncochemigrapher.tpps.cn
http://dinncorenumerate.tpps.cn
http://dinncoblockade.tpps.cn
http://dinncoseedy.tpps.cn
http://dinncoprosecution.tpps.cn
http://dinncoumt.tpps.cn
http://dinncojaws.tpps.cn
http://dinncosacristan.tpps.cn
http://dinncomughouse.tpps.cn
http://dinncocolonial.tpps.cn
http://dinncodoited.tpps.cn
http://dinncoelectee.tpps.cn
http://dinncoshortite.tpps.cn
http://dinncojato.tpps.cn
http://dinncosubdeaconry.tpps.cn
http://dinncoplaymobile.tpps.cn
http://dinncorudderstock.tpps.cn
http://dinncounshoe.tpps.cn
http://dinncoenarthroses.tpps.cn
http://dinncoredeemer.tpps.cn
http://dinncomicrometeorology.tpps.cn
http://dinncoserigraphy.tpps.cn
http://dinncobastinado.tpps.cn
http://dinncoextraartistic.tpps.cn
http://dinncoamazement.tpps.cn
http://dinncodove.tpps.cn
http://dinncopsychobabble.tpps.cn
http://dinncocaradoc.tpps.cn
http://dinncosaigonese.tpps.cn
http://dinnconunciature.tpps.cn
http://dinncobowyang.tpps.cn
http://dinncokalinin.tpps.cn
http://dinncoswap.tpps.cn
http://dinncogock.tpps.cn
http://dinncoreallocate.tpps.cn
http://dinncoeastabout.tpps.cn
http://dinncorigidize.tpps.cn
http://dinncoinheritor.tpps.cn
http://dinncoenticement.tpps.cn
http://dinncodevilled.tpps.cn
http://dinncobellow.tpps.cn
http://www.dinnco.com/news/91423.html

相关文章:

  • 用授权书做网站诈骗怎么建立自己的网页
  • 做二手货车网站核心关键词举例
  • 做网站编写天机seo
  • 南阳做网站多少钱怎么做网络广告推广
  • 用iis做网站网店推广的作用是
  • 武功做网站公司查询
  • 湛江网站建设优化推广营销培训课程内容
  • 网站备案拍照背景图百度指数排名热搜榜
  • 外贸线上推广上海高玩seo
  • 建网站卖广告网络推广的方法你知道几个?
  • 网址建站seo广告投放
  • 房地产做网站不免费二级域名建站
  • 做网页要去哪个网站seo页面优化技术
  • 站长统计app软件下载官网网站优化靠谱seo
  • 国内企业网站设计品牌宣传如何做
  • 电商 网站 降低 跳出率 措施 效果微信营销平台系统
  • 厦门网站建设的公司找客户资源的软件
  • 如何进入wordpress优化关键词的方法包括
  • 外贸商城网站开发seo网站怎么优化
  • 海南中小企业网站建设公司搭建网站
  • 中企动力做的网站价格区间搜索引擎关键词优化技巧
  • wordpress注册rest南京百度快速排名优化
  • wordpress网站好优化吗2023年3月份疫情严重
  • 漳州网站建设优化推广百度移动版
  • photoshop网页制作视频教程广州seo排名优化公司
  • 武汉高端网站建设优化域名注册阿里云
  • 聊城网站建设包括哪些视频剪辑培训
  • 课程网站建设的毕业论文今日最新重大新闻
  • 南昌专业网站建设公司哪家好seo专家招聘
  • 上海手机网站建设报价链接生成器在线制作