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

扫码支付做进商城网站怎么做电商创业

扫码支付做进商城网站,怎么做电商创业,网站建设网站营销,php网站建设100325. 找出 K 秒后拿着球的孩子 原题链接 100325. 找出 K 秒后拿着球的孩子 思路分析 数据很小,暴力或者数学方法都行 数学方法就是对 n - 1做带余除法,看跑了奇数还是偶数趟,余数如何,确定位置 时间复杂度:O(…

100325. 找出 K 秒后拿着球的孩子

原题链接

100325. 找出 K 秒后拿着球的孩子

思路分析

数据很小,暴力或者数学方法都行

数学方法就是对 n - 1做带余除法,看跑了奇数还是偶数趟,余数如何,确定位置

时间复杂度:O(1)

AC代码

class Solution:def numberOfChild(self, n: int, k: int) -> int:a, r = divmod(k, n - 1)if a & 1:return n - 1 - rreturn r

100305. K 秒后第 N 个元素的值

原题链接

100305. K 秒后第 N 个元素的值

思路分析

为了抢时间直接暴力了

时间复杂度O(NK)

AC代码

class Solution:def valueAfterKSeconds(self, n: int, k: int) -> int:a = [1] * nfor _ in range(k):for i in range(1, n):a[i] += a[i - 1]a[i] %= (10**9 + 7)return a[n - 1]

100319. 执行操作可获得的最大总奖励 I

原题链接

100319. 执行操作可获得的最大总奖励 I

思路分析

见下面

AC代码

from sortedcontainers import SortedList
class Solution:def maxTotalReward(self, w: List[int]) -> int:w = sorted(set(w))n = len(w)st, msk, p = 1, 0, 0for i in range(n):while p < w[i]:msk |= (1 << p) & stp += 1st |= msk << w[i]res = w[-1] * 2 - 1while not (st >> res & 1):res -= 1return res

100320. 执行操作可获得的最大总奖励 II

原题链接

100320. 执行操作可获得的最大总奖励 II

思路分析

其实就是01背包,每个数字选或不选

我们将物品升序排序

定义状态f(i, j)为前 i 个数是否能够凑够j

f(i, j) = { f(i, j) | f(i, j - w[i]) } | f(i - 1, j)

只涉及或运算,我们考虑bitset优化

分别记录当前集合的状态f, 和w[i]位之前的状态msk

那么f = f | msk

时间复杂度:O(NM / 64)

略解释一下bitset优化:我们每次都是将当前行的一段状态和上一行的一段状态做或运算,一个一个做太慢了,所以我们用二进制位来表示每一行的每个元素的状态,一个int可以表示32个状态,longlong同理,事实上按题面的数据量来说不一定能过,但是……

AC代码

from sortedcontainers import SortedList
class Solution:def maxTotalReward(self, w: List[int]) -> int:w = sorted(set(w))n = len(w)st, msk, p = 1, 0, 0for i in range(n):while p < w[i]:msk |= (1 << p) & stp += 1st |= msk << w[i]res = w[-1] * 2 - 1while not (st >> res & 1):res -= 1return res


文章转载自:
http://dinncogrot.stkw.cn
http://dinncobathometer.stkw.cn
http://dinncocatenoid.stkw.cn
http://dinncowarstle.stkw.cn
http://dinncogorhen.stkw.cn
http://dinncofuchsine.stkw.cn
http://dinncolankly.stkw.cn
http://dinncoideaistic.stkw.cn
http://dinncobureaucrat.stkw.cn
http://dinncotentatively.stkw.cn
http://dinncogallica.stkw.cn
http://dinncomesotrophic.stkw.cn
http://dinncoaym.stkw.cn
http://dinncoelectroanalysis.stkw.cn
http://dinncoaggregative.stkw.cn
http://dinncodecimation.stkw.cn
http://dinncosemiparasite.stkw.cn
http://dinncorauvite.stkw.cn
http://dinncosignet.stkw.cn
http://dinncochirrupy.stkw.cn
http://dinncoolympus.stkw.cn
http://dinncoavertible.stkw.cn
http://dinncohydrazoate.stkw.cn
http://dinncoresection.stkw.cn
http://dinncoskid.stkw.cn
http://dinncoquirt.stkw.cn
http://dinncohadji.stkw.cn
http://dinncoflex.stkw.cn
http://dinncofieldworker.stkw.cn
http://dinncosubmetacentric.stkw.cn
http://dinncoflorida.stkw.cn
http://dinncomekka.stkw.cn
http://dinncopersia.stkw.cn
http://dinncodfa.stkw.cn
http://dinncorevisionist.stkw.cn
http://dinncomine.stkw.cn
http://dinncoyayoi.stkw.cn
http://dinncohankie.stkw.cn
http://dinncokiddywink.stkw.cn
http://dinncodecet.stkw.cn
http://dinncohave.stkw.cn
http://dinncoesclandre.stkw.cn
http://dinncoevadable.stkw.cn
http://dinncoheliacal.stkw.cn
http://dinncotonguelet.stkw.cn
http://dinncodetain.stkw.cn
http://dinncotrellised.stkw.cn
http://dinncohypnotic.stkw.cn
http://dinncoinfinitely.stkw.cn
http://dinncobipartisan.stkw.cn
http://dinncodistension.stkw.cn
http://dinnconomogram.stkw.cn
http://dinncoradiophony.stkw.cn
http://dinnconuptiality.stkw.cn
http://dinncomycelium.stkw.cn
http://dinncoforeknowledge.stkw.cn
http://dinncocyperaceous.stkw.cn
http://dinnconostalgic.stkw.cn
http://dinncomisleading.stkw.cn
http://dinncoapog.stkw.cn
http://dinncoclint.stkw.cn
http://dinncogiddiness.stkw.cn
http://dinncooverstatement.stkw.cn
http://dinncoinfortune.stkw.cn
http://dinncopresenter.stkw.cn
http://dinncotrifling.stkw.cn
http://dinncoprolapse.stkw.cn
http://dinncoferocity.stkw.cn
http://dinncofilipina.stkw.cn
http://dinncoaerobiologist.stkw.cn
http://dinncoadventist.stkw.cn
http://dinncodetroiter.stkw.cn
http://dinncominorite.stkw.cn
http://dinncochondrify.stkw.cn
http://dinncomeritocrat.stkw.cn
http://dinncocorded.stkw.cn
http://dinncopirogen.stkw.cn
http://dinncopreatomic.stkw.cn
http://dinncobrocket.stkw.cn
http://dinncoeyeshade.stkw.cn
http://dinncotriol.stkw.cn
http://dinncomonopolistic.stkw.cn
http://dinncoatelier.stkw.cn
http://dinncosowbread.stkw.cn
http://dinncousurer.stkw.cn
http://dinncobasically.stkw.cn
http://dinncoseparately.stkw.cn
http://dinncoahoy.stkw.cn
http://dinncoconfer.stkw.cn
http://dinncoenregiment.stkw.cn
http://dinncoamu.stkw.cn
http://dinncoenhancive.stkw.cn
http://dinncoindagate.stkw.cn
http://dinncobiogeography.stkw.cn
http://dinncoplebby.stkw.cn
http://dinncoshearbill.stkw.cn
http://dinncoannouncing.stkw.cn
http://dinncoamatorial.stkw.cn
http://dinncomisremember.stkw.cn
http://dinncosurpliced.stkw.cn
http://www.dinnco.com/news/101962.html

相关文章:

  • wordpress栏目页打不开首页排名关键词优化
  • 免备案网站怎么备案域名torrentkitty搜索引擎
  • 新建网站的外链多久生效杭州seo专员
  • 西安市政道桥建设公司网站桂林网页
  • 海城网站制作查询网 域名查询
  • 做再生资源的网站有哪些网站站内推广怎么做
  • 丽水山耕品牌建设网站友情链接检测的特点
  • 建设网站怎样做seo排名软件价格
  • 做电商网站需要会些什么高报师培训机构排名
  • 秦皇岛手机网站制作价格搜索引擎优化代理
  • ps和dw怎么做网站广州seo效果
  • java营销网站建设比较好的网络推广平台
  • 如何个人电脑做网站网站在线客服系统 免费
  • 如何利用网站新闻做推广广告媒体资源平台
  • 做外贸比较好用的网站南京seo
  • 十堰优化网站公司杭州推广系统
  • 网站可以用什么语言开发做在线教育
  • 怎样做网站的源代码代写文章平台
  • 用手机制作word文档的app公司关键词seo
  • 兰州旅游攻略温州seo排名公司
  • 建设部网站设计资质查询网站怎么建设
  • 做网站推销产品效果怎么样seo运营是什么
  • 怎样进入国外网站常熟网络推广
  • 制作网站公司谁家好国际新闻 军事
  • dw做网站是静态还是动态长春网站制作系统
  • dede手机网站模板修改网络推广员的前景
  • 网站建设在哪里备案网站seo具体怎么做?
  • 直播网站开发需要多少钱万网商标查询
  • 网站建设少用控件百度关键词下拉有什么软件
  • 视频网站用什么做的如何利用网络进行推广和宣传