QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#672217#6975. XORangesKiharaTouma100 ✓97ms10900kbC++141.5kb2024-10-24 16:02:582024-10-24 16:02:58

Judging History

你现在查看的是最新测评结果

  • [2024-10-24 16:02:58]
  • 评测
  • 测评结果:100
  • 用时:97ms
  • 内存:10900kb
  • [2024-10-24 16:02:58]
  • 提交

answer

//qoj6975
#include <bits/stdc++.h>
using namespace std;

const int N = 2e5 + 10;
int n, q, a[N];

struct seg{
    int t[N*4];
    void mdf(int p, int l, int r, int x, int v){
        if(l == r) t[p] = v;
        else {
            int mid = l + r >> 1;
            if(x <= mid) mdf(p<<1, l, mid, x, v);
            else mdf(p<<1|1, mid+1, r, x, v);
            t[p] = t[p<<1] ^ t[p<<1|1];
        }
    }
    int ask(int p, int l, int r, int ql, int qr){
        if(qr < l || r < ql) return 0;
        if(ql <= l && r <= qr) return t[p];
        int mid = l + r >> 1;
        return ask(p<<1, l, mid, ql, qr) ^
                ask(p<<1|1, mid+1, r, ql, qr);
    }
} t, tt;

int main(){
    scanf("%d%d", &n, &q);
    for(int i = 1; i <= n; ++ i){
        scanf("%d", &a[i]);
        if(i & 1){
            t.mdf(1, 1, n, i, a[i]);
        } else {
            tt.mdf(1, 1, n, i, a[i]);
        }
    }
    while(q--){
        int op, x, y;
        scanf("%d%d%d", &op, &x, &y);
        if(op == 1){
            if(x & 1){
                t.mdf(1, 1, n, x, y);
            } else {
                tt.mdf(1, 1, n, x, y);
            }
        } else {
            if((y-x) & 1){
                puts("0");
            } else {
                if(x & 1){
                    printf("%d\n", t.ask(1, 1, n, x, y));
                } else {
                    printf("%d\n", tt.ask(1, 1, n, x, y));
                }
            }
        }
    }
    return 0;
}

詳細信息

Subtask #1:

score: 12
Accepted

Test #1:

score: 12
Accepted
time: 0ms
memory: 5888kb

input:

100 100
188946212 694030120 113207757 374962879 148168822 237480567 958331787 657059797 944262770 37715881 556544131 912748035 555342995 148861935 25229950 548887194 588806944 641037855 522288833 548164084 246533238 355138398 269573238 291905825 805709884 39163843 959949965 876829796 109977746 66691...

output:

0
0
404971871
0
0
740206584
0
0
980313451
447291188
776920463
771814966
90987456
913560066
805337051
0
0
228143514
292750375
905735052
218165852
0
454114649
0
0
0
75321333
422845649
43669833
743669157
828675448
0
744190950
0
98836895
502476732
0
0
401145839
1039400245
0
0
0
0
567716540
749059410

result:

ok 46 numbers

Test #2:

score: 12
Accepted
time: 1ms
memory: 5860kb

input:

100 100
791556982 445027895 617001468 112073574 396282436 717690761 137164914 64127462 722818722 239725466 91287034 180992409 51978493 978197998 651999240 769073004 57936340 225982177 5302557 607671409 63822136 469870652 102705329 200190517 911905313 791497060 698045070 982221986 142361214 446571087...

output:

0
244184558
291197577
0
0
14715261
0
0
0
0
1065700253
0
0
0
0
10512201
0
0
155560363
0
280739422
0
0
523140592
0
0
754999221
0
0
436253211
0
143835423
260506622
837832537
0
891764456
0
918507501
0
0
0
0
0
593329832
0
851510886
0
98642755
102767589
0
0
0
0
925530266
990701533
0
0
602258104

result:

ok 58 numbers

Test #3:

score: 12
Accepted
time: 0ms
memory: 7860kb

input:

100 100
654783711 286656061 262289731 196779766 265450104 386457500 756437467 1767486 752582770 950307141 557279918 129031437 318381967 352572754 133676687 570021658 229298677 444472486 848268075 901919057 119949310 590669578 890236092 438341522 315487971 93638233 940227860 740463264 881410813 86716...

output:

210640245
0
625836528
223528171
0
169151148
1028042431
0
634185047
0
0
1063361152
1040554816
123273470
0
0
0
0
0
0
0
0
86762368
357021439
0
0
0
989516834
0
0
0
0
0
0
0
872836366
260846098
0
0
0
1042550900
974479912
0
720973720
84464955
0
0
192942867
0
0
0

