QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#933513#10177. Bitvzhuhship2077AC ✓315ms13004kbC++23602b2025-03-13 19:41:572025-03-13 19:41:58

Judging History

This is the latest submission verdict.

  • [2025-03-13 19:41:58]
  • Judged
  • Verdict: AC
  • Time: 315ms
  • Memory: 13004kb
  • [2025-03-13 19:41:57]
  • Submitted

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
constexpr int M=1e6+5;
int n,k,cnt,a[M],p[M];
int read(){
    int x=0;char ch=getchar();
    while (!isdigit(ch)) ch=getchar();
    while (isdigit(ch)) x=x*10+ch-48,ch=getchar();
    return x;
}
void insert(int x){
    for (int i=k-1;~i;i--)
        if (x>>i&1){
            if (!p[i]) {p[i]=x;cnt++;break;}
            x^=p[i];
        }
}
signed main(){
    n=read();k=read();
    for (int i=1;i<=n;i++) a[i]=read();
    for (int i=2;i<=n;i++) insert(a[i]^a[i-1]);
    puts(cnt==k?"Yes":"No");
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 5708kb

input:

4 3
1 2 3 4

output:

Yes

result:

ok answer is YES

Test #2:

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

input:

4 3
1 2 4 7

output:

No

result:

ok answer is NO

Test #3:

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

input:

5 3
4 5 1 6 2

output:

Yes

result:

ok answer is YES

Test #4:

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

input:

6 3
1 6 3 7 4 2

output:

Yes

result:

ok answer is YES

Test #5:

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

input:

7 3
5 2 7 3 1 6 4

output:

Yes

result:

ok answer is YES

Test #6:

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

input:

3 2
3 1 2

output:

Yes

result:

ok answer is YES

Test #7:

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

input:

10 4
1 10 8 13 11 6 15 9 12 2

output:

Yes

result:

ok answer is YES

Test #8:

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

input:

4 3
4 1 6 2

output:

Yes

result:

ok answer is YES

Test #9:

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

input:

9 5
4 8 27 24 17 1 2 29 16

output:

Yes

result:

ok answer is YES

Test #10:

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

input:

5 5
8 4 16 1 2

output:

No

result:

ok answer is NO

Test #11:

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

input:

10 5
29 22 1 2 4 16 26 23 24 8

output:

Yes

result:

ok answer is YES

Test #12:

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

input:

6 5
1 4 2 16 8 31

output:

No

result:

ok answer is NO

Test #13:

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

input:

6 5
19 4 26 2 1 12

output:

Yes

result:

ok answer is YES

Test #14:

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

input:

6 5
27 3 6 8 22 1

output:

Yes

result:

ok answer is YES

Test #15:

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

input:

4 3
7 2 6 1

output:

Yes

result:

ok answer is YES

Test #16:

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

input:

10 5
12 25 1 28 19 16 5 2 21 24

output:

Yes

result:

ok answer is YES

Test #17:

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

input:

5 5
4 1 2 31 13

output:

No

result:

ok answer is NO

Test #18:

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

input:

10 5
4 16 7 31 28 26 19 8 2 1

output:

No

result:

ok answer is NO

Test #19:

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

input:

10 5
8 25 4 19 2 16 14 1 7 21

output:

No

result:

ok answer is NO

Test #20:

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

input:

6 5
16 8 1 22 4 2

output:

No

result:

ok answer is NO

Test #21:

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

input:

6 5
1 21 3 4 27 13

output:

No

result:

ok answer is NO

Test #22:

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

input:

10 5
30 14 2 27 4 11 1 18 23 13

output:

No

result:

ok answer is NO

Test #23:

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

input:

10 5
8 6 23 3 21 4 10 13 1 30

output:

No

result:

ok answer is NO

Test #24:

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

input:

1000 10
355 154 117 911 107 133 76 648 797 543 964 518 61 827 421 938 60 955 167 554 919 734 688 937 637 70 77 799 267 143 504 569 1014 66 635 20 783 63 651 382 263 947 561 374 1020 928 773 528 434 386 366 384 443 1013 893 634 376 507 296 121 352 19 521 546 348 11 854 841 445 490 909 547 186 158 331...

output:

Yes

result:

ok answer is YES

Test #25:

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

input:

1000 15
59 218 219 269 279 318 324 353 362 369 409 494 501 511 532 600 645 662 671 684 685 686 705 756 781 791 815 876 891 897 925 973 999 1041 1047 1056 1110 1114 1123 1202 1212 1220 1223 1260 1298 1328 1361 1431 1472 1526 1542 1567 1594 1595 1607 1616 1635 1694 1703 1739 1747 1852 1862 1919 1924 1...

output:

Yes

result:

ok answer is YES

Test #26:

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

input:

1000 62
369334420834047 11230224525210758 11308291431395278 11323414761854247 12229351973944135 14689826775901116 15091977066735235 16853835159416489 22075468455081157 28328566974431304 28938970010878036 29321495866877608 29906950448413839 35338850165454241 43934065775041695 49665011007700187 517871...

output:

Yes

result:

ok answer is YES

Test #27:

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

input:

496 10
767 389 418 1005 631 829 725 667 216 97 951 952 964 1000 161 518 738 620 560 993 157 616 721 299 471 265 244 153 819 517 834 950 802 36 622 777 648 875 100 439 706 346 547 752 248 954 174 746 278 74 205 210 209 824 568 574 1004 623 192 96 549 694 453 185 976 967 67 435 55 903 791 255 809 135 ...

output:

Yes

result:

ok answer is YES

Test #28:

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

input:

998 11
333 375 1637 1974 624 1973 1039 1406 117 1813 1546 1210 1028 1154 1453 934 2019 1729 1403 1621 714 157 1385 1379 1677 1401 1627 125 126 1519 960 790 1264 222 416 1573 29 1891 1883 1135 1738 1866 1545 677 1538 149 910 198 237 1902 1745 984 1252 393 1608 1623 820 1904 230 1353 956 1173 1303 223...

output:

Yes

result:

ok answer is YES

Test #29:

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

input:

1000 12
1905 3830 522 3633 3933 3752 1079 2673 106 1024 3777 3209 3669 1648 422 2600 670 1304 3020 4071 900 1128 720 2013 4072 2282 480 3163 3121 307 3253 701 1913 1748 1744 2406 3386 2184 2372 1839 2738 3122 2644 3204 110 1652 773 4002 2495 1812 777 3519 2995 477 290 1930 4059 451 1907 3961 475 384...

output:

Yes

result:

ok answer is YES

Test #30:

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

input:

1000 31
1228300350 1548041070 914889848 505699620 1536236980 628499368 513295762 1257242147 1436096717 1212065871 1117104309 2055652201 943302078 725506584 1135518960 1176743037 548888537 612182712 2051670394 486064454 1550956788 177857137 1251366374 413473605 1781068984 1666816001 1711343844 207923...

output:

Yes

result:

ok answer is YES

Test #31:

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

input:

1000 31
1192911741 1068356003 1037723452 1497687243 1643787064 342435565 1873295381 1168763439 988450811 269399583 1289015871 1431017079 551003161 907536037 939630228 1691814823 1142011442 390097870 497201103 1944384921 1661304299 1495738859 2136384570 430067276 1073741824 1139819632 825991971 12661...

output:

Yes

result:

ok answer is YES

Test #32:

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

input:

1000 62
4195274789426969609 848348708790570244 751510080109708790 962092040378422029 2960039696849365264 2291818455095261328 33554432 3635279760405302368 3351803589297332359 1676067612187881223 2267612485250058025 524165584492282061 3814697265060700775 1231676802418717503 1436798691683301531 4271406...

output:

Yes

result:

ok answer is YES

Test #33:

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

input:

1000 62
1198624314561626442 1720074914499080705 2415260129209613253 2300000546730586912 2454304707069636780 4043670493427477818 2066732052905919217 1531184853335240210 3395075619150526249 3779036667599267167 2855798932722917163 1800252268053984227 3771155732786017080 4038765506883502727 353381058805...

output:

Yes

result:

ok answer is YES

Test #34:

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

input:

500 10
137 892 865 316 692 355 468 173 50 103 880 799 279 301 878 789 944 131 572 28 740 161 302 727 206 8 535 419 541 806 684 484 412 713 1012 1004 395 524 997 930 656 14 41 767 276 454 451 991 1009 954 820 979 625 372 227 584 266 482 81 542 364 465 362 104 620 569 133 911 375 203 518 608 1001 815 ...

output:

No

result:

ok answer is NO

Test #35:

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

input:

1000 11
961 1421 1603 1050 966 1493 646 991 1792 1907 1548 1038 269 1270 2022 1630 356 906 102 1134 73 1913 458 1664 1433 290 522 1183 1604 1714 1321 117 87 1959 1424 1062 1529 415 758 905 168 631 361 1921 1680 855 1857 1012 2007 896 648 1848 2033 21 210 1745 757 1864 1811 1862 1194 184 1707 1266 80...

output:

No

result:

ok answer is NO

Test #36:

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

input:

1000 12
1946 1491 1501 9 2091 157 1373 3965 3334 2022 3279 3679 3180 1261 2202 2742 2157 3894 196 3546 2065 1975 3291 2967 665 1461 1881 3336 2076 1908 3045 3764 3882 742 4079 2172 161 2211 1589 3342 3639 1247 226 3163 2105 1079 326 4094 1233 2750 3388 2044 3793 3452 3821 2697 1841 1769 894 888 2473...

output:

No

result:

ok answer is NO

Test #37:

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

input:

1000 31
939916183 812136186 714091634 298026117 632800643 144911522 1202956091 2016571813 1161551441 611084024 1518874991 374078437 1585703787 23848197 1126423888 1526017717 209335967 45560372 2036110466 1587228499 1676201482 867737434 216955606 1619472875 656962835 985022368 1945037386 525790537 15...

output:

No

result:

ok answer is NO

Test #38:

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

input:

1000 31
308705887 284413100 536136674 1646595754 1778909034 627650386 1135489889 94420203 343574611 226070413 884825820 1267401794 949136953 1307693840 1747631356 1678765591 117861583 510934783 389722854 1431000523 912679662 1273800675 917672189 1524159020 1715348381 1482440017 64 1337069627 5400222...

output:

No

result:

ok answer is NO

Test #39:

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

input:

1000 62
1597253186214836913 3111597254565107371 67108864 1878529921160010454 2623085469576592174 4129577675190815861 220331898353934465 134217728 1142772076477628087 1330039340955116908 3429702811458694617 1981809107104569760 2675637527271029361 2967676796659033746 2101552134012292587 91087116396575...

output:

No

result:

ok answer is NO

Test #40:

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

input:

1000 62
1360543851082217959 3382181728270511135 3088864948570111046 434538031203168913 3450547921411405588 1158035321887855026 3831932870801671263 786955273963962238 3009793001473394457 2954196926692432472 3649701424027876902 9721980777489007 3894037145427541701 2352142686414767693 36332526799391976...

output:

No

result:

ok answer is NO

Test #41:

score: 0
Accepted
time: 108ms
memory: 12360kb

input:

999981 20
745089 900967 555891 1010098 327379 190094 886461 950853 252146 29559 146091 275911 899026 898573 997081 738754 697996 788305 368143 682190 449650 273293 914852 321140 256190 644014 66268 555193 1042339 678049 438323 351471 420755 6757 902677 169866 721010 291168 417532 959409 230601 39661...

output:

Yes

result:

ok answer is YES

Test #42:

score: 0
Accepted
time: 109ms
memory: 13004kb

input:

999980 20
331965 379338 865284 232959 780645 343592 551132 1017751 738530 2658 134368 589850 849837 899984 651371 901386 494257 925535 730926 320499 556087 606878 684321 444487 965810 726229 775538 532914 122836 320103 653793 392703 782672 253098 588718 86835 737804 637011 543379 292625 285919 67007...

output:

Yes

result:

ok answer is YES

Test #43:

score: 0
Accepted
time: 109ms
memory: 11852kb

input:

999982 20
678557 235988 505098 168669 611909 908795 896065 824333 689201 74503 58569 180522 185186 791314 414169 69762 663810 785702 55018 382651 779839 327014 325521 549412 170998 247957 398353 1034003 791790 315565 829291 705289 707288 393175 470066 1043050 904233 996358 756084 361476 673486 66285...

output:

Yes

result:

ok answer is YES

Test #44:

score: 0
Accepted
time: 164ms
memory: 11984kb

input:

1000000 31
1741507557 1328732015 1004416514 321245108 1164599374 886207972 1560988700 44106576 89136829 1717245977 309803552 1934962568 177317828 1109138461 782608362 177706830 1704306920 206905553 890571885 924498967 1515383483 1176454435 992491418 1681491942 1037413181 801319157 1601317572 8035986...

output:

Yes

result:

ok answer is YES

Test #45:

score: 0
Accepted
time: 167ms
memory: 11724kb

input:

1000000 31
624603118 194525914 234778927 1249320011 804823433 98247471 1194010427 995388951 1973295720 1671657650 295716947 953371586 1483154937 584777733 1815470781 882902202 1353121200 1770723096 1133206467 753125306 2053101667 212011546 1586785146 1745234327 1971571367 605818810 97072558 29720430...

output:

Yes

result:

ok answer is YES

Test #46:

score: 0
Accepted
time: 311ms
memory: 11796kb

input:

1000000 62
2664511407595722589 4468552452858528742 316820358174217708 656178687169564752 4040988964466274391 1164879108861762174 987190382919420948 1256181915839938048 3646126681721674128 2011723751684017662 4068537769994870517 1418688220826002528 23990760725462951 2305749957633511629 16814443991580...

output:

Yes

result:

ok answer is YES

Test #47:

score: 0
Accepted
time: 310ms
memory: 11980kb

input:

1000000 62
1548543937152358995 659690497509836284 3836371712579104416 848737453591306151 326119350741100069 2402809189617320919 2486811378377214987 4018948716366207867 1285842972806267181 2995393615551762988 2855584828520340047 1540863628124638832 383413619317596576 2153700457579720558 2981147259659...

output:

Yes

result:

ok answer is YES

Test #48:

score: 0
Accepted
time: 115ms
memory: 12108kb

input:

1000000 21
1137949 366161 2062284 1297915 2029270 578346 1625630 1910121 1940065 733393 39350 1552579 1862210 627415 1194707 177650 2051093 1000916 1432907 1024152 180247 1384062 408312 2042710 73566 1696268 656364 1023958 615825 1125350 161810 1082893 1098350 278011 1736066 1358815 1166858 688400 1...

output:

No

result:

ok answer is NO

Test #49:

score: 0
Accepted
time: 120ms
memory: 11980kb

input:

1000000 21
889547 964270 33447 334792 755996 586394 1036489 905155 1219609 1730671 176542 319707 1782031 1119003 1992032 265305 1162046 2079577 530254 677947 612104 932137 33789 341283 414149 251036 1152359 145290 122876 332897 1811580 1644505 691717 461907 2090193 502911 971360 46842 60164 617631 6...

output:

No

result:

ok answer is NO

Test #50:

score: 0
Accepted
time: 120ms
memory: 11980kb

input:

1000000 22
4022440 1474387 2213286 552384 1744703 2548440 1031170 1191496 805567 368013 884542 1114126 41582 3720697 3051161 282868 3481859 1505877 3411447 565787 3307604 1980945 1544635 1368235 4088589 1928961 3436538 115353 1340225 1263629 711311 2294079 1697108 1456015 2751449 289986 3799032 1888...

output:

No

result:

ok answer is NO

Test #51:

score: 0
Accepted
time: 167ms
memory: 11964kb

input:

1000000 31
1576118222 1053583973 1649422066 721759119 258072163 686514280 646112524 551663272 1219968334 354523417 1503614962 334644417 1495456084 1401567013 841505522 338251095 1449009998 1413733340 834084880 2012980112 1702434335 1668501195 1659478498 1047722689 121032578 1864105838 21196972 18878...

output:

No

result:

ok answer is NO

Test #52:

score: 0
Accepted
time: 165ms
memory: 12692kb

input:

1000000 31
691485554 1519510984 1269723198 1927903202 1886607843 1766875035 39857004 660690660 1258746013 1276952363 723910117 2041045252 1815428392 1614132672 955231332 47209488 1382656824 1023499445 732270674 1655859866 795997372 1947896705 136341268 1218635261 1098803659 1100482780 413186520 1269...

output:

No

result:

ok answer is NO

Test #53:

score: 0
Accepted
time: 312ms
memory: 12108kb

input:

1000000 62
2307076930897872336 62484625421961271 411305820640513348 3049444474602601719 1854999922037209597 3398233335156004065 379626635654932381 3449568869206834069 2962303095333097652 712044306344060228 2303650064497247760 1269631990221713906 3954566325704315125 3807004392293248230 24062723052572...

output:

No

result:

ok answer is NO

Test #54:

score: 0
Accepted
time: 315ms
memory: 11596kb

input:

1000000 62
1792484872337038977 2680272626340452862 2575900067735369939 890586048135577035 1423072583959523029 1611395638586154543 1142986801848822692 2720149458248282355 1946165272763331356 4578116627486303893 141702320751578153 2747474319224158872 43752263274032406 419511198808885992 13912573774679...

output:

No

result:

ok answer is NO