QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#68586#5208. Jumbled TreeslarryzhongTL 2897ms166972kbC++172.8kb2022-12-17 13:56:442022-12-17 13:56:46

详细

Test #1:

score: 100
Accepted
time: 275ms
memory: 94492kb

input:

3 3 101
1 2 30
2 3 40
3 1 50

output:

6
20 1 3
10 1 2
0 1 3
0 1 3
0 1 3
30 2 3

result:

ok Participant found an answer (6 trees) and jury found an answer (5 trees)

Test #2:

score: 0
Accepted
time: 262ms
memory: 166972kb

input:

2 2 37
1 2 8
1 2 15

output:

4
8 1
15 2
0 1
0 1

result:

ok Participant found an answer (4 trees) and jury found an answer (3 trees)

Test #3:

score: 0
Accepted
time: 261ms
memory: 85052kb

input:

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

output:

-1

result:

ok Both jury and participant did not find an answer

Test #4:

score: 0
Accepted
time: 184ms
memory: 27876kb

input:

10 15 997
4 3 459
9 7 94
9 8 767
10 2 877
5 8 258
3 4 166
8 5 621
8 10 619
9 1 316
10 5 516
3 10 125
1 7 961
3 6 500
4 10 976
3 4 842

output:

-1

result:

ok Both jury and participant did not find an answer

Test #5:

score: 0
Accepted
time: 198ms
memory: 22652kb

input:

20 30 9973
1 10 696
3 8 2905
12 7 6609
20 10 1962
11 9 8430
19 2 412
6 3 6936
19 7 9113
14 15 5635
15 7 1770
13 10 3182
3 16 2625
17 1 7387
11 5 3700
9 15 1048
2 3 7717
12 10 8625
7 13 8141
5 14 2245
6 4 2819
18 19 8709
18 5 6191
17 10 7606
9 20 8626
17 4 8848
4 13 1073
10 8 2277
14 2 7714
11 8 5318...

output:

35
4885 1 2 3 7 8 10 11 12 13 14 15 16 17 19 22 24 26 27 29
6187 2 4 5 7 8 10 12 13 16 17 18 20 21 23 24 25 26 28 30
6792 2 3 4 6 7 8 9 11 13 14 15 18 19 20 21 23 26 28 30
4789 1 3 4 5 6 8 9 13 14 16 17 18 19 20 21 25 27 28 30
269 1 2 3 4 6 8 9 11 12 14 15 17 19 20 21 23 26 27 30
731 2 3 4 5 6 9 10 ...

result:

ok Participant found an answer (35 trees) and jury found an answer (59 trees)

Test #6:

score: 0
Accepted
time: 206ms
memory: 17280kb

input:

50 80 99991
6 5 67664
39 4 74944
11 9 13035
13 48 81979
40 20 57943
20 31 72081
1 6 39307
48 39 3550
28 48 41071
18 28 42935
37 32 7538
37 29 3815
50 37 88043
38 41 7283
40 26 66278
37 34 60696
47 19 80875
4 26 67
20 32 91858
39 24 83485
45 25 12241
48 46 61691
37 44 47541
39 40 70034
37 42 25006
27...

output:

-1

result:

ok Both jury and participant did not find an answer

Test #7:

score: 0
Accepted
time: 234ms
memory: 17956kb

input:

100 150 999983
84 10 999545
69 48 930138
48 13 303468
36 6 668122
91 84 115623
62 71 59711
12 37 749281
86 49 281976
26 46 624831
91 8 450475
92 55 460900
50 63 513056
72 2 477622
26 96 11359
31 82 953946
6 71 406339
24 7 177090
70 4 67359
31 39 795565
47 32 407459
26 35 760698
22 37 508175
8 93 612...

output:

-1

result:

ok Both jury and participant did not find an answer

Test #8:

score: 0
Accepted
time: 266ms
memory: 19780kb

input:

