记录编号 |
601510 |
评测结果 |
AAAAAAAAAA |
题目名称 |
2980.绝世好题 |
最终得分 |
100 |
用户昵称 |
二乾五 |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.154 s |
提交时间 |
2025-06-25 16:53:29 |
内存使用 |
3.82 MiB |
显示代码纯文本
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define cl(a) memset(a,0,sizeof a)
#define copy(a,b) copy(begin(a),end(a),begin(b))
#define ld long double
#define dot(x) fixed<<setprecision(x)
#define foru(a,b,c) for(ll a=b;a<=c;a++)
ll n,a[100050],ans,dp[33];
int main(){
freopen("bzoj_4300.in","r",stdin);
freopen("bzoj_4300.out","w",stdout);
cin>>n;
for(ll i=1;i<=n;i++){
cin>>a[i];
ll maxx=1;
for(ll j=0;j<=31;j++){
if(a[i]&(1<<j)){
maxx=max(maxx,dp[j]+1);
}
}
for(ll j=0;j<=31;j++){
if(a[i]&(1<<j)){
dp[j]=max(dp[j],maxx);
}
}
ans=max(ans,maxx);
}
cout<<ans<<endl;
return 0;
}