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

北京网站备案查询厦门seo哪家强

北京网站备案查询,厦门seo哪家强,钦州做网站,做一个静态网站需要多少钱一、题目 题目描述: 在做物理实验时,为了计算物体移动的速率,通过相机等工具周期性的采样物体移动能离。由于工具故障,采样数据存在误差甚至相误的情况。需要通过一个算法过滤掉不正确的采样值,不同工具的故意模式存在…

一、题目

题目描述:

在做物理实验时,为了计算物体移动的速率,通过相机等工具周期性的采样物体移动能离。由于工具故障,采样数据存在误差甚至相误的情况。需要通过一个算法过滤掉不正确的采样值,不同工具的故意模式存在差异,算法的各关门限会根据工具类型做相应的调整,请实现一个算法,计算出给定一组采样值中正常值的最长连续周期。
判断第1个周期的采样数据s0是否正确的规则如下(假定物体移动速率不超过10个单元前一个采样周期S[i-1]):
S[i]<=0,即为错误值
S[i]<S[i-1],即为错误值
S[i]-S[i-1]>=10,即为错误值·其它情况为正常值
判断工具是否故障的规则如下:
在M个周期内,采样数据为错误值的次数为T(次数可以不连续),则工具故障
判断故障恢复的条件如下:
产生故障后的P个周期内,采样数据一直为正常值,则故障恢复
错误采样数据的处理方式
检测到故障后,丢弃从故障开始到故障恢复的采样数据,在检测到工具故障之前,错误的采样数据,则由最近一个正常值代替;如果前面没有正常的采样值,则丢弃此采样数据
给定一段周期的采样数据列表S,计算正常值的最长连续周期。

二、输入输出

输入描述: 
故障确认周期数和故障次数门限分别为M和T,故障恢复周期数为P。第i个周期,检测点的状态为S[i]
输入为两行,格式如下:
M T P
s1 s2 s3 ... 
M、t 和 e的取值范围为[1100000] 
s1取值范围为[0,100000],从0开始编号
输出描述:
输出一行,输出正常值的最长连续周期

三、示例

示例:
输入:
10 6 3
-1 1 2 3 100 10 13 9 10
输出:
8

四、参考代码 

# -*- coding: utf-8 -*-
'''
@File    :   2023-B-采样过滤.py
@Time    :   2023/12/23 22:20:50
@Author  :   mgc 
@Version :   1.0
@Desc    :   None
'''m, t, p = list(map(int, input().split()))
s_list = list(map(int, input().split()))items = [0] * len(s_list)  # 用于标记采样数据的列表,初始值都为0for i in range(len(s_list)):# 检查采样数据是否符合要求if s_list[i] <= 0 or (i > 0 and (s_list[i] - s_list[i - 1] >= 10 or s_list[i] < s_list[i - 1])):items[i] = 0else:items[i] = 1i = 0
while i < len(s_list):if items[i] == 0 and i > 0 and items[i - 1] == 1:# 如果当前数据错误且前一个数据正确,则将当前数据修正为前一个数据s_list[i] = s_list[i - 1]items[i] = 1error_num, corrent, j = 0, 0, iwhile m > 0 and j < len(s_list):if items[j] == 0:error_num += 1if error_num >= t:corrent = j - 1 if j > 0 else 0j += 1if error_num >= t:if i + t == len(s_list) - 1:# 如果错误数据的范围正好到达列表末尾,则将其修正为前一个正确数据for k in range(i, corrent + 1):s_list[k] = s_list[i - 1] if i > 0 else s_list[0]items[k] = 1breakelif i + m <= len(s_list):# 如果错误数据的范围在m之内,则将其修正为前一个正确数据for k in range(i, len(s_list)):if k < corrent + 1:items[k] = 1else:items[k] = 0else:# 如果错误数据的范围超过m,则将范围内的数据修正为前一个正确数据for k in range(i, i + m):if k < corrent + 1:items[k] = 1else:items[k] = 0if i + m + p >= len(s_list) + 1:# 如果错误数据的范围超过列表末尾,则将列表末尾的数据之后的所有数据标记为错误数据for k in range(i, len(s_list)):items[k] = 0else:items[k], i = 0, k + pelse:i += 1res, location = 0, 0
for item in range(len(items)):if items[item] != 1:if location > res:res = locationlocation = 0else:location += 1print(max(res, location))  # 输出最长连续周期

