QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#537382 | #6447. Heaps from Trees | ucup-team1005# | AC ✓ | 274ms | 70044kb | C++20 | 3.2kb | 2024-08-30 11:42:29 | 2024-08-30 11:42:29 |
Due to the privacy settings of the submitter, you are not allowed to view this code.
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 7884kb
input:
5 3 0 3 1 3 2 3 3 3 4
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 0ms
memory: 5872kb
input:
5 4 0 3 1 2 2 1 3 0 4
output:
5
result:
ok single line: '5'
Test #3:
score: 0
Accepted
time: 0ms
memory: 5552kb
input:
6 3 0 1 1 2 1 3 1 4 1 5 1
output:
5
result:
ok single line: '5'
Test #4:
score: 0
Accepted
time: 1ms
memory: 5600kb
input:
11 7 0 8 1 5 1 5 2 4 2 3 2 6 3 6 3 10 4 9 4 11 4
output:
7
result:
ok single line: '7'
Test #5:
score: 0
Accepted
time: 2ms
memory: 8004kb
input:
1000 1144 0 2478 1 460 1 22 2 991 3 2444 2 642 3 526 1 1690 8 568 4 717 6 1708 9 1382 2 959 3 413 12 1786 7 1618 2 1635 5 2208 18 997 9 963 9 2290 6 934 7 2025 1 189 17 831 12 2040 9 1119 16 408 8 1151 19 1696 2 707 31 146 25 1940 19 1526 27 1135 4 1760 7 243 4 1090 30 891 31 1562 21 2174 15 1786 7 ...
output:
664
result:
ok single line: '664'
Test #6:
score: 0
Accepted
time: 0ms
memory: 7824kb
input:
1000 644 0 359 1 1885 1 1764 3 50 4 1008 1 1603 5 572 1 1997 6 960 5 2480 6 720 7 1660 9 2362 9 2304 2 1118 6 1858 11 855 16 116 1 1157 3 926 20 1435 17 1058 19 2353 21 536 13 657 14 446 5 1625 18 941 2 1041 9 1553 15 2199 8 2278 2 2018 21 2280 1 1446 12 1068 14 5 18 1563 35 294 36 440 1 731 40 1566...
output:
676
result:
ok single line: '676'
Test #7:
score: 0
Accepted
time: 0ms
memory: 5784kb
input:
1000 1638 0 1061 1 480 2 687 1 1900 4 2431 2 2075 4 1333 3 1972 3 2098 5 485 10 795 9 1136 11 653 11 1205 7 1391 13 1799 13 2148 13 1168 14 2461 17 1596 13 277 2 2405 10 1071 12 504 16 430 2 2323 16 396 22 390 18 1607 2 653 11 1003 11 90 7 367 31 450 33 1299 2 1430 3 915 22 215 18 139 9 802 5 795 7 ...
output:
661
result:
ok single line: '661'
Test #8:
score: 0
Accepted
time: 2ms
memory: 7828kb
input:
1000 903 0 1289 1 328 2 748 3 2162 3 533 3 2168 4 254 7 93 6 1852 9 1226 3 663 8 697 7 72 2 155 2 1174 6 62 7 138 11 1362 6 2011 12 630 14 2230 3 296 5 1888 1 2012 16 2007 3 2383 16 807 24 2368 11 2298 21 1722 11 840 26 832 31 2110 18 2055 23 2172 15 181 1 300 10 1105 3 1168 22 1655 9 739 22 1739 33...
output:
664
result:
ok single line: '664'
Test #9:
score: 0
Accepted
time: 2ms
memory: 7884kb
input:
1000 921 0 1358 1 37 1 1869 2 705 1 1423 1 1483 6 1297 3 2477 4 1670 9 415 9 1522 4 1559 7 559 5 1253 7 1091 14 1090 11 2287 12 965 13 1367 17 287 18 5 6 398 16 431 5 840 6 610 10 437 20 771 23 1840 12 2389 1 142 9 965 8 2426 1 1628 13 338 25 1570 30 1079 31 1560 23 902 2 1105 6 1743 6 2164 18 537 6...
output:
679
result:
ok single line: '679'
Test #10:
score: 0
Accepted
time: 165ms
memory: 44384kb
input:
132310 999998896 0 999693116 1 992706198 2 999963461 3 994731566 4 999993340 5 997969045 6 999968840 7 999930794 8 999865502 9 999957675 10 999885886 11 999989149 12 999971056 13 999980898 14 999942692 15 999996506 16 999782568 17 999849066 18 999999386 19 999828855 20 999993796 21 999980756 22 9996...
output:
70250
result:
ok single line: '70250'
Test #11:
score: 0
Accepted
time: 263ms
memory: 69040kb
input:
196244 106759472 0 266085850 1 248770978 1 185540991 3 247715106 3 109552984 5 207837553 4 86811739 7 20704459 1 281438385 1 16242319 9 256169922 9 58395573 8 575141 4 310210535 2 815914435 5 42720613 3 541831475 1 5428996 2 210395286 18 254450191 9 248446660 5 16612978 12 56366859 6 494265403 10 23...
output:
130986
result:
ok single line: '130986'
Test #12:
score: 0
Accepted
time: 152ms
memory: 42252kb
input:
131701 2017 0 210801 1 2824284 2 2630 3 182028 4 624001 5 402 4 822 7 6270 8 364224 9 2 10 13311 8 48169 10 1 10 79240 14 879689 15 19770 14 1002 16 49 16 16429 19 4975 19 4810432 21 934 22 1366761 9 6087 24 131715 25 4300 25 10232 27 107784 26 32903 27 1655 29 34176 31 71 28 801543 33 4032 33 854 3...
output:
71473
result:
ok single line: '71473'
Test #13:
score: 0
Accepted
time: 266ms
memory: 70044kb
input:
199960 197186142 0 66164979 1 500125556 1 253350278 1 366915374 2 32062470 1 147932741 3 12562671 1 322635443 1 179310264 1 117015890 1 264062167 5 246718309 5 397576799 1 12196885 4 382283472 9 468344186 4 166330550 5 918713195 3 34157589 1 233256908 4 352055457 3 4734267 11 9649626 2 218047375 20 ...
output:
154527
result:
ok single line: '154527'
Test #14:
score: 0
Accepted
time: 141ms
memory: 52884kb
input:
154616 43847 0 483137 1 71130 1 391 1 176 1 640333 1 769 1 11619 1 18759 1 1925 1 158279 1 1150 1 590130 1 3212 1 31271 1 39057 1 126478 1 98200 1 1101557 1 52825 1 79336 1 389091 1 5151 1 375 1 1416050 1 920 1 8446 1 39059 1 5150 1 316572 1 16070 1 38792 1 201778 1 905754 1 9943 1 3015 1 108641 1 8...
output:
153456
result:
ok single line: '153456'
Test #15:
score: 0
Accepted
time: 225ms
memory: 66972kb
input:
197722 62407338 0 140638683 1 848345 2 19190729 1 400820753 1 151465340 1 8328033 1 28247687 1 140255427 1 50089005 1 27681676 1 4821718 1 129874667 1 57771487 3 42512442 1 37399768 1 1745932 2 104392939 1 10155765 1 51352416 1 18125766 2 319719264 1 343028223 1 46562325 3 10122767 1 30402937 2 1766...
output:
183188
result:
ok single line: '183188'
Test #16:
score: 0
Accepted
time: 218ms
memory: 61612kb
input:
181735 997628866 0 967665223 1 999770317 2 998888025 3 989509450 4 987851120 5 996844727 6 999891759 7 998382915 8 998766933 9 999983610 10 999847761 11 999937866 12 999487559 13 998615562 14 999815803 15 996037235 16 979950380 17 999838152 18 999990475 19 999681848 20 999998467 20 974305559 22 9996...
output:
92423
result:
ok single line: '92423'
Test #17:
score: 0
Accepted
time: 274ms
memory: 67880kb
input:
200000 998698902 0 999621259 1 987967877 2 999313134 3 997475676 4 830897491 5 999856991 6 985775697 7 995822019 8 960756804 9 999712378 9 997302724 11 999977882 6 999539102 12 993288044 14 996775103 14 928407031 16 985170083 17 919567191 17 995236639 19 999964029 20 998150006 21 982549590 22 987677...
output:
107579
result:
ok single line: '107579'
Test #18:
score: 0
Accepted
time: 226ms
memory: 62408kb
input:
198382 1287225 0 69999 1 265 2 22425 3 31138 4 169126 5 3244970 6 166685 7 23484329 8 451616 9 204747 10 37896 11 90 12 31939 13 340248 14 401733 15 18 16 7778 17 12404 18 30300 19 3594828 20 69113 21 31683 22 1630263 23 850748 24 7397 25 12366 26 3461 26 45755 28 3641 29 58226 30 13377479 31 231053...
output:
100955
result:
ok single line: '100955'
Test #19:
score: 0
Accepted
time: 169ms
memory: 52808kb
input:
152453 993774644 0 995931890 1 999433347 1 999882287 1 999960314 1 999658707 1 993677907 1 949418471 1 999527504 1 999978924 1 998573769 1 999878171 2 996758708 2 999608319 1 999998256 1 999991053 1 999929918 1 999107149 1 996811411 1 993983836 1 999927218 1 997827398 1 999939146 1 999719038 1 99936...
output:
147283
result:
ok single line: '147283'
Test #20:
score: 0
Accepted
time: 220ms
memory: 66964kb
input:
199995 19775370 0 116037880 1 339015 1 1433449 1 19483046 1 46139 1 20721653 1 7695813 1 578676 1 84523249 1 49185420 1 19894176 1 791860 1 6291309 1 9083150 1 20925476 1 66779795 1 34142654 1 17744382 1 13533101 1 11753375 1 386168 1 539586 1 50276760 2 207751 1 4508924 1 24617702 1 966306 1 111371...
output:
197840
result:
ok single line: '197840'
Test #21:
score: 0
Accepted
time: 239ms
memory: 66288kb
input:
199992 34566726 0 96053530 1 2323343 2 5610508 3 788363 4 29906440 5 25898552 6 79707275 7 50093101 8 148466 9 144573797 10 3875408 11 12611266 12 12040469 13 56193280 14 33643044 15 4293562 16 375086745 17 12524087 18 12270083 19 24060933 20 311266612 21 5992951 22 306255862 23 205168714 24 4232762...
output:
104514
result:
ok single line: '104514'
Test #22:
score: 0
Accepted
time: 220ms
memory: 59208kb
input:
190182 8586 0 74 1 3498 2 34173 3 24059 4 215328 5 35570 6 1353169 7 9369 6 1305 9 13372 10 20773 10 20863 12 387738 8 3024 13 39167 15 2548175 16 29337 17 24 18 1655089 19 1647428 20 110740 19 69725 21 20026 23 489 24 780 25 99981 26 767 25 20970 28 72096 27 17005 30 261 31 7724107 32 443 31 204173...
output:
102037
result:
ok single line: '102037'
Test #23:
score: 0
Accepted
time: 227ms
memory: 64328kb
input:
198704 998310184 0 994299407 1 999671160 2 999874197 3 988089399 4 999804186 5 998617720 6 999853422 7 999986623 8 999853756 9 999100231 10 999992187 11 999995297 12 999512035 13 999992562 14 999432840 15 997728179 16 999999766 17 999980258 18 999494730 19 999983137 20 962630749 21 999188699 22 9997...
output:
101279
result:
ok single line: '101279'
Test #24:
score: 0
Accepted
time: 224ms
memory: 61492kb
input:
193145 992832 0 2038619 1 47984 1 7294 3 115156 4 312017 5 216413 6 1371724 7 363 8 44082 8 348236 10 1 11 75033 5 76926 13 2430 14 152168 11 793040 16 7356 17 1697672 13 44142 19 88024 20 790546 21 3521 20 7954 23 43328 24 370 25 16582 23 16528 19 115638 26 24921092 23 1239358 30 25212 31 461 32 91...
output:
105007
result:
ok single line: '105007'
Test #25:
score: 0
Accepted
time: 190ms
memory: 65564kb
input:
197008 1578976 0 22695832 1 7765800 1 32333 1 748387 1 1299097 1 28583268 1 6853543 1 151085288 1 31806464 1 793710 1 34313 1 289156 1 5598562 1 1104150 1 1753349 1 111741 1 11389746 1 226373 1 1130718 1 354659 1 10102900 1 1892665 1 22566402 1 18976125 1 46756 1 599236 1 9367891 1 16754492 1 841204...
output:
195496
result:
ok single line: '195496'
Test #26:
score: 0
Accepted
time: 199ms
memory: 53764kb
input:
159870 44044404 0 218326585 1 369147123 2 81174858 3 864003227 4 195586470 5 94666968 6 481366383 5 4659029 4 83239496 9 220784814 10 80530559 9 132283 12 68529294 13 251756175 13 26673565 15 170388947 14 133551437 17 30138398 17 28605493 19 177876044 20 545575070 20 114054976 21 393719463 23 436798...
output:
86028
result:
ok single line: '86028'
Test #27:
score: 0
Accepted
time: 211ms
memory: 64252kb
input:
183585 999319605 0 981130661 1 675097531 1 773083803 1 964701998 2 967359527 1 943482220 1 950088439 1 997717912 2 592420397 1 995326231 1 912604840 3 971156056 1 867625526 6 997610887 1 834241685 2 940131751 1 934230374 9 997216465 3 975314426 3 904307090 1 991741937 3 941235159 1 720799625 1 97261...
output:
154834
result:
ok single line: '154834'
Test #28:
score: 0
Accepted
time: 104ms
memory: 36952kb
input:
102840 996557823 0 999973714 1 998256555 2 999975167 3 999999754 4 999992921 5 997565258 6 989940342 7 999388802 8 997258974 9 999028735 10 999962416 11 999964792 12 939165237 13 999993406 14 979916407 15 999041305 16 999167506 17 999928103 17 998912479 19 994313937 20 999999629 21 999999800 22 9999...
output:
52977
result:
ok single line: '52977'
Test #29:
score: 0
Accepted
time: 213ms
memory: 64256kb
input:
181733 5655 0 2729870 1 707956 1 538752 2 29756421 1 6496967 1 65199 2 3922435 1 57946 1 7023619 2 5231409 2 77 1 2684736 3 127569721 1 679581 2 118280 1 8793002 4 3183 2 5254884 1 544337 1 2000141 6 2656721 7 2985184 2 2112216 3 2672559 13 276240 2 38288 3 928767 2 12029368 7 4900676 1 655284 24 14...
output:
153465
result:
ok single line: '153465'
Test #30:
score: 0
Accepted
time: 166ms
memory: 44108kb
input:
133024 999999883 0 999766292 1 957748887 2 999904862 2 999999776 4 994382750 3 994332003 4 890852606 7 983444452 8 999823973 9 999943904 10 999823649 11 998201755 11 988302079 13 999864384 14 999985398 15 994442959 16 997772922 17 999961731 14 999983484 19 999379494 20 983225559 19 997543723 21 9997...
output:
72207
result:
ok single line: '72207'
Test #31:
score: 0
Accepted
time: 71ms
memory: 30136kb
input:
78164 995503927 0 999501802 1 984058015 1 999999688 1 999995809 1 999539589 1 999985709 1 990616201 1 999848737 2 999676495 1 999839489 2 999935859 1 999975495 1 992102570 1 999895411 1 999768897 2 999067545 1 997547956 2 999906159 1 999952901 1 999974306 1 999655312 1 999364605 1 999985972 1 998093...
output:
72475
result:
ok single line: '72475'
Test #32:
score: 0
Accepted
time: 241ms
memory: 65600kb
input:
194038 781386 0 100058 1 10242699 2 5784967 3 3827508 4 292255 5 1603527 6 116387785 6 107328819 8 253 9 17366657 10 78122737 11 814164 12 49400 13 6624507 13 14117417 15 104107380 16 15959312 17 18565433 18 1228919 19 4278697 17 1343627 21 2012925 22 247895 23 241085 24 18777187 24 910657 25 110088...
output:
103979
result:
ok single line: '103979'
Test #33:
score: 0
Accepted
time: 203ms
memory: 62620kb
input:
194819 999989856 0 999713286 1 999999323 2 999997300 3 999772770 4 999881023 5 999974675 6 999906290 7 999852735 8 999975466 9 999387545 10 999969954 11 998949563 12 998665457 13 999999023 14 999999985 15 999750822 16 999774165 17 999802486 18 995344015 19 999887540 20 999999669 21 999961955 22 9998...
output:
95363
result:
ok single line: '95363'
Test #34:
score: 0
Accepted
time: 154ms
memory: 48312kb
input:
145920 995864078 0 991206251 1 852431958 1 958631847 1 993567922 1 992813434 1 969398368 1 161564756 1 980915276 1 936247123 1 937735120 1 716018190 1 990585905 1 831612724 1 881778696 1 837326838 1 894253286 1 975555047 1 963987982 1 995305367 1 947644534 1 998630559 1 991371139 1 979817794 1 85428...
output:
144823
result:
ok single line: '144823'
Test #35:
score: 0
Accepted
time: 149ms
memory: 46064kb
input:
129263 87145272 0 188471 1 90662 2 2459815 1 109 1 144388 1 2305742 1 1223332 4 598298 1 17439 1 30016 1 176872 6 10536 1 9759451 1 3870879 1 506894 1 164937 1 150359 1 740419 2 11413381 4 9549 1 256020 6 250299 3 14241 2 1357806 16 159079 10 198689 1 124044 7 2725816 9 12735 1 13805 10 130771 13 50...
output:
109112
result:
ok single line: '109112'
Test #36:
score: 0
Accepted
time: 219ms
memory: 56000kb
input:
165688 836499767 0 363870004 1 704428963 2 969275103 3 769823580 4 555316004 5 994166741 6 355856317 7 951949587 6 806045857 9 839594125 9 748201811 10 763377756 12 494098857 11 693055202 14 892551623 14 887031560 15 569338112 16 850967719 18 744753470 16 877160523 19 733264076 21 971083473 20 91791...
output:
89122
result:
ok single line: '89122'
Test #37:
score: 0
Accepted
time: 220ms
memory: 62400kb
input:
191552 996011399 0 971764384 1 984749729 2 992010711 3 909182968 4 982792710 5 519957175 6 874532214 7 998667736 8 907714403 9 953132656 10 948384763 11 999734285 12 998131724 13 951427415 14 982693765 15 997193452 16 881519599 17 995791379 18 980576289 19 950967353 20 987962281 21 850908539 22 9932...
output:
93583
result:
ok single line: '93583'
Test #38:
score: 0
Accepted
time: 236ms
memory: 68348kb
input:
200000 994877245 0 608506265 1 968795312 1 914892463 1 964306231 1 995438308 1 933245585 1 961528022 1 897264046 1 998408305 1 993791041 1 988734749 1 972625746 1 993896741 1 929739143 1 990204722 1 983534101 1 986150636 3 768968265 1 996704448 1 992963067 1 924261290 1 993112015 1 975653811 1 99858...
output:
189895
result:
ok single line: '189895'
Test #39:
score: 0
Accepted
time: 259ms
memory: 68980kb
input:
200000 140136 0 238963 1 135451 1 131950 1 4049407 1 59456 1 2597004 1 108509 1 1697 1 4552949 1 93571 3 12901 3 17 2 34531 3 18871 1 515752 1 259064 2 2674 1 546296 1 240543 4 45557459 4 2499 2 7199504 5 18535500 1 1007647 7 1600893 12 3050792 2 40907 2 54435780 2 3867655 8 4825 1 13246 5 4386 1 28...
output:
168715
result:
ok single line: '168715'
Test #40:
score: 0
Accepted
time: 210ms
memory: 59648kb
input:
179155 196952470 0 53978238 1 5637809 2 108859701 3 74655197 4 185812190 5 276384152 6 3837863 7 384693034 8 50348245 9 5228527 10 110363599 11 165216917 12 193282250 13 202570146 14 2029684 15 4500737 16 72872901 17 160200707 18 198368639 19 15158821 20 381663410 21 338477816 22 29593790 23 2557789...
output:
87839
result:
ok single line: '87839'
Test #41:
score: 0
Accepted
time: 262ms
memory: 67956kb
input:
199780 996436403 0 992576598 1 997469254 2 999256360 3 999818185 4 999886040 5 999501078 6 995613173 7 998764880 7 955236200 7 994691393 10 992019840 11 999994909 10 999811643 13 998064131 14 996512072 15 996708293 16 999978936 17 990830780 17 949781018 19 990181811 20 999987501 21 997393276 22 9953...
output:
107533
result:
ok single line: '107533'
Test #42:
score: 0
Accepted
time: 237ms
memory: 68008kb
input:
200000 673305342 0 835819526 1 989530768 1 980171650 1 975157380 1 861198623 1 995704672 1 996894423 1 999540151 1 973825721 2 899320609 1 958238501 4 950922966 1 874825804 1 994464699 1 952570856 1 999843027 1 818583542 1 693087780 1 936855344 1 999503417 4 989187107 2 957223858 2 698441538 2 95572...
output:
178726
result:
ok single line: '178726'
Test #43:
score: 0
Accepted
time: 133ms
memory: 45576kb
input:
127752 991079906 0 945790012 1 923797004 2 875427873 1 859156315 1 969226793 1 992159741 1 959640717 3 938388257 1 993085622 1 999310851 2 708379199 1 727754809 1 925349208 6 998031165 1 953841570 2 998009160 3 997333804 1 803069635 1 899674147 4 957441419 3 945021119 5 967133477 2 995135322 3 91984...
output:
114101
result:
ok single line: '114101'
Test #44:
score: 0
Accepted
time: 227ms
memory: 65896kb
input:
199201 324119033 0 320282040 1 13756602 1 251583776 1 279586277 1 194246521 1 116215514 2 134249018 1 108316133 1 270588474 1 25342167 1 42785078 1 763817508 1 42855701 1 177297960 1 45735875 1 105016191 2 26343371 1 182694667 2 1043819 1 40284993 1 32575041 2 220191892 1 59309817 1 667363751 1 7279...
output:
192371
result:
ok single line: '192371'
Test #45:
score: 0
Accepted
time: 138ms
memory: 41516kb
input:
195417 999875895 0 998280052 1 980060421 2 988153026 3 922330312 4 999969896 5 995356032 6 999933627 7 997336369 8 764508908 9 997953584 10 982021443 11 999964276 12 994927224 13 998947529 14 997220276 15 994198186 16 982738378 17 908441322 18 999166832 19 984551633 20 993010800 21 939759543 22 9852...
output:
5216
result:
ok single line: '5216'
Test #46:
score: 0
Accepted
time: 149ms
memory: 43580kb
input:
196772 999129353 0 999022629 1 999851795 2 998278824 3 999481508 4 989621866 5 991780564 6 999507453 7 988701237 8 947145211 9 944668218 10 998562866 11 998796101 12 999560904 13 993424467 14 999969910 15 975753032 16 998676231 17 953350401 18 999086105 19 999935716 20 999107221 21 999396732 22 9982...
output:
5276
result:
ok single line: '5276'
Test #47:
score: 0
Accepted
time: 136ms
memory: 40832kb
input:
191243 999835842 0 999977783 1 1000000000 2 999786989 3 999988649 4 999977530 5 999815524 6 999980984 7 999939800 8 999935163 9 999902923 10 999999986 11 999904034 12 985623356 13 999776093 14 999998671 15 999738678 16 999998595 17 999981015 18 999715865 19 972555076 20 999913916 21 997861059 22 998...
output:
5072
result:
ok single line: '5072'
Test #48:
score: 0
Accepted
time: 132ms
memory: 38328kb
input:
188382 1172 0 76067 1 1359 2 2471 3 4816 4 3917819 5 10669 6 22658 7 9133 8 1335219 9 49487 10 20478 11 355017 12 4652 13 2033 14 13362 15 9 16 12116 17 8933 18 310229 19 4609 20 7 21 344941 22 43115 23 1528 24 96105 25 106676 26 18951 27 82548 28 327792 29 56591 30 17192 31 329 32 58110 33 6134 34 ...
output:
5074
result:
ok single line: '5074'
Test #49:
score: 0
Accepted
time: 139ms
memory: 40828kb
input:
190849 633611 0 86531 1 101253 2 241028 3 10870300 4 6396826 5 493905 6 2642 7 4552817 8 182752 9 89322 10 13488 11 318 12 53439 13 3063135 14 32939 15 498397 16 1571153 17 1945732 18 1068055 19 38 20 426004 21 17017 22 111605 23 1036993 24 5344633 25 11909 26 25835 27 67600 28 18686 29 351433 30 11...
output:
5112
result:
ok single line: '5112'