QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#627532#1086. Bank Security UnificationUZINGWA 1ms5868kbC++14388b2024-10-10 16:14:332024-10-10 16:14:34

Judging History

This is the latest submission verdict.

  • [2024-10-10 16:14:34]
  • Judged
  • Verdict: WA
  • Time: 1ms
  • Memory: 5868kb
  • [2024-10-10 16:14:33]
  • Submitted

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e6+10;
int n,ans;
int a[N],dp[N];
signed main()
{
//	freopen("ex_seq4.in","r",stdin);
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		scanf("%lld",&a[i]);
		for(int j=max(0ll,i-60);j<i;j++)
			dp[i]=max(dp[i],dp[j]+(a[j]&a[i]));
//		cout<<id<<' ';
		ans=max(ans,dp[i]);
	}
	cout<<ans;
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 5868kb

input:

5
1 2 3 1 3

output:

5

result:

ok answer is '5'

Test #2:

score: 0
Accepted
time: 1ms
memory: 5764kb

input:

4
1 2 4 0

output:

0

result:

ok answer is '0'

Test #3:

score: 0
Accepted
time: 0ms
memory: 5620kb

input:

2
1000000000000 1000000000000

output:

1000000000000

result:

ok answer is '1000000000000'

Test #4:

score: 0
Accepted
time: 1ms
memory: 5804kb

input:

100
42357619991 34637578715 14383875856 65298594968 204835436802 17842451301 27263566591 56672847581 9938910048 37783918480 178688553850 31652616803 34569713543 278151742734 458183081930 36307485267 52046737444 29733829337 156411959819 70476873663 322768771475 306850928242 68922415915 108092954267 1...

output:

4105724254392

result:

ok answer is '4105724254392'

Test #5:

score: 0
Accepted
time: 1ms
memory: 5804kb

input:

200
32491481529 22326116709 38413035282 6379551923 17186666096 710945826 99671547638 21583864468 43358433566 110817310097 58936170734 12118139703 99298292577 7807334015 283126465825 29798702686 966557737 78175604253 84922374374 66149759365 4499380469 17953982120 22738453560 35389367375 71164988711 1...

output:

4385401630265

result:

ok answer is '4385401630265'

Test #6:

score: -100
Wrong Answer
time: 1ms
memory: 5812kb

input:

300
0 0 0 7227130 0 44665356632 741540074 3252 1053109 0 0 3343976697 299282315 7 57190829 0 4379965174 17883634737 17400873810 3693 134 144164936555 320312270 0 0 423566 549 0 1979 0 0 0 2462345997 1021629061 483112 0 172597 11 0 0 0 0 3189174969 64832 14166776345 69159 0 0 56330326146 0 1206275174...

output:

2097978562711

result:

wrong answer expected '2110095119925', found '2097978562711'