#D. 绝世好题

    Type: RemoteJudge 1000ms 512MiB

绝世好题

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

给定一个长度为 nn 的数列 aia_i,求 aia_i 的子序列 bib_i 的最长长度 kk,满足 bi&bi10b_i \& b_{i-1} \ne 0 ,其中 2ik2\leq i\leq k&\& 表示位运算取与。

输入格式

输入文件共 2 行。 第一行包括一个整数 nn。 第二行包括 nn 个整数,第 ii 个整数表示 aia_i

输出格式

输出文件共一行。 包括一个整数,表示子序列 bib_i 的最长长度。

3
1 2 3
2

提示

对于100%的数据,1n1000001\leq n\leq 100000ai109a_i\leq 10^9

9月8日居家练习

Not Attended
Status
Done
Rule
IOI
Problem
4
Start at
2023-9-8 9:00
End at
2023-9-8 13:00
Duration
4 hour(s)
Host
Partic.
17