ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#189991 | #3375. DP 入门 | struct_coding | 100 | 110ms | 2032kb | C++ | 318b | 2023-10-05 08:39:52 | 2023-10-05 12:01:02 |
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
int k[114514],sum;
signed main() {
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
int n;
cin>>n;
for(int i=0;i<n;i++){
cin>>k[i];
}
sum=k[0];
for(int i=1;i<n;i++){
sum=max(sum^k[i],sum+k[i]);
}
cout<<sum;
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 5
Accepted
time: 0ms
memory: 1244kb
input:
20 349331691 520924316 243035392 795360708 592909017 954007338 542091237 678603876 231959624 1022255...
output:
10591642877
result:
ok 1 number(s): "10591642877"
Test #2:
score: 5
Accepted
time: 0ms
memory: 1244kb
input:
20 305238172 537161394 470195729 218117617 740049465 577964027 469118896 635265478 235198271 5531610...
output:
10205086477
result:
ok 1 number(s): "10205086477"
Test #3:
score: 5
Accepted
time: 0ms
memory: 1248kb
input:
20 25861946 1044865487 167575428 560378749 369071408 68075500 452822812 51800302 88871544 967881151 ...
output:
10023773260
result:
ok 1 number(s): "10023773260"
Test #4:
score: 5
Accepted
time: 0ms
memory: 1248kb
input:
20 575613139 891335730 177429749 695415506 523452665 401399092 1046663645 742822333 304414425 616501...
output:
10359277047
result:
ok 1 number(s): "10359277047"
Test #5:
score: 5
Accepted
time: 0ms
memory: 1244kb
input:
20 43143966 5039675 36390839 457031770 836480922 762774690 1068800551 109308674 781279232 923068414 ...
output:
9965272453
result:
ok 1 number(s): "9965272453"
Test #6:
score: 5
Accepted
time: 0ms
memory: 1248kb
input:
20 63504936 371181452 699600408 376018821 31749986 771687842 492508317 52555908 274830696 469300615 ...
output:
10672864916
result:
ok 1 number(s): "10672864916"
Test #7:
score: 5
Accepted
time: 5ms
memory: 2028kb
input:
100000 2 30 30 21 30 23 11 26 23 7 4 9 9 18 23 16 30 25 17 26 15 26 9 27 19 14 5 0 11 4 11 30 30 4 2...
output:
1549278
result:
ok 1 number(s): "1549278"
Test #8:
score: 5
Accepted
time: 7ms
memory: 2032kb
input:
100000 3 11 6 5 20 14 31 23 13 30 3 10 17 8 29 30 29 1 24 20 25 6 9 20 9 8 1 16 1 27 26 9 27 15 1 1 ...
output:
1546715
result:
ok 1 number(s): "1546715"
Test #9:
score: 5
Accepted
time: 6ms
memory: 2028kb
input:
100000 1 31 10 20 25 1 23 11 13 13 19 15 12 29 24 9 22 22 1 23 9 26 13 10 8 13 15 7 27 17 27 31 7 17...
output:
1552029
result:
ok 1 number(s): "1552029"
Test #10:
score: 5
Accepted
time: 6ms
memory: 2032kb
input:
100000 12 7 31 20 8 0 23 15 19 1 17 25 15 22 31 19 20 5 4 9 2 11 10 0 28 23 27 12 6 14 2 7 5 15 4 13...
output:
1549895
result:
ok 1 number(s): "1549895"
Test #11:
score: 5
Accepted
time: 5ms
memory: 2032kb
input:
100000 24 30 0 23 12 5 3 13 30 3 5 7 7 25 24 23 20 8 16 2 7 18 27 22 6 16 28 7 26 25 7 10 9 8 5 25 1...
output:
1547798
result:
ok 1 number(s): "1547798"
Test #12:
score: 5
Accepted
time: 7ms
memory: 2028kb
input:
100000 23 28 18 6 6 15 27 8 7 22 12 25 25 20 7 14 10 8 3 20 16 10 22 20 25 14 12 24 0 31 9 6 4 12 9 ...
output:
1551758
result:
ok 1 number(s): "1551758"
Test #13:
score: 5
Accepted
time: 10ms
memory: 2032kb
input:
100000 379744998 839206129 192873647 29790231 1043085987 335332854 893762569 305529622 332378896 540...
output:
53825887628990
result:
ok 1 number(s): "53825887628990"
Test #14:
score: 5
Accepted
time: 10ms
memory: 2032kb
input:
100000 405801841 967079238 477364905 636510157 616696440 672638935 769016329 72150088 708818933 4495...
output:
53589737955373
result:
ok 1 number(s): "53589737955373"
Test #15:
score: 5
Accepted
time: 7ms
memory: 2028kb
input:
100000 699043621 860705189 862561821 399437949 207732205 775657945 180373296 514250019 199585130 717...
output:
53782543554473
result:
ok 1 number(s): "53782543554473"
Test #16:
score: 5
Accepted
time: 6ms
memory: 2028kb
input:
100000 464007545 430130356 248044922 939881204 876889506 469941672 888230113 1049308825 627600081 54...
output:
53625336123071
result:
ok 1 number(s): "53625336123071"
Test #17:
score: 5
Accepted
time: 10ms
memory: 2028kb
input:
100000 312011558 342644583 833396463 955807820 623986584 145542337 820802968 33181112 200461299 1018...
output:
53685831695337
result:
ok 1 number(s): "53685831695337"
Test #18:
score: 5
Accepted
time: 10ms
memory: 2032kb
input:
100000 953054546 105966220 866733649 683779144 981724538 667130422 667915906 557476758 925363680 174...
output:
53749547302036
result:
ok 1 number(s): "53749547302036"
Test #19:
score: 5
Accepted
time: 11ms
memory: 2032kb
input:
100000 536981785 263275272 351751868 791665196 499905011 9598314 996263943 570229022 543561007 64098...
output:
53808213878993
result:
ok 1 number(s): "53808213878993"
Test #20:
score: 5
Accepted
time: 10ms
memory: 2032kb
input:
100000 973236853 310148672 622168692 545583126 236002545 230420922 314195519 495332803 920177709 564...
output:
53622879704233
result:
ok 1 number(s): "53622879704233"
Extra Test:
score: 0
Extra Test Passed