QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#864371#1086. Bank Security Unificationda17_WA 0ms3840kbC++14441b2025-01-20 15:23:532025-01-20 15:23:54

Judging History

你现在查看的是最新测评结果

  • [2025-01-20 15:23:54]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3840kb
  • [2025-01-20 15:23:53]
  • 提交

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'