QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#470709#1086. Bank Security Unificationccyx505WA 1ms5992kbC++14458b2024-07-10 16:00:282024-07-10 16:00:28

Judging History

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

  • [2024-07-10 16:00:28]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:5992kb
  • [2024-07-10 16:00:28]
  • 提交

answer

#include <iostream>
using namespace std;
const int N = 1e6 + 100;
long long a[N], n, lst[60], f[N];
int main() {
	scanf ("%lld", &n);
	for (int i = 1; i <= n; i++) scanf ("%lld", a + i);
	for (int i = 1; i <= n; i++) {
		f[i] = f[i - 1] + a[i - 1] & a[i];
		for (int j = 0; j < 60; j++) f[i] = max(f[i], f[lst[j]] + a[lst[j]] & a[i]);
		long long t = a[i], s = 0;
		while (t) t >>= 1, s++;
		lst[s] = i;
	}
	printf("%lld", f[n]);
	return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 5992kb

input:

5
1 2 3 1 3

output:

2

result:

wrong answer expected '5', found '2'