200 250 9999991
170 185 3242943
70 17 6083198
137 55 4000889
15 171 1113989
108 65 7988488
192 37 8812990
53 143 8707264
80 180 2504807
55 163 2706048
67 64 6210980
87 165 7693967
155 122 8550804
56 99 7228534
114 138 7047731
190 196 6684929
86 197 8866886
38 195 6717874
112 133 7257617
160 104 3210...

output:

-1

result:

ok Both jury and participant did not find an answer

Test #9:

score: 0
Accepted
time: 564ms
memory: 19888kb

input:

500 600 99999989
265 416 47066772
354 266 16969437
195 415 7917612
354 136 43128175
163 191 58723996
144 84 65835385
157 45 94124747
232 441 17509499
70 397 64101208
223 387 7043647
320 47 84970673
100 2 87310855
87 131 75042257
101 391 27645446
79 26 68547739
390 185 92142961
257 15 80922292
276 48...

output:

-1

result:

ok Both jury and participant did not find an answer

Test #10:

score: 0
Accepted
time: 980ms
memory: 17476kb

input:

500 700 99999989
250 2 71289880
454 447 70661327
328 253 57519343
11 201 67456781
294 99 23392419
215 322 61059212
411 389 69899684
488 429 89579827
437 79 60564061
413 380 34922641
477 372 14858185
156 44 3101349
88 8 52225146
115 26 8582010
171 237 33206748
237 495 31192017
146 32 62712576
209 352...

output:

-1

result:

ok Both jury and participant did not find an answer

Test #11:

score: 0
Accepted
time: 1414ms
memory: 15760kb

input:

500 800 99999989
258 304 1237432
159 152 6684056
8 47 64155938
436 265 83092505
204 302 3892712
142 302 77925167
37 15 20298972
202 395 35856655
284 260 96812598
365 172 48834835
196 101 64871741
174 45 37729972
302 206 90932677
305 275 27712443
443 157 81820535
16 248 22708463
461 479 64749118
105 ...

output:

-1

result:

ok Both jury and participant did not find an answer

Test #12:

score: 0
Accepted
time: 2056ms
memory: 14144kb

input:

500 900 99999989
122 188 44796717
73 121 56798468
334 358 95823235
485 453 96779071
209 391 45946094
332 168 91056077
481 483 81268636
148 393 25213027
107 214 99281713
493 46 61525618
472 355 74320568
258 482 99615552
159 393 20311839
411 121 5207095
20 131 65269699
45 339 51772607
195 292 64556504...

output:

-1

result:

ok Both jury and participant did not find an answer

Test #13:

score: 0
Accepted
time: 2769ms
memory: 13120kb

input:

500 1000 99999989
75 20 25003980
292 19 89418683
353 246 74910681
183 201 97535184
254 421 50614221
15 396 86624029
82 13 67776336
86 70 62843451
279 3 55801636
29 425 30024776
176 243 16631048
498 363 77415492
55 305 80862521
213 110 30693079
432 358 99667002
201 30 44433122
97 203 16284993
118 490...

output:

-1

result:

ok Both jury and participant did not find an answer

Test #14:

score: 0
Accepted
time: 291ms
memory: 23044kb

input:

500 499 999999937
287 228 350409600
392 107 350409600
458 22 350409600
362 425 350409600
368 136 350409600
364 71 350409600
211 265 350409600
167 116 350409600
195 353 350409600
489 477 350409600
380 85 350409600
281 15 350409600
263 247 350409600
453 122 350409600
104 187 350409600
331 223 35040960...

output:

504
350409600 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...

result:

ok Participant found an answer (504 trees) and jury found an answer (1 trees)

Test #15:

score: 0
Accepted
time: 328ms
memory: 22832kb

input:

500 510 999999937
417 280 770450784
207 303 770450784
472 396 770450784
345 191 964169440
164 67 770450784
492 302 770450784
5 71 770450784
386 22 770450784
77 25 487491058
430 467 770450784
148 95 770450784
288 215 770450784
55 451 10190666
215 69 770450784
267 195 770450784
487 283 770450784
435 3...