result:

ok 51 numbers

Test #4:

score: 12
Accepted
time: 1ms
memory: 8048kb

input:

100 100
98313376 137998850 255619744 364595165 198885591 559370180 166199163 490693098 269046276 518308932 40102469 584052183 378914512 178606991 970804236 138796896 482940078 633215570 749477638 18427272 483928518 836180939 767236974 177744910 144828383 374693337 363364859 587592798 608195067 66948...

output:

0
0
0
23958224
0
516634055
0
0
731856611
0
161913867
1042386686
0
0
10292076
1058951141
0
0
8439144
0
0
480809812
527143777
825819994
555977833
662882003
31911897
1043963523
0
947930425
743104765
0
819038982
0
0
0
0
732181544
0
175377657
885832424
0
0
0
217079092
927520597
595109870
732422526
714178...

result:

ok 93 numbers

Test #5:

score: 12
Accepted
time: 1ms
memory: 7916kb

input:

100 100
662046627 781596838 634352293 717462591 383135646 258144355 262555440 188968785 652669773 957243980 258032156 101576202 719888005 323783981 642399457 826844358 772024461 968171954 647087136 94457328 937719970 241090198 924842444 853671546 535606090 725183998 682996714 417995390 372394119 364...

output:

0
0
544428447
503188678
0
0
0
0
466444293
868849112
0
352834297
0
324834685
614501897
52669758
52669758
97691509
374571389
90026213
0
0
844061842
0
0
614501897
0
0
440854077
0
274787774
0
1054120215
0
0
1044779730
976080754
0
97691509
0
0
0
0
191529276
241373750
0
481844426
0
0
0
524656593
190698357...

result:

ok 95 numbers

Subtask #2:

score: 18
Accepted

Test #6:

score: 18
Accepted
time: 1ms
memory: 5824kb

input:

500 500
828204413 375316536 741469180 227506363 638244744 594319744 41841150 454416081 119489606 341194480 277767380 879871395 122305162 317634224 592519414 154510767 34758197 756668191 821070409 185504558 755657171 158353936 388067992 612217210 84405823 982889058 653045087 898758219 273902121 70592...

output:

0
49379239
0
1035483721
219267520
0
754750203
0
0
0
0
135453472
0
763715585
0
0
215373738
0
96670776
126425750
0
0
341458128
0
276818327
0
0
876360925
422318157
991296839
340767594
188513916
43445174
601317239
283808984
0
0
0
618663170
0
0
0
909797000
0
262613925
458997547
0
0
69495086
399434640
0
0...

result:

ok 500 numbers

Test #7:

score: 18
Accepted
time: 0ms
memory: 7892kb

input:

500 500
275992933 560216710 246429585 954798584 358863854 261557055 514231529 805706810 489463601 573313454 27282641 562633470 80328553 658671621 339077050 343580881 519239467 649454385 228030058 486711388 234885522 814981036 676112992 390880311 242497098 631670091 352395381 2624526 173918560 857278...

output:

0
0
0
0
81287828
577066207
0
266231545
645735757
586588783
0
0
0
0
0
0
741588410
0
290340778
0
650016612
134067636
0
854956401
896038743
0
87245282
1037430902
100315980
0
0
878152970
0
0
1043872050
926982982
221697439
156249474
536424983
451310728
0
0
0
0
0
0
7392165
0
439519912
0
0
0
0
968207821
0
...

result:

ok 500 numbers

Test #8:

score: 18
Accepted
time: 0ms
memory: 5860kb

input:

500 500
797870496 628399129 816596838 4626583 655907430 869603226 946348573 973259129 495087744 427064883 506990997 597078346 695223786 200737735 558250244 228582888 908403464 114287247 625867302 616647716 104256283 978894016 30362885 24669191 486133960 113993808 261004829 24471469 860323330 2961823...

output:

710087296
304286675
153254355
0
0
0
0
900244325
0
0
290299897
1011425576
407023831
0
90132098
0
768479742
288703391
0
742651159
0
0
957879867
0
343719522
0
886296683
0
99808790
685617357
0
8455200
191507071
0
933067541
0
364532278
0
357076185
0
783985350
0
166038020
735705618
0
0
0
66665871
56248765...

result:

ok 500 numbers

Test #9:

score: 18
Accepted
time: 1ms
memory: 6020kb

input:

500 500
710662840 853955280 276496440 986691331 627903443 146946335 543941342 376420520 949972170 468583603 393579196 675958089 21891663 958939734 308683583 817980968 250992280 41692003 31212810 287137908 388252758 984751480 652981925 202065514 767890808 88476823 109209224 947606977 810154042 366708...

output:

0
0
0
73816413
440931671
0
443538172
118889725
0
559453036
314333885
1067380445
88232016
482195933
311657684
528749554
655425169
0
0
978733584
521030349
0
0
166762474
262065604
692192605
23134806
811041597
0
0
520671048
0
618405462
982700162
920090844
61130470
455646583
0
0
0
983711095
279892047
479...

result:

ok 500 numbers

Test #10:

score: 18
Accepted
time: 1ms
memory: 7984kb

input:

500 500
665675596 237277520 811365739 853507234 730709940 576592659 10239859 960341648 808933543 575922494 721366367 762586902 35880752 236987524 101662156 196527010 182361673 502260005 733651154 642532260 418922473 804663924 643349021 450793444 312059072 770237428 661189176 594649199 303491010 8594...

output:

976128458
559294994
474699216
0
318598500
0
0
663309699
207157435
426440130
0
0
673170356
0
0
1059694348
880692272
0
0
0
616757175
0
0
686708957
0
522255655
0
225759944
467075872
726159389
867796057
463589343
496332663
0
0
0
0
708548558
568149336
235562865
0
0
926048540
707870690
0
0
0
0
0
929385180...

result:

ok 500 numbers

Subtask #3:

score: 25
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #11:

score: 25
Accepted
time: 3ms
memory: 5936kb

input:

5000 5000
7244958 812627151 459987369 58250678 938312329 134151213 710540974 686873617 800998989 524750641 620605095 347756476 708440175 557679645 628507497 625829050 428648549 690319235 916037168 877889207 709581565 715029533 576196994 537816302 971858418 821448032 771410715 135664143 859036663 913...

output:

986031791
0
848961442
36038126
201400215
0
85810609
796076970
340841759
0
0
0
765030225
948558033
367932334
0
470333652
880198702
0
0
836965150
0
0
564716248
0
0
0
79579998
656438770
720205968
1053438413
0
0
0
359004241
23995012
0
661992710
0
0
0
598162738
0
197218772
0
0
0
0
781269911
0
134349393
0...

result:

ok 2523 numbers

Test #12:

score: 25
Accepted
time: 3ms
memory: 5936kb

input:

5000 5000
251239257 665395090 192880465 864485030 170338978 520731099 365424828 566141982 608560879 821947213 326820460 710218747 861574281 109390736 709739323 232249231 88250799 510735226 186740095 148221063 830679157 66785420 548890311 502253957 577211939 442422603 984387014 998607952 571602803 25...

output:

0
238861154
0
133890867
284690970
0
563848571
613729456
744449994
616722947
0
0
0
0
0
463133540
0
0
0
0
0
393116373
732912328
997439100
0
0
504165345
806379629
672949352
0
0
0
627468615
773266427
0
0
0
0
213933342
0
0
1025923399
0
361672515
1055786965
0
0
696002765
0
1058567836
889858845
1066918569
...

result:

ok 2511 numbers

Test #13:

score: 25
Accepted
time: 3ms
memory: 8108kb

input:

5000 5000
415336304 414964738 925981083 861681709 42575109 723877392 40950714 353856403 596029899 823857717 981599212 597694588 17357068 79528230 132777833 778590662 517370997 843978847 111442549 950082101 30450070 155014780 249070343 374896678 777537728 779664461 878906592 116493807 591747330 24224...

output:

0
35874627
99903878
0
0
0
0
0
1042606395
0
0
344896983
334830017
0
0
473408889
0
974367685
142893071
966140758
0
0
6516966
0
681843384
328872233
651313546
0
372223449
946259126
0
756609504
667835147
517685959
0
111497608
0
0
0
213581051
727401876
134658163
0
0
0
0
1049734019
0
0
449001143
26451315
7...

result:

ok 4743 numbers

Test #14:

score: 25
Accepted
time: 3ms
memory: 8116kb

input:

5000 5000
3182318 142901733 390571773 114156285 610244886 861682757 124497855 338537062 976424579 602051240 42867826 239957538 45561789 690387964 4305266 192109502 536617511 249783313 574551422 931206222 264278684 691262398 819196547 995615124 935355090 85341 133686787 187250054 489878752 759110243 ...

output:

0
988756119
790203057
0
910844871
0
0
164026699
0
803922616
0
203331926
0
0
431160980
882555155
0
222249421
0
797597292
0
715126024
0
60423108
70557297
722167811
221895347
0
556011796
0
640493309
0
0
0
609270755
0
332867739
0
541872044
0
831149086
0
263136661
363118925
406282820
869188562
509860782
...

result:

ok 4739 numbers

Subtask #4:

score: 20
Accepted

Dependency #2:

100%
Accepted

Test #15:

score: 20
Accepted
time: 94ms
memory: 10768kb

input:

200000 200000
476567970 701497822 1174224 976191474 480138300 603149665 497231536 331408545 626894087 872585929 140916677 33234045 514343901 6685480 729363868 805005309 233795706 186621382 441457743 522967184 900636119 619797010 780205751 161253296 964524289 294460172 310333975 653643023 540453839 6...

output:

0
0
271210802
0
66815856
0
608412954
0
486227159
0
1055485942
0
0
179576307
0
0
0
0
0
1012874077
74939711
0
355629354
0
226078875
0
78231801
0
0
605345050
0
214312654
0
350171270
0
0
0
0
0
875650111
0
0
0
0
588739871
328934481
944893185
0
517849327
0
645567231
0
867463025
0
0
86878897
0
0
824957380
...

result:

ok 200000 numbers

Test #16:

score: 20
Accepted
time: 91ms
memory: 10476kb

input:

200000 200000
248192442 864618214 352270767 343026099 583410365 531076588 528476705 733464965 43242470 953592678 243291621 394524395 626576705 295638759 554414303 151571199 944039747 880022595 528322913 672670884 470086838 637664909 764914222 238260599 206070913 751051475 622769875 802898252 6329645...

output:

0
204600168
0
358824545
580498203
0
0
122453194
233796587
400234222
859347589
5097289
0
0
0
925736711
346146762
0
0
0
1068751613
702165337
300358220
0
798556436
525733963
413594864
131800437
0
326114080
0
0
968882075
0
0
1028521231
0
0
0
219004801
388646337
1070195923
0
0
0
0
706546310
0
0
991377466...

result:

ok 200000 numbers

Test #17:

score: 20
Accepted
time: 94ms
memory: 10820kb

input:

200000 200000
153528355 56765789 737150449 979348081 139116827 348544732 267539104 459722075 286316569 643786133 996545539 524890085 286943166 115929518 610516276 595098856 957917886 195313703 690428528 804197122 421514256 966413748 91099458 827097687 458288954 11199110 18752053 200538086 741348336 ...

output:

0
0
50735378
0
0
0
633365632
0
0
133598734
455627107
0
558580665
0
61142855
1052028183
308501882
233647978
30114636
0
47004841
423735385
0
0
599855560
0
0
307846487
473844538
931121703
934042310
600522869
0
0
940770344
0
1025474909
0
0
556914781
0
286926753
50928715
347352366
0
104443937
636567313
0...

result:

ok 200000 numbers

Test #18:

score: 20
Accepted
time: 74ms
memory: 10900kb

input:

200000 200000
617557716 654690638 679431617 170973990 396138424 831303464 425765676 112953332 803165348 943010436 663898415 487988509 434979287 8631610 271510545 242827027 746368689 142418495 896615393 350022076 523645295 661498539 141409864 527846459 742815834 89699081 692005934 197275129 189570549...

output:

0
0
173809008
282774222
897169225
0
0
440721135
724919743
0
0
0
425976380
1043226353
0
70008767
532000505
0
0
487447553
0
35308508
0
754058151
0
0
0
151146491
0
991230877
0
170893063
0
0
0
969201131
0
0
15112482
0
222204596
0
0
0
0
0
0
32350354
0
575144485
895803577
0
196247995
0
751151519
180161057...

result:

ok 200000 numbers

Test #19:

score: 20
Accepted
time: 78ms
memory: 9956kb

input:

200000 200000
989189826 777019771 961979197 720507102 965701472 87440345 672061828 655965618 105671082 131256817 801230465 161375401 900496826 747141754 122653599 691512232 956963899 550165319 154902028 597457445 34803803 418520206 7563391 289139960 339932989 674407430 207271414 99991238 755337803 8...

output:

840395218
35160645
0
90483273
34075961
0
449435382
0
0
232369566
0
617792783
757566729
632795788
550955428
0
0
796393948
0
172889381
1062174614
984606153
0
69447897
230463702
759935622
350988242
1012438428
379799491
635973452
474192975
0
763631319
172242059
1067481418
0
544741045
746605515
849903793...

result:

ok 200000 numbers

Subtask #5:

score: 25
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Test #20:

score: 25
Accepted
time: 96ms
memory: 10808kb

input:

200000 200000
657686901 935929033 516819979 722632998 146798639 946792211 984129499 202672278 482235096 230470084 791603632 948114883 553526317 217014507 161237431 84739280 681426772 333404795 818210991 776172601 276812214 273395881 155733492 2304030 176495779 542420223 543679247 744456944 135440931...

output:

492836026
0
0
988328138
0
0
0
0
0
0
0
325337044
554332973
314337693
354583120
0
848588802
0
0
0
220425854
0
0
0
0
44776284
0
594778742
0
0
0
1014584613
249887659
0
0
0
259122721
477793139
0
0
297710157
0
0
0
163205378
0
0
0
0
0
589214492
0
0
509264686
0
750829883
156101532
0
0
0
0
0
0
162382070
0
0
...

result:

ok 100132 numbers

Test #21:

score: 25
Accepted
time: 97ms
memory: 10896kb

input:

200000 200000
719720743 248413143 439839700 23902906 457383207 943231660 424156995 217035644 729272247 81072423 62837528 60033211 948842031 996309008 209132460 971787797 90324532 57113270 716850623 61900517 503569086 768996489 835498319 375887583 347516222 531999149 206033703 641552782 96242920 9348...

output:

91555446
0
0
0
0
151335670
0
0
0
460137714
4102191
559713922
0
0
0
864551260
0
0
473553595
0
5381472
551162211
183857964
558773936
0
0
42870186
42447650
0
238380815
402098876
0
0
0
0
827845190
409921476
744703136
946339913
515361262
0
0
0
0
804753623
0
310522035
0
70219192
0
279548001
0
0
35069634
4...

result:

ok 99865 numbers

Test #22:

score: 25
Accepted
time: 91ms
memory: 9720kb

input:

200000 200000
196345970 397300488 265957257 908680596 582430060 92405742 767821547 178253722 171353791 776598822 88637352 242235318 287196593 616520841 283280075 38433613 256547991 335344414 863050351 224707109 882320347 111090644 570599510 987667923 967103325 827123628 823377568 677405679 897892268...

output:

198935009
0
842810672
459208083
934752728
166880207
518221957
26446856
0
557113586
0
961461
0
509147198
698333910
588534672
0
0
499731352
435065448
384554606
880529728
109560668
949703745
0
0
0
0
798469904
568593923
0
813083758
0
0
0
0
0
0
0
857220155
708461930
188541526
358336125
269648022
11120159...

result:

ok 100026 numbers

Test #23:

score: 25
Accepted
time: 78ms
memory: 10820kb

input:

200000 200000
868694972 598829102 746230722 308553739 733054131 619597685 864464790 98755140 368262433 669598730 474635496 390037601 250587180 261066422 26715867 142040905 668743985 403576406 443602887 794509988 446035800 366129444 465409951 858338564 418228717 634977127 103541470 414878096 77279086...

output:

0
29461029
163303158
406526423
0
74819535
808693023
0
0
0
736821070
111584937
394886427
0
0
0
0
0
340548462
0
0
253647073
0
978055796
0
0
891645253
0
181167174
368064524
0
0
0
0
646169017
0
985638534
1068063394
0
0
1019558852
395393976
0
0
0
510170391
0
0
898710728
669735867
351171073
0
1042154858
0...

result:

ok 190056 numbers

Test #24:

score: 25
Accepted
time: 75ms
memory: 10900kb

input:

200000 200000
550032851 375235137 807279443 766438354 878065806 467564125 163093726 718240870 362977373 200438643 976231658 195819230 515040118 834492611 816715295 58692886 200314674 990063588 58536612 731592044 557881540 598834776 857066212 136484750 734108245 593487790 245480344 708609960 22724801...

output:

0
2930110
507978206
0
0
0
266402644
0
514507780
0
179972442
0
0
0
933888554
0
818589854
76287867
0
0
783576558
734639605
0
1007532529
515068210
0
0
0
0
0
0
55928968
0
0
0
760760482
0
608097450
1061322231
772018227
7054972
0
797797768
0
867828857
457174908
538112679
0
0
0
0
418762078
0
1004217805
923...

result:

ok 189852 numbers