题解 | 01序列

01序列

https://www.nowcoder.com/practice/b0c948dbe577485598b982a430d65c39

m = int(input())
s = input()
n = int(input())
can = [int(len(x)/2) for x in s.replace(' ','').split('1') if x!='']
print('true' if sum(can)>=n else 'false')

全部评论
是否应该为(len(x)-1)
点赞 回复 分享
发布于 09-22 16:57 上海

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务