output:

515
278349448 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26 27 28 29 30 31 32 33 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 92 93 94 95 96 97 98 99 100 101...

result:

ok Participant found an answer (515 trees) and jury found an answer (257 trees)

Test #16:

score: 0
Accepted
time: 371ms
memory: 22292kb

input:

500 525 999999937
439 54 982774700
417 443 87702331
21 82 982774700
39 477 982774700
363 493 982774700
500 161 982774700
86 44 982774700
312 47 982774700
120 282 982774700
224 254 670954686
268 311 59221562
216 242 982774700
16 256 505585800
448 102 982774700
362 295 555877345
76 210 819076841
53 24...

output:

530
205725266 1 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 1...

result:

ok Participant found an answer (530 trees) and jury found an answer (395 trees)

Test #17:

score: 0
Accepted
time: 454ms
memory: 21208kb

input:

500 550 999999937
478 408 544946602
494 234 544946602
118 11 544946602
497 38 435997116
193 371 493919798
252 238 826125135
69 229 683109191
300 159 544946602
328 102 302951499
37 227 568031903
347 13 544946602
111 375 624947749
291 447 544946602
5 140 544946602
250 41 544946602
387 202 544946602
38...

output:

555
318103544 1 2 3 4 5 6 7 8 10 11 12 13 14 15 16 19 20 21 22 24 25 26 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 58 59 60 61 62 64 66 67 68 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 101 102 104 105 106 107 108 109 1...

result:

ok Participant found an answer (555 trees) and jury found an answer (617 trees)

Test #18:

score: 0
Accepted
time: 572ms
memory: 19888kb

input:

500 600 999999937
265 416 960325147
354 266 501849515
195 415 308033318
354 136 658703469
163 191 792878874
144 84 388345161
157 45 308033318
232 441 175503107
70 397 520297316
223 387 650583946
320 47 790017725
100 2 477058566
87 131 953737746
101 391 308033318
79 26 941025744
390 185 519333525
257...

output:

605
652740814 3 5 7 8 9 10 11 12 13 14 16 18 19 20 21 22 24 25 27 28 30 31 32 33 34 36 37 38 39 40 41 42 43 45 46 47 48 49 51 54 55 56 57 58 59 60 61 62 63 64 67 68 69 70 71 72 73 74 75 76 77 78 79 81 82 83 84 86 87 88 89 91 92 94 96 97 98 99 100 101 102 103 104 105 106 107 109 110 111 112 113 114 1...

result:

ok Participant found an answer (605 trees) and jury found an answer (811 trees)

Test #19:

score: 0
Accepted
time: 303ms
memory: 23044kb

input:

500 500 999999937
56 278 340955979
53 151 340955979
482 317 340955979
4 138 340955979
454 135 340955979
482 361 340955979
85 89 340955979
436 201 340955979
450 483 340955979
274 258 340955979
13 318 340955979
87 227 340955979
141 114 340955979
284 340 340955979
377 48 340955979
110 134 340955979
271...

output:

505
569853141 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...

result:

ok Participant found an answer (505 trees) and jury found an answer (25 trees)

Test #20:

score: 0
Accepted
time: 1008ms
memory: 17308kb

input:

500 700 999999937
250 2 231570738
454 447 348559779
328 253 557290971
11 201 742990307
294 99 355194759
215 322 346919021
411 389 223497390
488 429 924302863
437 79 634119443
413 380 194151871
477 372 634119443
156 44 723189726
88 8 656811915
115 26 494639245
171 237 579262439
237 495 225519328
146 ...

output:

705
900957083 1 3 4 5 7 8 9 11 12 13 15 17 18 20 21 22 25 26 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 49 51 53 54 55 56 57 59 61 63 66 67 68 69 70 71 73 74 75 76 77 78 79 82 83 85 86 87 88 90 91 92 93 94 96 97 101 102 103 107 108 109 110 112 113 114 115 116 117 120 121 122 123 124 12...

