QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#864371 | #1086. Bank Security Unification | da17_ | WA | 0ms | 3840kb | C++14 | 441b | 2025-01-20 15:23:53 | 2025-01-20 15:23:54 |
Judging History
answer
#include <iostream>
#include <vector>
using namespace std;
using ll =long long;
const int N=1e6+5;
int n; ll a[N],f[64],dp[N],ans;
int main(){
// freopen("n2_1.in","r",stdin);
// freopen("n2_1.out","w",stdout);
scanf("%d",&n);
for(int i=1;i<=n;i++){
for(int j=0;j<40;j++)
dp[i]=max(dp[i],dp[f[j]]+(a[f[j]]&a[i]));
for(int j=39;~j;j--)
if(a[i]>>j&1){
f[j]=i; break;
}
}
return printf("%lld",dp[n])&0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3840kb
input:
5 1 2 3 1 3
output:
0
result:
wrong answer expected '5', found '0'