QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#470718 | #1086. Bank Security Unification | ccyx505 | WA | 133ms | 19576kb | C++14 | 460b | 2024-07-10 16:02:28 | 2024-07-10 16:02:30 |
Judging History
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: 100
Accepted
time: 1ms
memory: 5964kb
input:
5 1 2 3 1 3
output:
5
result:
ok answer is '5'
Test #2:
score: 0
Accepted
time: 1ms
memory: 5940kb
input:
4 1 2 4 0
output:
0
result:
ok answer is '0'
Test #3:
score: 0
Accepted
time: 1ms
memory: 6004kb
input:
2 1000000000000 1000000000000
output:
1000000000000
result:
ok answer is '1000000000000'
Test #4:
score: 0
Accepted
time: 1ms
memory: 5956kb
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: 0ms
memory: 5880kb
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: 0
Accepted
time: 0ms
memory: 5912kb
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:
2110095119925
result:
ok answer is '2110095119925'
Test #7:
score: 0
Accepted
time: 90ms
memory: 19468kb
input:
1000000 380994485120 380994485121 380994485122 380994485123 380994485124 380994485125 380994485126 380994485127 380994485128 380994485129 380994485130 380994485131 380994485132 380994485133 380994485134 380994485135 380994485136 380994485137 380994485138 380994485139 380994485140 380994485141 380994...
output:
56209236563089050
result:
ok answer is '56209236563089050'
Test #8:
score: 0
Accepted
time: 99ms
memory: 19576kb
input:
999947 694442488933 694442488934 694442488935 694442488936 694442488937 694442488938 694442488939 694442488940 694442488941 694442488942 694442488943 694442488944 694442488945 694442488946 694442488947 694442488948 694442488949 694442488950 694442488951 694442488952 694442488953 694442488954 6944424...
output:
53476040131480818
result:
ok answer is '53476040131480818'
Test #9:
score: 0
Accepted
time: 93ms
memory: 19532kb
input:
999990 622530347171 622530347172 622530347173 622530347174 622530347175 622530347176 622530347177 622530347178 622530347179 622530347180 622530347181 622530347182 622530347183 622530347184 622530347185 622530347186 622530347187 622530347188 622530347189 622530347190 622530347191 622530347192 6225303...
output:
59655875519862620
result:
ok answer is '59655875519862620'
Test #10:
score: 0
Accepted
time: 97ms
memory: 19472kb
input:
999910 116060584011 116060584012 116060584013 116060584014 116060584015 116060584016 116060584017 116060584018 116060584019 116060584020 116060584021 116060584022 116060584023 116060584024 116060584025 116060584026 116060584027 116060584028 116060584029 116060584030 116060584031 116060584032 1160605...
output:
37600735249746864
result:
ok answer is '37600735249746864'
Test #11:
score: 0
Accepted
time: 123ms
memory: 19452kb
input:
999980 973456184999 994679955061 993282175653 986051760436 954528887794 971573107627 996867749843 974175945534 965645059409 948673925746 962475247646 943221827884 987108127588 950169443307 918838723437 973511911195 996442323027 937608082925 997085429522 986532516116 969352518578 945143680447 9986449...
output:
902808284804665118
result:
ok answer is '902808284804665118'
Test #12:
score: 0
Accepted
time: 119ms
memory: 19376kb
input:
999910 981804924069 993068644407 972553472049 997366211901 951558543560 971846343773 813196870765 998061906229 982655806513 930622991527 984343959371 970826388690 995204841006 953323887709 979105600608 923189652758 967575164499 948270918453 976227432556 867116017989 972847233021 981119978185 9396479...
output:
905128344512512150
result:
ok answer is '905128344512512150'
Test #13:
score: -100
Wrong Answer
time: 133ms
memory: 19536kb
input:
999936 25622203424 23487942008 41846404244 4374430937 21910375052 3108899134 20185511495 4455557875 42806661842 56370037380 43364758665 52822782975 34256333894 103004353803 80820299610 10675150544 28850405021 6079651716 3573334559 46743312294 63680217570 30618578145 36920171463 28470905057 904112253...
output:
20164619719817826
result:
wrong answer expected '20164611117398530', found '20164619719817826'