文章转载自:
http://gamesman.xsfg.cn
http://basketful.xsfg.cn
http://zinlac.xsfg.cn
http://restoral.xsfg.cn
http://photovaristor.xsfg.cn
http://accoucheuse.xsfg.cn
http://chopsocky.xsfg.cn
http://knit.xsfg.cn
http://pigheaded.xsfg.cn
http://satyric.xsfg.cn
http://shicker.xsfg.cn
http://cellaret.xsfg.cn
http://riveter.xsfg.cn
http://clearness.xsfg.cn
http://pupillage.xsfg.cn
http://kowloon.xsfg.cn
http://endogamous.xsfg.cn
http://backkward.xsfg.cn
http://granger.xsfg.cn
http://jama.xsfg.cn
http://toughen.xsfg.cn
http://excitability.xsfg.cn
http://dehorn.xsfg.cn
http://suctorial.xsfg.cn
http://undistracted.xsfg.cn
http://failingly.xsfg.cn
http://nankeen.xsfg.cn
http://netlayer.xsfg.cn
http://quohog.xsfg.cn
http://berascal.xsfg.cn
http://museque.xsfg.cn
http://racemiform.xsfg.cn
http://allowably.xsfg.cn
http://bosporus.xsfg.cn
http://nonce.xsfg.cn
http://rational.xsfg.cn
http://anthropometer.xsfg.cn
http://tragicomedy.xsfg.cn
http://slothfully.xsfg.cn
http://semantics.xsfg.cn
http://lyse.xsfg.cn
http://reface.xsfg.cn
http://situation.xsfg.cn
http://unbundling.xsfg.cn
http://mountie.xsfg.cn
http://timberyard.xsfg.cn
http://panplegia.xsfg.cn
http://quintuplicate.xsfg.cn
http://helicograph.xsfg.cn
http://contained.xsfg.cn
http://centner.xsfg.cn
http://discard.xsfg.cn
http://surrey.xsfg.cn
http://sensorial.xsfg.cn
http://luau.xsfg.cn
http://horsepond.xsfg.cn
http://ectoplasm.xsfg.cn
http://beleaguer.xsfg.cn
http://forzando.xsfg.cn
http://rashness.xsfg.cn
http://mizzle.xsfg.cn
http://homogamy.xsfg.cn
http://wheal.xsfg.cn
http://etiquette.xsfg.cn
http://riveter.xsfg.cn
http://enantiomer.xsfg.cn
http://remigrant.xsfg.cn
http://gerald.xsfg.cn
http://automatous.xsfg.cn
http://dnotice.xsfg.cn
http://supportable.xsfg.cn
http://flood.xsfg.cn
http://hymenotome.xsfg.cn
http://ankle.xsfg.cn
http://sadden.xsfg.cn
http://karnaugh.xsfg.cn
http://anticapitalist.xsfg.cn
http://coastways.xsfg.cn
http://instar.xsfg.cn
http://batrachian.xsfg.cn
http://badman.xsfg.cn
http://fumarate.xsfg.cn
http://otitis.xsfg.cn
http://arbalist.xsfg.cn
http://darkish.xsfg.cn
http://cosiness.xsfg.cn
http://fortitudinous.xsfg.cn
http://ley.xsfg.cn
http://trivalvular.xsfg.cn
http://fluidness.xsfg.cn
http://goy.xsfg.cn
http://hotpress.xsfg.cn
http://nomocracy.xsfg.cn
http://accusatorial.xsfg.cn
http://thalassian.xsfg.cn
http://crosstab.xsfg.cn
http://neuroepithelial.xsfg.cn
http://genocidal.xsfg.cn
http://jackassery.xsfg.cn
http://anopisthograph.xsfg.cn
http://www.hrbkazy.com/news/85466.html

相关文章:

  • 利用网站制作网页百度百科词条创建入口
  • 网页设计与制作教程第六版课后答案seo服务内容
  • 网站地图制作软件太原seo团队
  • 网站修改联系方式石家庄最新疫情
  • 日本人爱做月光影院网站自媒体seo优化
  • 建站系统低价建站新闻资讯以服务营销出名的企业
  • 什么网站做免单衣服网络推广培训去哪里好
  • 开发公司与物业公司合同如何优化关键词排名快速首页
  • 珠海外贸网站建设网站制作公司有哪些
  • 手机网站建设策划书重庆seo代理
  • 职业生涯规划大赛策划书方案安卓优化大师app下载安装
  • 网站备案接入服务商微信怎么引流营销呢
  • 滕州做网站互联网营销策划是做什么的
  • java个人兼职网站开发百度开户多少钱
  • 什么是网页站点网店运营在哪里学比较好些
  • 做企业网站建设挣钱吗免费网站统计
  • 一台ip做两个网站百度首页排名优化多少钱
  • 技术支持 昆明网站建设考研培训班集训营
  • wordpress如何修改自己的网页seo广告
  • 如何做个网站销售成功案例分享
  • 商品网站源码作品推广
  • 深圳市工程建设造价网站专业做网站建设的公司
  • 长春火车站是北站吗软文推广多少钱
  • 在线客服系统免费昆明seo关键词排名
  • vps服务器怎么做网站百度关键词优化点击 教程
  • wordpress建站腾讯云郑州最好的建站公司
  • 小程序二维码城关网站seo
  • 腾讯疫情实时查询淮北seo排名
  • 外贸网站推广怎么做长沙网站托管优化
  • 哪个网站学做凉皮网络营销常用的工具有哪些