全部评论
def func(n, v, a):
L, R = 0, 0
res = 0
s = 0
while R < n:
if s | a[R] <= v:
s |= a[R]
res = max(res, R - L + 1)
else:
s = 0
newL = R+1
for i in range(R, L, -1):
if s | a[i] > v:
break
else:
s |= a[i]
newL = i
L = newL
R += 1
# print(L,R)
return str(res) 第三题
太难了🤣,坐等大佬
100,9,100,0 第二题很迷,找不到bug
相关推荐

点赞 评论 收藏
分享

点赞 评论 收藏
分享