QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#391050 | #4810. Add One | xunxxxx | WA | 524ms | 3728kb | C++20 | 613b | 2024-04-16 12:44:02 | 2024-04-16 12:44:03 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
int n,res,ans,t;
vector<int>b;
void insert(int x)
{
for(auto i:b) x=min(x,x^i);
for(auto &i:b) i=min(i,i^x);
if(x) b.push_back(x);
}
int ck(int x,int l)
{
for(auto i:b) x=min(x,x^(i-(i>>(l+1)<<(l+1))));
if(x==0) return 1;
return 0;
}
signed main()
{
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>t;
ans^=t;
insert(t);
}
res=ans+1;
for(int i=0;i<=60;i++)
{
//01 ^11
//011 ^111
//0111 ^1111
if(ck((1ll<<i)-1,i))
{
res=max(res,ans^((1ll<<(i+1))-1));
}
}
cout<<res<<"\n";
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3572kb
input:
4 1 2 1 2
output:
7
result:
ok 1 number(s): "7"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
5 1 2 3 4 5
output:
14
result:
ok 1 number(s): "14"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
6 1 2 4 7 15 31
output:
47
result:
ok 1 number(s): "47"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
5 41 40 50 11 36
output:
99
result:
ok 1 number(s): "99"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
6 10 40 60 2 44 47
output:
96
result:
ok 1 number(s): "96"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
6 46 25 39 47 23 60
output:
107
result:
ok 1 number(s): "107"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
6 56 90 61 63 56 23
output:
112
result:
ok 1 number(s): "112"
Test #8:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
7 8 83 78 19 36 6 22
output:
205
result:
ok 1 number(s): "205"
Test #9:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
7 23 23 22 78 2 29 88
output:
32
result:
ok 1 number(s): "32"
Test #10:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
7 109 80 14 27 9 45 24
output:
235
result:
ok 1 number(s): "235"
Test #11:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
7 144 152 137 143 145 139 183
output:
220
result:
ok 1 number(s): "220"
Test #12:
score: 0
Accepted
time: 0ms
memory: 3724kb
input:
7 189 270 119 372 240 144 153
output:
78
result:
ok 1 number(s): "78"
Test #13:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
7 4819 2494 1822 4759 2622 4111 2460
output:
7510
result:
ok 1 number(s): "7510"
Test #14:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
8 83 20 17 43 52 78 68 45
output:
145
result:
ok 1 number(s): "145"
Test #15:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
8 289 205 96 274 304 476 230 246
output:
925
result:
ok 1 number(s): "925"
Test #16:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
8 6866 7210 3474 9147 7676 7287 7339 7605
output:
14267
result:
ok 1 number(s): "14267"
Test #17:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
100 9080 7595 3488 1872 5813 1238 8798 2114 2047 6437 1719 5095 9036 2318 3453 8455 9441 7752 388 4695 1433 8253 1558 9068 8432 6751 5897 6993 7763 983 6741 9852 9812 5679 7980 8956 5905 7738 3091 3364 9630 5345 1574 255 5215 6863 9002 7324 6216 6471 2574 6026 5611 7998 1449 2191 4306 525 6534 1692 ...
output:
17374
result:
ok 1 number(s): "17374"
Test #18:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
200 5427 2263 8443 3141 4775 842 1756 8604 3074 4508 9608 3344 9356 6102 710 7484 6543 7718 7441 7920 9928 8282 3941 1347 6908 4386 4269 4723 5797 1447 2381 305 7275 2568 9250 3113 8438 9273 1280 6609 5225 9253 3732 7991 2975 8690 9299 9009 63 2852 4309 2316 2948 9798 3731 790 9770 5527 1775 8388 44...
output:
27971
result:
ok 1 number(s): "27971"
Test #19:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
200 11526 12520 983 17606 861 12619 10319 11496 18084 8341 10236 7895 19999 5599 416 12109 16336 9173 15715 1418 8492 13373 8142 6881 13158 16435 9429 593 15751 8793 1476 19166 6627 10965 7368 1295 15449 8063 14489 9651 13570 944 11544 10602 10342 6543 6385 1108 19358 4365 4990 18004 11530 4237 1253...
output:
45265
result:
ok 1 number(s): "45265"
Test #20:
score: 0
Accepted
time: 1ms
memory: 3708kb
input:
500 4445 583 3305 855 5165 3564 1977 1573 903 3999 3272 8905 8160 4359 5982 8912 7850 5050 6441 5436 4598 3644 685 2529 4467 2012 1541 8348 4624 1495 4558 5195 3169 6737 5622 3837 4693 7760 1530 8909 6326 7449 612 6472 2347 9855 8008 4469 9859 5498 6014 2939 4554 3016 1947 1863 8316 532 1407 6723 78...
output:
28641
result:
ok 1 number(s): "28641"
Test #21:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
500 1661 12688 355 1454 9870 13986 4189 5369 7983 10827 10213 10113 17158 700 1226 2428 2974 7119 11534 8559 7798 3004 19051 16749 95 13485 7097 2421 7105 9719 8741 7554 684 9179 13579 17207 3845 1575 5918 9955 14241 15879 16925 8748 13847 6872 7546 10956 17584 11939 10438 17481 18105 6203 12057 527...
output:
56453
result:
ok 1 number(s): "56453"
Test #22:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
500 29952 7185 11740 19601 20588 28851 26372 18354 28858 10524 11297 1355 21526 22865 5405 14315 270 6167 22276 21386 14797 19800 12528 2687 9931 4142 11217 9345 25152 8322 7151 29748 29999 16449 18987 12412 24097 27398 3492 25222 12725 593 19682 3523 19984 12618 8215 977 20339 16993 8123 14039 4389...
output:
34673
result:
ok 1 number(s): "34673"
Test #23:
score: 0
Accepted
time: 1ms
memory: 3560kb
input:
1000 6878 9388 5539 9330 1321 5637 6801 9707 549 8458 4985 5073 5585 7617 53 2051 6298 1307 7096 1797 4152 6514 9894 710 4623 5610 7432 5861 4882 898 2886 967 1921 9934 8181 6986 7696 893 5483 8623 1166 3391 9760 443 5539 9729 9886 5174 4608 8823 9504 9059 2618 924 6559 7806 1413 1958 9432 908 9484 ...
output:
23640
result:
ok 1 number(s): "23640"
Test #24:
score: 0
Accepted
time: 0ms
memory: 3700kb
input:
1000 1841 2537 5882 16739 15299 12706 65 12364 14174 18767 11672 3116 12582 7584 5498 9806 70 9855 738 17027 12840 10343 2208 14647 18021 6379 12184 6647 17976 12215 6447 8279 1701 5870 15780 6479 3195 1165 7338 7879 13609 5035 18593 3029 15933 13654 18639 18887 4722 15026 17282 13833 10869 16503 28...
output:
38186
result:
ok 1 number(s): "38186"
Test #25:
score: 0
Accepted
time: 1ms
memory: 3692kb
input:
1000 24478 26881 36979 16229 23705 13295 4494 7434 31698 27401 39676 13484 21250 30204 31220 25448 39653 30287 23238 31463 29096 7341 38577 25912 15171 22175 30609 36996 24646 22322 32899 21804 38419 35415 24331 35045 5996 31671 32285 37555 19838 20380 1510 1742 18089 1652 15842 15282 23039 25261 37...
output:
120138
result:
ok 1 number(s): "120138"
Test #26:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
2000 1 0 0 0 1 1 1 1 1 0 0 0 1 0 1 1 1 1 1 1 0 0 1 1 0 0 1 1 1 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 1 1 0 1 1 1 1 1 1 1 0 1 1 1 0 0 1 1 1 0 1 1 1 1 1 0 1 1 0 1 1 1 1 0 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1 1 1 0 0 0 1 1 0 1 1 0 1 1 0 1 1 1 0 1 0 0 0 1 0 0 1 0 1 1 1 0 0 0 0 0 1 0 1 0 0 1 0 1 0 1 0 1 1 0 0 0 0 0 0...
output:
2
result:
ok 1 number(s): "2"
Test #27:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
2000 9335 8938 9465 1282 4326 2363 290 9711 446 7258 9783 8421 172 7241 1736 211 1622 2138 9260 8686 3616 669 1588 4763 1746 4735 4091 1926 3895 7134 442 8185 3356 4135 1970 7322 8713 2544 33 1356 1623 9852 604 3639 6767 7278 2518 1877 9942 3709 8241 4124 7358 5395 951 7447 5246 9616 378 3366 2585 1...
output:
32570
result:
ok 1 number(s): "32570"
Test #28:
score: 0
Accepted
time: 1ms
memory: 3692kb
input:
2000 3654 10024 7054 19973 7369 11154 3337 3790 7189 10098 7716 22747 15661 5684 2899 37191 32809 30246 18335 12171 10202 10487 9259 5872 26880 18142 25853 3814 29934 39639 2622 24871 26293 25652 27398 9172 6082 6338 32909 5105 36824 4885 15034 5532 8672 3053 33858 35339 33823 15064 14154 3852 6849 ...
output:
79016
result:
ok 1 number(s): "79016"
Test #29:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
3000 2199 237 5140 3235 5581 3405 1621 1466 8186 6465 8514 1361 4760 773 5576 2281 3037 4719 1424 1665 3080 4418 1126 7065 2804 3860 8592 8399 3315 5527 5842 7154 4792 2652 3601 8066 135 4603 2426 4091 3830 4560 3201 6835 8402 894 9060 6422 2711 9002 5227 1347 9939 9866 7502 7495 828 1180 3483 5824 ...
output:
26556
result:
ok 1 number(s): "26556"
Test #30:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
5000 7114 7180 2990 7141 3749 9017 4285 2819 4072 6631 2042 3741 7845 3931 8940 4670 7620 8132 4001 1940 6324 1916 2358 3419 3142 8203 7186 3095 3499 156 549 3339 5099 3213 3337 8739 6892 8313 7619 1717 6495 3978 8394 8911 3015 2060 2141 7264 2971 7023 8386 3637 9418 964 5880 6778 2401 808 5377 8988...
output:
18004
result:
ok 1 number(s): "18004"
Test #31:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
5000 1110 32658 19743 18676 38020 15940 44942 47521 33916 42962 23873 11211 14880 47046 10202 3359 43610 22064 1756 22609 25858 11836 43502 28895 8597 3292 40418 1655 35687 37757 4859 5935 13415 6029 23112 7965 10528 35373 7229 35235 5856 10388 35031 35708 45755 26348 48731 5606 6006 8650 45836 3465...
output:
126707
result:
ok 1 number(s): "126707"
Test #32:
score: 0
Accepted
time: 1ms
memory: 3692kb
input:
1 9400310136562468
output:
9400310136562469
result:
ok 1 number(s): "9400310136562469"
Test #33:
score: 0
Accepted
time: 3ms
memory: 3636kb
input:
5000 648238023012596207 370136752560158415 141289484301231915 967416725879128127 682944711997541723 881409381649718187 596767667034540603 187711949139825082 794548329014653320 816203003552420295 777887355198713046 785273852573392093 82434224607682129 610396147115157066 600413875118923876 57593566654...
output:
2179193492002976827
result:
ok 1 number(s): "2179193492002976827"
Test #34:
score: 0
Accepted
time: 26ms
memory: 3688kb
input:
50000 733015038574587524 1135473138217917642 913320130828624421 417466760583856876 948624703983302030 779631661808403658 506782566168526338 1086648135158851115 505469713413097249 66396357983678566 833024829910569374 29636492765671993 963140766760470836 146055732599449817 677440216902952410 242365858...
output:
1414730947150848076
result:
ok 1 number(s): "1414730947150848076"
Test #35:
score: 0
Accepted
time: 245ms
memory: 3696kb
input:
500000 300041101517437493 835922108011462063 412450655049194287 757239792954993284 1137775886500171704 38083112500481312 1142234772170786652 548436081000934774 185908124150136886 299051338312359480 757109310886227569 1037310114130131289 440444189406484514 187395786616198961 87375709122178132 5243416...
output:
1357354823808922771
result:
ok 1 number(s): "1357354823808922771"
Test #36:
score: 0
Accepted
time: 171ms
memory: 3572kb
input:
1000000 20159 28788 54900 63466 5364 57340 20296 20882 53682 43151 41473 57412 33574 54053 7687 16830 25490 54503 31765 36662 55245 25012 13500 55252 44479 3744 9951 27445 43751 50289 36405 62442 27349 545 18891 25079 36271 61279 29311 42324 14000 16141 16774 14447 55973 57795 18150 31400 24174 3489...
output:
84216
result:
ok 1 number(s): "84216"
Test #37:
score: 0
Accepted
time: 177ms
memory: 3692kb
input:
1000000 800 59297 3518 38671 46074 6197 7447 45574 30141 46917 48088 3843 58560 16742 49562 3243 17917 50797 5335 3366 30610 36342 9074 58019 28992 52193 60204 19410 21743 25807 37424 32872 3880 49833 36744 52639 34713 47386 25509 17075 24981 31248 57563 28006 19601 39487 994 9852 58536 9629 23638 2...
output:
118438
result:
ok 1 number(s): "118438"
Test #38:
score: 0
Accepted
time: 176ms
memory: 3652kb
input:
1000000 46976 24269 17671 13877 21247 20590 60134 4730 6600 50684 54704 15811 18010 44967 25901 55192 10343 47091 44442 35607 5974 47672 4647 60786 13505 35105 44921 11375 65271 1325 38442 3303 45947 33586 54596 14663 33155 33493 21706 57362 35962 46354 32816 41564 48766 21178 49373 53840 27362 4990...
output:
104724
result:
ok 1 number(s): "104724"
Test #39:
score: 0
Accepted
time: 493ms
memory: 3724kb
input:
1000000 127862657515702763 1143159964778854512 86251817708536791 603583517598423671 141252797803003050 219083704440135745 161682846116419341 228322476367960905 204057180648786100 829694748451411685 617244179435693503 525752875361687354 421053351977694098 162538877211113636 103071817265841780 4166905...
output:
1979551606831537605
result:
ok 1 number(s): "1979551606831537605"
Test #40:
score: 0
Accepted
time: 499ms
memory: 3700kb
input:
1000000 128688900693786187 732310429254217628 590794048186809121 305852710115391900 185427000602893232 930216884770920570 590425536025650396 643154188006112189 729675055476567231 855332367732519100 906665383410947199 318638532906334420 575586400429908435 676950917612543031 739032284736442721 4454380...
output:
1906290839892590156
result:
ok 1 number(s): "1906290839892590156"
Test #41:
score: 0
Accepted
time: 497ms
memory: 3636kb
input:
1000000 129515139576902315 321460889434613448 1095336282960048747 8121906927327426 488428560494858418 1019168225934881451 1057985895349296177 102371425697501386 880969982718659220 111524186156014190 730119448882122773 38441453407125450 222071243305229390 1087366122355301768 655624974957309811 101794...
output:
1293568684772671658
result:
ok 1 number(s): "1293568684772671658"
Test #42:
score: 0
Accepted
time: 517ms
memory: 3632kb
input:
1000000 130341382754985739 446957008831474100 863312604051142632 273775401907706299 46640236218796267 294989411237265531 319896093790665893 627989291935347926 2581029999776690 906607601999766635 332586286754607614 884652501629304406 858031710775830331 576372651211161587 364161680389202170 1656533853...
output:
1656347167339716613
result:
ok 1 number(s): "1656347167339716613"
Test #43:
score: 0
Accepted
time: 496ms
memory: 3640kb
input:
1000000 131167625933069163 652683314402252065 565581800863078157 317949604707596481 757773420844548388 723732101146496586 734727805428817177 685662156282081 41015161987113576 932245221280874051 622007495024828606 850217005852155299 1039185550081518743 1067265534209984241 341070673639584297 653791800...
output:
2202297818792764538
result:
ok 1 number(s): "2202297818792764538"
Test #44:
score: 0
Accepted
time: 492ms
memory: 3692kb
input:
1000000 131993869111152587 241833774582647885 303119973771106376 267850997675013683 362123811802453958 315985096568486237 1152474791055727641 1149559508477033869 526303536984063213 79449298269417758 957882836267014171 911428699000082301 643102659101835069 40797098221853400 428756070004566660 7073072...
output:
1956839755043666325
result:
ok 1 number(s): "1956839755043666325"
Test #45:
score: 0
Accepted
time: 498ms
memory: 3572kb
input:
1000000 132820107994268715 983905743664857978 807662208544346001 1123041699093796184 406298014602344140 1027118276899271062 428295976358111720 411469715508338177 1051921407516877048 117883438846689237 47928402663456317 435988320941449431 195330146674067738 943168110405996055 460070103973939203 19631...
output:
1524977190890740601
result:
ok 1 number(s): "1524977190890740601"
Test #46:
score: 0
Accepted
time: 524ms
memory: 3568kb
input:
1000000 133646355467319435 573056203845253798 159282934415771355 825310891610764414 450472217402234321 585329956918176206 857038661972375480 826301418556554869 424617777737811204 156317570834026123 1009158074829229002 337349602343742717 228873978486096497 349863199421249371 304658650495545770 109603...
output:
2267933721174701054
result:
ok 1 number(s): "2267933721174701054"
Test #47:
score: 0
Accepted
time: 487ms
memory: 3636kb
input:
1000000 134472594350435563 162206664025649619 663825169189010981 527580088422699940 494646420202124503 143541632642114055 132859851569726855 88211621292891881 950235652565592335 194751707116330305 1034795694110336417 626770810613963708 21759631735776268 504396243578496412 819070686602007869 57906953...
output:
1628093390603829895
result:
ok 1 number(s): "1628093390603829895"
Test #48:
score: 0
Accepted
time: 492ms
memory: 3696kb
input:
1000000 1135114209102472489 709330207586458658 441021162082182143 93681743357367266 511704926290256848 1074882257303777159 109334144977468820 681101583877432679 1017995219851862140 998776445982492116 513818821076096912 538997723890207964 476423784004208511 412297394668110600 17906512503299998 307007...
output:
1258517757272418466
result:
ok 1 number(s): "1258517757272418466"
Test #49:
score: 0
Accepted
time: 497ms
memory: 3616kb
input:
1000000 724264669282868309 60950933457884011 143290358894117669 137855946157257448 69916602014194697 350703438311193942 524165856615620104 53797949803399538 1056429360429133619 1061950255211782921 306704478620743978 693530772342422301 990835824405637906 1048257862138711541 659834541671039496 1554453...
output:
1677023449362423051
result:
ok 1 number(s): "1677023449362423051"
Test #50:
score: 0
Accepted
time: 494ms
memory: 3584kb
input:
1000000 313415129463264129 565493168231123637 998481060312900170 182030148957147629 779446132515392294 938997559663836796 579415824631180670 1094863496711437801 1050051680249739651 198449958875156937 99590136165391044 848063820794636638 352326360200220325 148841070526899315 877002745285732795 657552...
output:
1974625365364949519
result:
ok 1 number(s): "1974625365364949519"
Test #51:
score: 0
Accepted
time: 503ms
memory: 3636kb
input:
1000000 700750257124835696 226204351757037811 339261462363884666 55267313522809077 200907766695141104 1105033699458961801 1133297628698774687 1075689303825814363 487871162850410632 1045397298316885087 1002596873541818271 866738400601649720 14335783571252176 790769099694638813 585539450717625154 9581...
output:
1967122696642429031
result:
ok 1 number(s): "1967122696642429031"
Test #52:
score: 0
Accepted
time: 499ms
memory: 3580kb
input:
1000000 644637558725870042 421656128875788616 403019453936771222 270378554556927992 1050394642694669491 484010003432040132 615739469743357796 477730065384928661 18810260374231893 1101326918811954482 777292366825664328 838282951566564857 4208417387185632 228228936396232139 650296251041853117 29407616...
output:
1569986464600524886
result:
ok 1 number(s): "1569986464600524886"
Test #53:
score: 0
Accepted
time: 493ms
memory: 3712kb
input:
1000000 233788018906265862 926198359354060946 105288646453739451 314552761651785470 1030571177086541784 1003347940212709792 57244400951503372 1126964538093061898 1066713570800918024 158741470134367266 742640981092628830 133335213905607082 921703662013205426 2612865876377166 406515545118799102 377341...
output:
1660488165114429487
result:
ok 1 number(s): "1660488165114429487"
Test #54:
score: 0
Accepted
time: 91ms
memory: 3620kb
input:
1000000 1 1 0 1 1 1 0 0 0 1 1 1 0 1 0 0 0 0 1 0 1 0 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 0 0 1 1 1 1 0 0 1 0 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 1 1 0 0 0 1 0 0 1 0 1 0 0 1 0 0 0 1 1 0 1 1 1 0 1 1 1 0 1 0 0 1 1 0 0 1 0 0 1 0 1 1 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 0 0 1 1 1 0 ...
output:
3
result:
ok 1 number(s): "3"
Test #55:
score: 0
Accepted
time: 269ms
memory: 3728kb
input:
1000000 0 0 1018904604914721074 0 0 0 1018904604914721074 0 0 0 1018904604914721074 1018904604914721074 0 0 0 1018904604914721074 1018904604914721074 1018904604914721074 1018904604914721074 1018904604914721074 1018904604914721074 1018904604914721074 0 0 0 0 0 0 1018904604914721074 0 0 10189046049147...
output:
1018904604914721075
result:
ok 1 number(s): "1018904604914721075"
Test #56:
score: -100
Wrong Answer
time: 343ms
memory: 3636kb
input:
1000000 539843968995129481 539843968995129481 539843968995129481 1019730843797837202 0 539843968995129481 539843968995129481 674175409121864987 674175409121864987 674175409121864987 539843968995129481 1019730843797837202 539843968995129481 1019730843797837202 674175409121864987 0 1019730843797837202...
output:
3
result:
wrong answer 1st numbers differ - expected: '7', found: '3'