result:

ok Participant found an answer (705 trees) and jury found an answer (1213 trees)

Test #21:

score: 0
Accepted
time: 1464ms
memory: 15740kb

input:

500 800 999999937
258 304 583150933
159 152 864655622
8 47 904254153
436 265 649209189
204 302 999927615
142 302 437142821
37 15 886997658
202 395 176364113
284 260 352132138
365 172 621577977
196 101 999803609
174 45 669960837
302 206 85008264
305 275 142531904
443 157 652057600
16 248 693746068
46...

output:

805
59575061 1 2 3 4 5 6 7 8 11 15 18 19 20 23 24 26 28 29 30 31 34 35 36 37 38 41 44 45 46 47 48 50 51 53 54 55 56 57 58 62 64 65 66 69 70 71 72 74 75 76 77 78 83 84 85 88 90 91 92 93 94 95 97 99 102 105 107 108 111 112 113 114 115 117 118 119 120 121 123 127 128 130 131 132 133 136 138 139 140 141...

result:

ok Participant found an answer (805 trees) and jury found an answer (1441 trees)

Test #22:

score: 0
Accepted
time: 2119ms
memory: 14212kb

input:

500 900 999999937
122 188 437691348
73 121 296323029
334 358 25382116
485 453 71271129
209 391 955537437
332 168 58669489
481 483 584529141
148 393 88230539
107 214 706736962
493 46 995301637
472 355 754703158
258 482 416475555
159 393 775800573
411 121 458973126
20 131 939950122
45 339 247694299
19...

output:

905
425681053 1 3 5 7 9 12 13 15 18 20 21 23 24 25 26 28 31 32 33 34 35 37 39 41 42 43 44 45 46 49 51 52 54 55 56 59 61 62 63 64 67 68 70 72 73 74 75 79 80 83 84 85 88 90 93 95 96 97 98 103 104 105 109 111 113 115 117 119 122 124 128 129 130 131 133 136 137 139 140 141 142 147 149 150 152 153 154 15...

result:

ok Participant found an answer (905 trees) and jury found an answer (1701 trees)

Test #23:

score: 0
Accepted
time: 2814ms
memory: 13136kb

input:

500 1000 999999937
75 20 857550680
292 19 110166270
353 246 190797204
183 201 150954990
254 421 374099649
15 396 837014574
82 13 802431102
86 70 422727121
279 3 985425226
29 425 742626961
176 243 571825134
498 363 619955816
55 305 797984505
213 110 284175102
432 358 702809990
201 30 28699854
97 203 ...

output:

1005
868647785 2 3 5 7 8 9 10 11 12 13 15 16 18 19 20 29 30 36 40 41 42 43 44 45 46 48 49 50 51 52 55 57 59 62 64 67 72 73 77 80 81 82 84 88 91 92 94 96 97 98 99 100 102 104 105 108 110 111 112 114 116 117 118 120 123 125 127 133 134 137 138 140 141 142 144 146 148 150 152 154 157 158 160 162 163 16...

result:

ok Participant found an answer (1005 trees) and jury found an answer (1945 trees)

Test #24:

score: 0
Accepted
time: 79ms
memory: 7288kb

input:

2 1000 999999937
1 2 411133720
1 2 776367809
1 2 801503481
2 1 289867740
2 1 639986495
2 1 555099841
2 1 689485994
1 2 108816472
2 1 877082404
1 2 123678957
2 1 880363745
1 2 770025482
1 2 593440355
2 1 899935259
1 2 157609551
2 1 373761515
2 1 2889558
2 1 629415436
1 2 684947844
1 2 485414377
2 1 4...

output:

1005
411133720 1
776367809 2
801503481 3
289867740 4
639986495 5
555099841 6
689485994 7
108816472 8
877082404 9
123678957 10
880363745 11
770025482 12
593440355 13
899935259 14
157609551 15
373761515 16
2889558 17
629415436 18
684947844 19
485414377 20
481429456 21
849296698 22
288584751 23
9331766...

