QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#534718#4927. Bounded Spanning Treeegypt_ioi2024_05#4 499ms68320kbC++201.5kb2024-08-27 15:32:422024-08-27 15:32:42

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 4
Accepted

Test #1:

score: 4
Accepted
time: 499ms
memory: 68320kb

input:

1
500001 500000
254401 281557 349855 349855
181158 183050 7695 7695
168649 393239 182447 182447
275491 426002 407013 407013
412840 430191 81351 81351
180729 474744 468590 468590
167128 233022 352396 352396
56562 410078 411755 411755
28611 28934 27783 27783
250615 303207 495889 495889
348947 377767 2...

output:

YES
349855 7695 182447 407013 81351 468590 352396 411755 27783 495889 279148 126532 371490 46443 75037 440945 17872 376183 227217 256463 268704 93994 142674 221161 313215 423148 348655 110097 61558 138416 182869 460629 101134 233433 485321 293910 161637 31401 388370 43691 103888 258050 186588 285649...

result:

ok all is ok (1 test case)

Test #2:

score: 4
Accepted
time: 420ms
memory: 58612kb

input:

1
300001 500000
146540 236321 23350 23350
110737 197257 49315 49315
87807 244200 2878 2878
27529 179675 90834 90834
39761 204225 209751 209751
175226 239307 945 945
25136 248902 243667 243667
215811 229229 48401 48401
152882 243088 63537 63537
136220 210273 244339 244339
31127 43815 196573 196573
31...

output:

YES
23350 49315 2878 90834 209751 945 243667 48401 63537 244339 196573 170759 346610 33502 342292 86136 71174 153543 40008 300022 342991 305551 95289 63927 127147 133670 78873 57350 134796 242512 238031 153963 69392 220900 21326 171023 3218 211851 322418 63540 88200 109095 157709 6644 136208 86952 2...

result:

ok all is ok (1 test case)

Test #3:

score: 4
Accepted
time: 371ms
memory: 54256kb

input:

1
250001 500000
68287 196901 480106 480106
49342 196901 304518 304518
22416 49342 304522 304522
22416 155670 304523 304523
64466 155670 298516 298516
64466 91061 298511 298511
91061 107764 270019 270019
107764 145633 270023 270023
9967 145633 270022 270022
9967 74786 270020 270020
35298 74786 260981...

output:

YES
480106 304518 304522 304523 298516 298511 270019 270023 270022 270020 260981 260987 260975 260980 260999 260988 260553 260552 260551 255267 255249 255252 255206 255247 255246 255192 255270 255224 255251 255255 255296 255277 255189 255254 255245 255239 255217 255250 255289 255190 255276 255223 25...

result:

ok all is ok (1 test case)

Test #4:

score: 4
Accepted
time: 375ms
memory: 51856kb

input:

1
200001 500000
98193 105041 166701 166701
27762 114229 186133 186133
75089 79073 10507 10507
17865 143051 14801 14801
61475 66112 65966 65966
95929 145141 111474 111474
48331 68416 51667 51667
84658 174834 185681 185681
58072 88891 182212 182212
70612 148690 33041 33041
16155 127708 166666 166666
6...

output:

YES
166701 186133 10507 14801 65966 111474 51667 185681 182212 33041 166666 174410 126973 124348 104 167323 109299 22852 163302 119217 152431 288663 55933 2494 119959 58498 108854 313804 18466 166913 48980 9910 343607 193963 105226 272155 404993 191288 158308 131805 92742 84214 63930 160422 96427 12...

result:

ok all is ok (1 test case)

Test #5:

score: 4
Accepted
time: 328ms
memory: 47256kb

input:

1
100001 500000
27575 40895 44938 44938
3625 19411 38012 38012
3655 84852 11318 11318
1152 91041 28632 28632
221 39962 65491 65491
35918 79361 78583 78583
41888 68339 40937 40937
82334 93242 62129 62129
66333 67583 113798 113798
75883 82560 2019 2019
43643 57947 122462 122462
16229 42734 54831 54831...

output:

YES
44938 38012 11318 28632 65491 78583 40937 62129 113798 2019 122462 54831 63084 16263 70129 58780 69845 51401 33811 865 27448 134237 60986 98507 57992 123479 8086 75165 12759 68854 23507 138812 87299 48771 33602 41920 53104 17098 132939 44566 25731 172500 15616 100033 9986 83815 20839 27119 1501 ...

result:

ok all is ok (1 test case)

Test #6:

score: 4
Accepted
time: 202ms
memory: 10164kb

input:

100
2501 4850
1396 1781 772 772
1019 1580 1529 1529
1146 2063 2944 2944
1883 1912 158 158
443 1995 1378 1378
450 871 504 504
1737 2297 2571 2571
447 1804 3367 3367
1159 1917 1789 1789
1478 2444 2775 2775
1783 2412 479 479
2245 2412 2839 2839
73 1403 4729 4729
747 2463 1469 1469
1107 2377 2034 2034
1...

output:

YES
772 1529 2944 158 1378 504 2571 3367 1789 2775 479 2839 4729 1469 2034 2085 1526 747 1638 1356 2158 979 1042 290 919 1304 1555 430 1380 301 1100 2407 900 4497 1318 958 878 432 667 594 1152 763 552 642 3625 463 2885 2992 1630 851 4742 893 2265 1999 83 348 2176 212 3311 629 3246 1360 2114 186 1457...

result:

ok all is ok (100 test cases)

Test #7:

score: 4
Accepted
time: 174ms
memory: 9812kb

input:

1000
251 483
203 224 371 371
75 104 172 172
147 218 64 64
65 94 6 6
123 131 122 122
17 238 119 119
59 151 27 27
157 239 133 133
67 246 225 225
169 220 138 138
63 212 103 103
2 9 33 33
55 201 191 191
103 181 91 91
12 134 62 62
124 227 315 315
106 243 4 4
158 246 49 49
62 142 202 202
2 139 178 178
133...

output:

YES
371 172 64 6 122 119 27 133 225 138 103 33 191 91 62 315 4 49 202 178 199 182 139 234 284 201 75 156 28 101 143 290 129 233 286 44 160 231 208 25 90 73 104 461 15 56 287 429 83 106 45 115 128 194 17 311 24 71 95 70 50 92 67 111 65 358 80 99 282 382 66 167 147 21 52 125 43 195 48 162 57 170 326 2...

result:

ok all is ok (1000 test cases)

Test #8:

score: 4
Accepted
time: 145ms
memory: 9796kb

input:

10000
26 52
6 26 13 13
8 22 23 23
1 4 8 8
12 26 19 19
2 25 6 6
4 23 3 3
7 11 9 9
8 16 5 5
7 20 7 7
2 5 29 29
12 15 1 1
10 21 10 10
4 16 21 21
4 24 2 2
7 25 30 30
14 15 24 24
17 22 22 22
6 13 18 18
18 24 14 14
15 24 12 12
9 24 43 43
3 20 49 49
7 15 4 4
19 20 11 11
10 18 16 16
21 24 20 20
13 20 45 45
...

output:

YES
13 23 8 19 6 3 9 5 7 29 1 10 21 2 30 24 22 18 14 12 43 49 4 11 16 20 45 46 44 38 39 27 48 35 32 33 42 25 31 36 47 41 15 34 17 51 37 40 50 28 52 26 
YES
21 28 10 1 16 12 3 40 2 32 6 26 18 9 8 4 22 17 23 5 14 11 7 15 13 19 36 45 30 43 34 33 38 29 42 27 35 24 41 37 44 25 31 39 20 
YES
22 8 14 6 38 ...

result:

ok all is ok (10000 test cases)

Test #9:

score: 4
Accepted
time: 120ms
memory: 9720kb

input:

50000
6 12
3 6 8 8
2 6 4 4
3 4 7 7
1 2 1 1
1 5 2 2
2 5 3 3
3 4 12 12
2 6 6 6
1 4 9 9
2 6 5 5
2 5 11 11
4 6 10 10
6 12
3 5 2 2
2 4 3 3
3 4 1 1
4 6 4 4
1 2 5 5
4 5 8 8
2 4 11 11
3 6 12 12
3 5 10 10
2 5 6 6
1 4 9 9
2 4 7 7
6 7
2 3 1 1
3 4 3 3
1 4 2 2
2 5 6 6
3 6 5 5
5 6 7 7
1 2 4 4
6 10
3 5 4 4
1 4 3 3...

output:

YES
8 4 7 1 2 3 12 6 9 5 11 10 
YES
2 3 1 4 5 8 11 12 10 6 9 7 
YES
1 3 2 6 5 7 4 
YES
4 3 5 1 2 7 6 9 8 10 
YES
2 4 5 3 1 10 6 9 11 7 8 
YES
2 6 5 4 1 8 7 10 3 9 
YES
1 6 3 5 2 7 10 12 9 8 4 11 
YES
3 1 10 4 2 7 9 5 11 8 12 6 
YES
5 4 2 8 1 10 7 9 3 11 6 
YES
2 1 5 3 6 4 7 
YES
2 7 1 5 3 8 4 6 
NO
...

result:

ok all is ok (50000 test cases)

Test #10:

score: 4
Accepted
time: 374ms
memory: 56304kb

input:

1
250001 500000
58145 72387 235237 235237
58145 124192 125607 125607
61444 72387 20858 20858
58145 210560 75907 75907
15080 61444 417136 417136
58145 144891 443143 443143
61444 113315 217104 217104
113315 219614 495886 495886
31702 210560 453336 453336
72387 147061 299803 299803
72387 234856 355629 ...

output:

NO

result:

ok all is ok (1 test case)

Test #11:

score: 4
Accepted
time: 1ms
memory: 10012kb

input:

1
3 4
1 2 1 1
2 3 2 2
1 3 4 4
1 3 4 4

output:

NO

result:

ok all is ok (1 test case)

Test #12:

score: 4
Accepted
time: 440ms
memory: 60940kb

input:

1
350001 500000
51970 181661 167074 167074
51970 326555 193867 193867
181661 197260 75401 75401
181661 229687 137191 137191
147797 326555 47018 47018
326555 336123 115700 115700
178220 197260 115089 115089
177064 197260 127762 127762
229687 286501 113990 113990
118842 229687 25034 25034
85794 147797...

output:

YES
167074 193867 75401 137191 47018 115700 115089 127762 113990 25034 173325 57068 115719 140380 141783 1164 68154 113245 51496 114298 74156 98738 32453 179503 5043 72618 117146 17085 114789 62367 79201 175046 113082 38555 6883 160158 137354 89534 102294 84811 112280 144778 53617 55541 80021 131091...

result:

ok all is ok (1 test case)

Test #13:

score: 4
Accepted
time: 440ms
memory: 61052kb

input:

1
350001 500000
1 2 91619 91619
1 3 97604 97604
2 4 107881 107881
2 5 105480 105480
3 6 43453 43453
3 7 96271 96271
4 8 182260 182260
4 9 133967 133967
5 10 70321 70321
5 11 17915 17915
6 12 37981 37981
6 13 153439 153439
7 14 100312 100312
7 15 190436 190436
8 16 27817 27817
8 17 124568 124568
9 18...

output:

YES
91619 97604 107881 105480 43453 96271 182260 133967 70321 17915 37981 153439 100312 190436 27817 124568 58307 123433 138047 186140 80734 119093 57462 38052 41558 25990 109748 53006 88030 115853 29102 55929 190897 53226 154772 68399 176247 43649 162208 193175 167849 59192 67049 132375 71215 14642...

result:

ok all is ok (1 test case)

Test #14:

score: 4
Accepted
time: 408ms
memory: 54252kb

input:

1
250001 500000
55167 234232 55638 55638
3684 234232 68427 68427
55167 55500 57038 57038
55167 104654 71138 71138
3684 97251 86152 86152
3684 51545 57935 57935
55500 187343 17112 17112
17560 55500 26990 26990
104654 207657 94625 94625
5109 104654 39135 39135
32358 97251 60733 60733
24234 97251 83100...

output:

YES
55638 68427 57038 71138 86152 57935 17112 26990 94625 39135 60733 83100 89950 80785 49587 25806 51060 1477 66287 82731 24961 93687 61061 65681 55974 37373 46924 37873 46135 93431 72032 91960 40585 33082 66193 49669 4930 11237 43217 57226 64344 26400 81344 49776 95307 335 29041 56487 78400 46678 ...

result:

ok all is ok (1 test case)

Test #15:

score: 4
Accepted
time: 403ms
memory: 56304kb

input:

1
250001 500000
1 2 94951 94951
1 3 117117 117117
2 4 23480 23480
2 5 33084 33084
3 6 93826 93826
3 7 78212 78212
4 8 34019 34019
4 9 18988 18988
5 10 18835 18835
5 11 79631 79631
6 12 64796 64796
6 13 85774 85774
7 14 19026 19026
7 15 96932 96932
8 16 114480 114480
8 17 90135 90135
9 18 116267 1162...

output:

YES
94951 117117 23480 33084 93826 78212 34019 18988 18835 79631 64796 85774 19026 96932 114480 90135 116267 117794 21150 57905 122132 43553 2465 113385 4839 20753 77276 59088 12016 58544 82267 27230 37192 95528 33142 102861 5463 52787 26363 64907 76455 25780 17549 8290 33840 33909 62173 119910 1147...

result:

ok all is ok (1 test case)

Test #16:

score: 4
Accepted
time: 335ms
memory: 49556kb

input:

1
150001 500000
33562 137263 4731 4731
3140 33562 51401 51401
123261 137263 13746 13746
127268 137263 47614 47614
3140 112499 25919 25919
3140 123022 40262 40262
118183 123261 41486 41486
59636 123261 44743 44743
56726 127268 41422 41422
9584 127268 1382 1382
2765 112499 29621 29621
102477 112499 32...

output:

YES
4731 51401 13746 47614 25919 40262 41486 44743 41422 1382 29621 32059 26038 41052 35788 57790 39066 10908 26717 15676 13120 26818 53095 11623 35576 22385 36743 48593 50832 7489 43311 2469 16826 32832 16329 42185 31352 45205 36247 11975 37630 47545 40573 44458 17185 56813 12443 50754 17613 4489 5...

result:

ok all is ok (1 test case)

Test #17:

score: 4
Accepted
time: 352ms
memory: 49828kb

input:

1
150001 500000
1 2 9865 9865
1 3 50922 50922
2 4 72636 72636
2 5 5342 5342
3 6 68517 68517
3 7 2682 2682
4 8 16233 16233
4 9 23462 23462
5 10 42691 42691
5 11 63709 63709
6 12 49292 49292
6 13 47024 47024
7 14 15678 15678
7 15 29782 29782
8 16 26150 26150
8 17 24947 24947
9 18 31097 31097
9 19 3616...

output:

YES
9865 50922 72636 5342 68517 2682 16233 23462 42691 63709 49292 47024 15678 29782 26150 24947 31097 36162 58970 15209 20815 39494 42015 20539 30622 17608 4149 26738 6917 24820 38438 44236 58408 61349 54552 54008 19297 55622 24871 21553 73059 68664 45106 7196 36073 72990 46145 18832 40855 25322 44...

result:

ok all is ok (1 test case)

Test #18:

score: 4
Accepted
time: 318ms
memory: 49272kb

input:

1
100001 500000
32137 73071 8126 8126
30836 32137 8678 8678
33499 73071 28319 28319
54215 73071 10859 10859
13497 30836 14357 14357
20308 30836 20193 20193
33499 64930 32136 32136
33499 72955 10467 10467
4952 54215 13756 13756
54215 78914 7496 7496
13497 87217 18638 18638
13497 32815 12785 12785
203...

output:

YES
8126 8678 28319 10859 14357 20193 32136 10467 13756 7496 18638 12785 33440 30465 20187 38022 18080 35068 23543 32162 24620 13544 21454 32848 27770 1018 6270 26133 3075 7242 25247 32332 11951 28208 291 38575 25325 22264 19792 19256 20532 28167 35356 8949 16733 17298 25951 14904 12881 1026 8766 13...

result:

ok all is ok (1 test case)

Test #19:

score: 4
Accepted
time: 355ms
memory: 49308kb

input:

1
100001 500000
1 2 47454 47454
1 3 24116 24116
2 4 5212 5212
2 5 34333 34333
3 6 37903 37903
3 7 24157 24157
4 8 7647 7647
4 9 46362 46362
5 10 39307 39307
5 11 417 417
6 12 11637 11637
6 13 7943 7943
7 14 31697 31697
7 15 25556 25556
8 16 26719 26719
8 17 2858 2858
9 18 38629 38629
9 19 15877 1587...

output:

YES
47454 24116 5212 34333 37903 24157 7647 46362 39307 417 11637 7943 31697 25556 26719 2858 38629 15877 9949 2664 11319 38601 3830 28522 35313 47973 36161 33118 36164 32490 10857 777 1309 33735 18396 3663 40300 22986 1204 23229 25140 11139 5272 12659 6822 23629 24396 27547 49065 22096 2187 13626 3...

result:

ok all is ok (1 test case)

Test #20:

score: 4
Accepted
time: 322ms
memory: 47024kb

input:

1
50001 500000
11097 17004 6702 6702
11097 46242 6571 6571
9283 17004 14181 14181
17004 49249 3806 3806
16332 46242 12037 12037
23662 46242 620 620
9283 10658 16283 16283
9283 26166 4973 4973
12663 49249 9227 9227
39719 49249 14946 14946
6988 16332 7002 7002
16332 17234 8382 8382
21939 23662 6435 64...

output:

YES
6702 6571 14181 3806 12037 620 16283 4973 9227 14946 7002 8382 6435 8918 17999 2391 14264 14326 2400 19351 12275 3267 6860 2683 12585 3536 7244 17401 3138 19139 10062 18804 1804 17830 1334 9404 13005 13291 5769 2385 12046 9699 2957 11928 4790 2415 2254 8634 17482 11871 16931 2023 11959 11719 854...

result:

ok all is ok (1 test case)

Test #21:

score: 4
Accepted
time: 320ms
memory: 44876kb

input:

1
50001 500000
1 2 9300 9300
1 3 18013 18013
2 4 199 199
2 5 5439 5439
3 6 3410 3410
3 7 12409 12409
4 8 23362 23362
4 9 3502 3502
5 10 2909 2909
5 11 15885 15885
6 12 7701 7701
6 13 12244 12244
7 14 15582 15582
7 15 1562 1562
8 16 23437 23437
8 17 1520 1520
9 18 7605 7605
9 19 13720 13720
10 20 163...

output:

YES
9300 18013 199 5439 3410 12409 23362 3502 2909 15885 7701 12244 15582 1562 23437 1520 7605 13720 16361 605 17871 19668 13644 6113 23475 7978 9645 20419 21421 13609 4107 10853 838 20375 9212 6717 24799 7554 21582 4914 3456 20389 8124 4843 2321 8741 5613 18728 15007 16075 3688 13565 14034 3848 204...

result:

ok all is ok (1 test case)

Subtask #2:

score: 0
Wrong Answer

Test #22:

score: 0
Wrong Answer
time: 0ms
memory: 9780kb

input:

1
7 10
1 5 1 3
3 6 8 10
4 6 5 6
1 7 1 2
3 5 1 1
2 4 6 6
1 7 10 10
6 7 8 10
1 7 6 8
3 5 1 4

output:

NO

result:

wrong answer jury found the answer but participant didn't (test case 1)

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Wrong Answer

Test #45:

score: 0
Wrong Answer
time: 1ms
memory: 9724kb

input:

1
501 500
127 170 433 434
26 98 284 285
179 379 82 82
136 270 253 254
100 391 474 476
175 393 170 171
247 311 223 225
32 318 270 270
87 434 294 294
335 417 308 310
249 356 292 294
327 331 42 44
325 498 334 336
73 133 260 262
276 394 493 495
74 289 330 331
29 83 244 245
7 486 482 483
115 368 90 90
22...

output:

NO

result:

wrong answer jury found the answer but participant didn't (test case 1)

Subtask #5:

score: 0
Skipped

Dependency #4:

0%

Subtask #6:

score: 0
Wrong Answer

Test #93:

score: 0
Wrong Answer
time: 99ms
memory: 9788kb

input:

1000
500 500
100 331 2 8
162 182 272 276
133 415 393 397
144 176 499 500
64 273 47 55
37 463 424 428
96 481 127 127
115 341 333 336
79 95 246 248
266 473 473 476
117 140 113 120
112 309 323 330
251 438 39 45
22 339 275 285
83 474 264 266
185 212 282 291
377 425 25 31
42 436 351 357
35 69 173 182
159...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

wrong answer jury found the answer but participant didn't (test case 1000)

Subtask #7:

score: 0
Skipped

Dependency #3:

0%

Subtask #8:

score: 0
Wrong Answer

Test #143:

score: 0
Wrong Answer
time: 103ms
memory: 9736kb

input:

1000
251 500
1 2 280 287
2 3 251 256
3 4 249 249
4 5 252 253
5 6 252 256
6 7 250 250
7 8 254 261
8 9 245 256
9 10 123 127
10 11 45 49
11 12 122 128
12 13 164 167
13 14 153 156
14 15 210 217
15 16 53 64
16 17 205 208
17 18 136 149
18 19 132 135
19 20 24 27
20 21 45 51
21 22 21 30
22 23 5 7
23 24 178 ...

output:

NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
...

result:

wrong answer jury found the answer but participant didn't (test case 1000)

Subtask #9:

score: 0
Skipped

Dependency #7:

0%

Subtask #10:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%