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)第三题