result:

ok Participant found an answer (1005 trees) and jury found an answer (1999 trees)

Test #25:

score: 0
Accepted
time: 1116ms
memory: 7284kb

input:

10 1000 999999937
3 6 178912852
10 3 875510731
6 7 212989905
7 5 974004463
1 10 620941502
7 5 600081434
9 1 394370115
1 3 776909504
5 1 370501286
6 8 726447186
10 5 267613208
2 9 467291795
9 2 938683115
5 4 729586694
2 7 214781199
6 5 414875992
9 6 60215552
3 6 901637793
7 9 907537612
7 8 42123063
1...

output:

1005
881744526 117 173 295 348 510 519 797 967 978
901714143 1 103 164 608 618 680 774 820 949
960604664 30 139 140 262 353 538 557 807 970
643359894 148 212 286 301 597 642 659 879 952
928918845 175 209 231 313 589 596 603 894 951
493166248 135 143 381 505 525 589 813 872 996
928114642 97 129 168 2...

result:

ok Participant found an answer (1005 trees) and jury found an answer (1999 trees)

Test #26:

score: 0
Accepted
time: 2613ms
memory: 7744kb

input:

100 1000 999999937
27 22 577129898
47 76 383040531
44 49 252504590
66 46 764432363
75 76 827756718
80 35 275529478
95 9 886404040
55 97 184978304
11 72 641255171
65 95 394679645
37 8 171252921
35 39 277250820
62 10 745905336
97 76 208239094
16 34 460397322
74 28 465442229
89 95 979433574
70 86 67725...

output:

1005
307816970 21 31 34 40 45 50 52 64 70 93 96 143 163 167 174 185 194 202 207 208 209 213 214 217 218 224 230 231 266 269 273 280 284 288 290 292 311 334 343 362 377 379 387 429 440 443 449 457 487 495 508 548 553 588 590 594 604 619 622 647 665 675 683 684 686 698 699 710 713 724 726 730 742 752 ...

result:

ok Participant found an answer (1005 trees) and jury found an answer (1999 trees)

Test #27:

score: 0
Accepted
time: 2897ms
memory: 13248kb

input:

498 1000 999999937
487 73 269543467
331 211 379519784
495 422 686973047
284 16 204129347
254 399 260794796
422 126 211993357
166 429 802536094
351 315 235479275
49 324 904476025
55 15 317387996
440 330 833475395
398 483 245510540
283 270 881075381
392 210 101464008
462 186 116907647
183 33 19696935
...

output:

1005
781594573 1 3 5 8 10 11 12 13 15 16 17 18 20 21 22 29 30 32 36 38 42 43 48 49 55 56 59 61 64 66 71 72 73 80 81 84 85 86 88 91 94 96 99 101 102 103 104 105 106 108 109 110 118 120 124 125 128 129 130 135 138 141 143 144 145 148 150 153 155 156 158 160 165 166 167 168 171 175 179 180 182 183 185 ...

result:

ok Participant found an answer (1005 trees) and jury found an answer (1999 trees)

Test #28:

score: -100
Time Limit Exceeded

input:

499 1000 999999937
144 284 46025639
242 260 240568220
449 203 912275568
260 4 382100531
96 298 24757210
255 315 720292625
111 97 124002714
227 444 550413391
331 282 363023595
201 44 757190858
498 460 378149715
387 63 989403521
195 296 477597041
210 146 858766928
499 87 408290897
313 395 347050751
14...

output:

1005
563971446 2 5 12 13 14 16 18 19 20 21 22 23 24 25 27 28 29 33 35 38 39 46 47 50 51 54 55 56 58 62 69 71 75 76 78 79 80 82 83 87 88 93 94 97 99 104 108 112 113 114 116 117 118 120 127 128 131 134 135 137 138 145 148 149 150 151 152 155 156 158 159 161 162 165 168 169 170 171 173 174 175 179 181 ...

result: