QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#68957#31. Railwaywinmain23 229ms6432kbC++142.2kb2022-12-22 07:23:082022-12-22 07:23:11

详细

Subtask #1:

score: 8
Accepted

Test #1:

score: 8
Accepted
time: 3ms
memory: 3300kb

input:

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

output:

6
1 4 6 7 8 9 

result:

ok 2 lines

Test #2:

score: 0
Accepted
time: 7ms
memory: 4144kb

input:

10000 200 20
1 2
1 3
1 4
1 6
1 228
1 1392
1 1486
1 5068
1 6341
1 6847
2 8
2 10
2 23
2 25
2 34
2 56
2 103
2 341
2 1574
2 5024
2 9238
3 5
3 59
3 89
3 572
3 1539
4 12
4 183
4 2192
4 3944
4 8883
5 7
5 16
5 18
5 40
5 73
5 126
5 414
6 9
6 14
6 15
6 17
6 88
6 2577
7 45
7 63
7 68
7 292
7 484
7 1249
7 1522
7...

output:

76
1 2 4 11 12 14 15 22 32 33 34 39 45 56 62 63 74 81 103 117 122 132 139 156 161 213 228 234 263 267 273 291 307 323 375 472 567 663 688 733 936 1036 1125 1378 1635 1903 2124 2193 2363 3317 3318 3496 3539 3540 4231 4232 5044 5049 5524 5564 5749 5885 5886 6118 6157 6158 6775 7241 7242 7835 8416 8417...

result:

ok 2 lines

Test #3:

score: 0
Accepted
time: 7ms
memory: 4104kb

input:

10000 200 55
1 2
1 4
1 14
1 58
1 366
2 3
2 7
2 40
2 166
2 201
2 399
2 1327
2 5058
3 6
3 11
3 16
3 25
3 34
3 104
3 156
3 1735
4 5
4 10
4 27
4 68
4 72
4 80
4 506
4 954
4 1802
4 3857
4 8289
5 35
5 555
5 1231
5 2177
5 4045
5 9735
6 9
6 13
6 18
6 21
6 114
6 121
6 139
6 203
6 345
6 411
6 1579
6 1915
6 697...

output:

23
1 2 6 7 8 14 15 18 23 40 53 67 83 92 99 108 224 254 668 691 777 782 1153 

result:

ok 2 lines

Test #4:

score: 0
Accepted
time: 3ms
memory: 3488kb

input:

20 10 3
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
2 11 13
2 7 11
2 3 14
2 6 9
2 7 13
2 7 14
2 1 15
2 9 20
2 16 19
2 7 20

output:

12
6 7 8 9 10 11 12 13 14 16 17 18 

result:

ok 2 lines

Test #5:

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

input:

20 10 5
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
4 6 7 10 11
4 5 7 10 12
4 5 6 10 13
4 4 6 10 12
4 4 7 11 13
4 6 7 8 9
4 6 7 8 9
4 7 8 9 10
4 7 8 9 10
4 6 7 8 10

output:

5
6 7 8 9 10 

result:

ok 2 lines

Test #6:

score: 0
Accepted
time: 58ms
memory: 6300kb

input:

10000 450 12
1 2
2 3
3 4
3 6160
3 6779
4 5
4 7984
4 8385
5 6
5 7179
5 9305
5 9772
6 7
6 9263
7 8
7 6479
7 7146
8 9
8 5543
9 10
9 5632
10 11
10 5039
11 12
11 5799
12 13
12 8937
13 14
14 15
15 16
15 7082
15 7698
16 17
17 18
18 19
19 20
19 7916
20 21
20 5964
21 22
21 9318
22 23
23 24
24 25
25 26
25 608...

output:

4907
43 44 45 47 50 51 53 54 55 56 57 58 59 61 62 63 65 67 68 71 72 73 75 77 79 80 82 83 86 89 92 94 97 100 103 104 106 107 108 109 110 112 114 115 116 118 119 121 122 124 126 129 130 131 132 133 134 137 138 139 140 141 143 145 148 149 150 151 153 155 157 158 159 162 164 167 169 171 172 173 174 176 ...

result:

ok 2 lines

Test #7:

score: 0
Accepted
time: 7ms
memory: 4324kb

input:

10000 101 2
1 2
1 5405
1 5864
1 6579
2 3
2 2401
2 3038
2 3315
2 4065
3 4
3 2614
3 3461
3 7341
3 9605
4 5
4 1688
4 2993
5 6
5 2222
5 4151
6 7
6 4734
7 8
7 9460
8 9
8 4046
9 10
9 1576
10 11
10 1056
10 5071
10 5219
10 6147
11 12
11 5479
11 9599
12 13
12 1155
12 4510
13 14
13 1577
13 8132
13 8434
14 15
...

output:

515
77 81 83 84 86 88 91 92 118 120 122 127 140 145 149 154 184 187 190 192 193 245 251 252 257 294 378 381 385 386 388 389 391 410 464 465 481 483 487 508 509 511 512 520 521 522 523 524 525 622 626 627 630 650 651 653 711 712 713 716 717 719 720 725 759 760 807 808 812 833 834 835 838 840 844 848 ...

result:

ok 2 lines

Test #8:

score: 0
Accepted
time: 7ms
memory: 3984kb

input:

10000 1000 2
1 2
1 4
1 14
1 28
1 56
1 64
1 65
1 70
1 94
1 99
1 100
1 106
1 110
1 130
1 132
1 135
1 137
1 141
1 178
1 183
1 186
1 196
1 202
1 205
1 223
1 228
1 244
1 251
1 265
1 269
1 272
1 276
1 284
1 286
1 294
1 307
1 308
1 330
1 353
1 358
1 363
1 364
1 377
1 379
1 388
1 396
1 427
1 483
1 487
1 492...

output:

197
1 2 82 205 211 245 306 340 371 693 735 789 839 853 994 1008 1010 1409 1411 1421 1610 1632 1693 1764 1768 1771 1828 1846 1862 1874 1883 1885 1893 1905 1927 1968 1989 2025 2026 2027 2066 2069 2087 2106 2177 2189 2193 2336 2344 2360 2394 2522 2616 2733 2844 2913 2992 2998 3002 3039 3058 3060 3173 3...

result:

ok 2 lines

Test #9:

score: 0
Accepted
time: 11ms
memory: 4036kb

input:

10000 1000 1000
1 2
1 4
1 6
1 8
1 14
1 44
1 216
1 529
1 671
1 695
1 998
1 1108
1 1339
1 1426
1 1474
1 1597
1 1737
1 1762
1 2105
1 2401
1 2428
1 2586
1 2720
1 3310
1 3910
1 4018
1 4400
1 4499
1 4725
1 4896
1 5163
1 5197
1 5308
1 5382
1 5455
1 5496
1 5505
1 5737
1 5805
1 5967
1 6044
1 6278
1 6475
1 65...

output:

0


result:

ok single line: '0'

Test #10:

score: 0
Accepted
time: 2ms
memory: 3420kb

input:

20 13 1
1 2
2 3
2 14
2 17
3 4
3 11
3 16
4 5
4 13
5 6
6 7
7 8
7 12
8 9
9 10
10 15
11 18
11 19
18 20
4 2 5 17 20
4 2 7 14 19
4 1 8 10 13
4 7 8 16 19
4 5 7 15 20
4 2 3 9 10
4 2 5 8 15
4 2 3 9 10
4 2 9 11 15
4 2 3 11 14
4 2 11 17 19
4 3 17 19 20
4 1 11 14 20

output:

18
1 2 3 4 5 6 7 8 9 10 11 12 14 15 16 17 18 19 

result:

ok 2 lines

Test #11:

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

input:

20 13 2
1 2
2 3
2 15
2 17
3 4
4 5
5 6
6 7
6 11
6 18
7 8
8 9
8 12
8 19
9 10
11 13
11 16
12 14
19 20
4 7 17 19 20
4 4 11 12 13
4 4 8 15 19
4 8 10 15 17
4 1 12 18 19
4 1 2 7 12
4 2 12 14 15
4 12 14 15 17
4 2 12 14 15
4 9 11 19 20
4 6 7 8 12
4 5 6 14 18
4 6 7 8 11

output:

16
1 2 3 4 5 6 7 8 9 10 11 12 13 14 18 19 

result:

ok 2 lines

Test #12:

score: 0
Accepted
time: 2ms
memory: 3392kb

input:

20 13 3
1 2
2 3
2 11
2 15
3 4
4 5
4 16
4 18
5 6
5 12
5 14
5 20
6 7
7 8
8 9
8 13
9 10
11 17
18 19
4 3 6 13 17
4 2 8 9 17
4 8 13 18 20
4 2 6 7 19
4 6 12 15 18
4 2 5 14 16
4 1 4 19 20
4 3 4 6 18
4 2 4 18 19
4 4 11 15 17
4 2 3 11 17
4 2 16 17 18
4 2 4 11 17

output:

10
2 3 5 6 8 9 13 14 18 19 

result:

ok 2 lines

Test #13:

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

input:

20 13 4
1 2
2 3
2 20
3 4
3 17
4 5
4 13
4 16
5 6
6 7
6 12
7 8
8 9
8 11
9 10
10 14
11 18
14 15
15 19
4 5 7 16 19
4 4 8 14 16
4 11 14 19 20
4 2 10 11 18
4 4 5 12 14
4 4 10 17 19
4 3 4 15 19
4 5 13 14 15
4 2 4 14 15
4 7 11 12 18
4 5 6 8 11
4 6 11 12 18
4 6 11 12 18

output:

13
4 6 9 10 11 12 13 14 15 16 17 18 19 

result:

ok 2 lines

Test #14:

score: 0
Accepted
time: 2ms
memory: 3460kb

input:

20 13 5
1 2
1 11
2 3
3 4
3 12
3 15
4 5
5 6
6 7
6 13
7 8
7 17
8 9
8 19
9 10
9 18
10 14
10 20
14 16
4 5 6 15 17
4 3 4 9 10
4 14 15 16 17
4 1 8 10 17
4 1 8 15 17
4 9 10 14 16
4 9 10 16 20
4 10 14 18 20
4 8 14 16 19
4 4 6 17 19
4 5 7 13 19
4 6 7 17 19
4 5 7 9 13

output:

9
4 7 8 9 11 12 13 15 17 

result:

ok 2 lines

Subtask #2:

score: 15
Accepted

Test #15:

score: 15
Accepted
time: 53ms
memory: 4824kb

input:

10000 1500 25
1 2
1 5
1 10
1 14
1 76
1 1625
1 1969
1 2025
2 3
2 34
2 320
2 519
2 577
2 2340
2 3157
2 7075
2 8630
3 4
3 38
3 215
3 248
3 272
3 1597
3 1752
3 1853
3 2104
3 5171
3 8467
4 7
4 9
4 12
4 30
4 436
4 1404
4 3559
5 6
5 8
5 60
5 74
5 79
5 281
5 627
5 770
5 848
5 2371
5 6713
5 9756
6 13
6 73
6 ...

output:

1430
1 2 3 4 5 9 10 12 13 18 19 20 21 29 30 31 32 33 36 37 38 39 40 42 48 49 50 51 56 57 58 59 60 61 65 66 67 68 71 72 73 74 75 76 80 81 82 83 85 86 89 91 92 93 94 95 97 98 99 101 102 103 105 106 107 109 110 111 112 117 118 119 120 122 123 131 132 135 137 138 139 140 142 145 150 151 152 153 156 159 ...

result:

ok 2 lines

Test #16:

score: 0
Accepted
time: 60ms
memory: 4856kb

input:

10000 1500 11
1 2
1 3
1 8
1 27
1 28
2 4
2 7
2 20
2 64
2 91
2 302
2 602
2 931
3 5
3 45
3 52
3 95
3 107
3 375
3 650
3 826
3 1315
3 3089
3 8256
4 29
4 44
4 161
4 219
4 877
5 6
5 11
5 24
5 40
5 62
5 80
5 158
5 292
5 506
5 625
5 674
5 1489
5 1601
5 3095
5 3249
5 3332
5 3550
5 4551
5 9959
6 12
6 13
6 14
6...

output:

3965
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 42 43 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 73 74 75 77 78 79 80 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 98 99 100 101 102 107 108 109 110 111 112 113 115 11...

result:

ok 2 lines

Test #17:

score: 0
Accepted
time: 58ms
memory: 4852kb

input:

10000 1500 5
1 2
1 3
1 5
1 10
1 18
1 29
1 82
1 114
1 213
1 339
1 1723
1 2506
1 3390
2 4
2 27
2 33
2 286
2 3922
2 7907
2 9579
3 6
3 7
3 13
3 38
3 131
3 229
3 582
3 1132
3 1575
3 2046
3 7395
3 7534
4 24
4 63
4 165
4 740
5 8
5 26
5 30
5 170
5 365
6 209
6 394
6 663
6 676
6 769
6 4426
7 9
7 12
7 32
7 79
...

output:

6846
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 21 22 23 24 25 26 27 28 29 30 31 33 34 35 36 37 38 39 40 41 43 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 89 90 91 92 93 94 95 96 98 99 100 101 102 103 104 105 1...

result:

ok 2 lines

Test #18:

score: 0
Accepted
time: 229ms
memory: 6432kb

input:

10000 1991 399
1 2
2 3
2 6311
3 4
4 5
5 6
6 7
6 8587
6 9209
7 8
8 9
8 6791
9 10
10 11
11 12
11 5348
12 13
12 9153
13 14
13 5582
13 6394
13 6528
14 15
15 16
16 17
16 8829
17 18
17 7764
18 19
18 5926
19 20
20 21
20 8222
21 22
21 5800
21 9267
22 23
23 24
24 25
25 26
25 8998
26 27
27 28
27 9850
28 29
29...

output:

3584
875 876 877 878 879 880 884 885 886 887 888 889 890 892 893 894 895 896 897 899 901 902 905 906 907 908 910 911 912 914 916 919 921 922 924 927 928 930 932 933 936 937 938 939 940 941 943 945 946 947 951 952 953 956 957 958 960 961 962 963 964 966 967 968 970 971 972 973 974 978 979 980 981 983...

result:

ok 2 lines

Test #19:

score: 0
Accepted
time: 22ms
memory: 4556kb

input:

10000 1000 200
1 2
1 3905
2 3
2 1266
2 1583
2 8609
3 4
3 1168
3 3366
3 3953
3 4186
4 5
4 6117
4 6405
4 9918
5 6
5 1710
5 1990
5 2048
5 3850
6 7
6 1252
6 4357
7 8
7 1527
7 2937
8 9
8 1184
8 3697
9 10
9 1448
9 3100
10 11
10 1285
10 1598
10 7462
11 12
11 3302
12 13
12 1147
12 1859
12 1933
12 1966
12 45...

output:

781
338 342 346 348 351 354 357 359 367 369 373 378 380 381 384 388 391 395 398 399 403 408 409 413 417 420 423 426 430 431 435 437 439 448 450 454 457 460 466 468 472 477 478 480 483 486 492 496 498 500 501 505 507 512 514 520 522 526 529 532 534 537 542 546 549 554 555 556 557 560 566 571 574 578 ...

result:

ok 2 lines

Test #20:

score: 0
Accepted
time: 29ms
memory: 4788kb

input:

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

output:

5392
1 5 6 8 12 13 17 20 21 22 23 28 29 31 33 37 42 43 44 46 47 53 54 55 57 58 59 60 61 62 63 66 67 69 71 72 73 74 75 77 78 79 81 82 85 87 89 90 93 94 95 96 97 99 100 101 102 104 106 107 109 113 115 116 117 118 119 123 126 128 129 132 133 135 136 138 139 143 144 145 149 150 151 152 154 155 159 162 1...

result:

ok 2 lines

Test #21:

score: 0
Accepted
time: 48ms
memory: 4824kb

input:

10000 1000 100
1 2
1 8
1 9
1 14
1 18
1 19
1 21
1 23
1 27
1 29
1 31
1 34
1 39
1 42
1 43
1 46
1 50
1 62
1 66
1 69
1 70
1 71
1 72
1 73
1 74
1 78
1 81
1 83
1 86
1 91
1 92
1 94
1 95
1 99
1 100
1 111
1 112
1 113
1 114
1 117
1 120
1 121
1 122
1 123
1 126
1 127
1 129
1 130
1 134
1 139
1 142
1 145
1 150
1 15...

output:

2
1 3340 

result:

ok 2 lines

Test #22:

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

input:

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

output:

5
1 5 6 7 8 

result:

ok 2 lines

Test #23:

score: 0
Accepted
time: 2ms
memory: 4148kb

input:

10000 200 20
1 2
1 5
1 12
1 77
1 172
1 184
1 277
1 1766
1 2017
1 4032
2 3
2 11
2 42
2 61
2 222
2 223
2 303
2 330
2 1727
2 2980
2 5126
3 4
3 7
3 8
3 97
3 100
3 305
3 1744
3 5169
3 8096
4 6
4 37
4 218
4 481
4 815
4 1423
4 5620
5 117
5 334
5 398
5 616
5 2003
5 3397
5 3829
5 6029
5 9110
6 9
6 48
6 485
6...

output:

93
1 4 6 11 12 13 22 23 24 31 47 55 64 66 75 86 107 131 133 154 159 168 246 266 299 340 358 387 403 461 465 466 467 468 471 472 473 474 482 517 538 555 560 578 597 787 793 807 913 927 1238 1442 1791 1822 1903 2016 2161 2162 2187 2188 2508 2727 3428 3524 3526 3837 3858 4188 4333 4454 4569 4587 4639 4...

result:

ok 2 lines

Test #24:

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

input:

10000 200 55
1 2
1 3
1 9
1 13
1 14
1 17
1 74
1 106
1 871
1 4418
2 4
2 134
2 148
2 1297
2 1391
2 1547
2 1833
2 3287
2 3737
2 4247
3 6
3 8
3 20
3 83
3 271
3 2372
3 5357
4 5
4 18
4 24
4 27
4 118
4 4039
5 7
5 31
5 47
5 91
5 247
5 378
5 466
5 1118
5 1254
6 11
6 12
6 54
6 75
6 105
6 916
6 4245
6 7621
7 10...

output:

21
1 2 3 11 21 23 24 28 29 30 34 43 70 72 128 142 154 334 480 742 752 

result:

ok 2 lines

Test #25:

score: 0
Accepted
time: 2ms
memory: 3400kb

input:

20 10 3
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
2 3 5
2 2 7
2 11 13
2 6 16
2 1 8
2 5 15
2 5 16
2 7 15
2 11 15
2 10 12

output:

12
3 4 5 6 7 8 9 10 11 12 13 14 

result:

ok 2 lines

Test #26:

score: 0
Accepted
time: 2ms
memory: 3544kb

input:

20 10 5
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
4 2 4 7 9
4 3 5 6 7
4 4 5 8 9
4 1 3 6 8
4 2 3 7 8
4 6 8 16 18
4 6 8 16 18
4 6 7 17 19
4 7 8 16 17
4 6 7 16 17

output:

13
4 5 6 7 8 9 10 11 12 13 14 15 16 

result:

ok 2 lines

Test #27:

score: 0
Accepted
time: 56ms
memory: 6136kb

input:

10000 450 12
1 2
1 6371
1 7920
2 3
2 6711
3 4
4 5
5 6
5 5456
6 7
6 5201
6 6455
7 8
7 6177
8 9
8 7613
9 10
10 11
11 12
12 13
12 6332
13 14
14 15
15 16
16 17
16 6901
17 18
18 19
18 6549
19 20
19 6090
19 7126
19 8135
20 21
21 22
22 23
22 5263
23 24
24 25
24 5218
25 26
25 6314
25 9287
26 27
27 28
28 29
...

output:

4936
20 22 23 24 25 27 28 30 34 35 36 38 39 41 44 45 46 47 48 51 54 56 58 60 61 62 63 64 65 66 67 79 80 82 83 84 86 87 88 89 90 92 93 94 95 98 100 103 105 110 113 114 116 119 121 122 125 126 127 129 130 131 132 133 134 135 136 137 138 140 142 143 144 146 147 148 151 153 156 158 159 160 161 162 164 1...

result:

ok 2 lines

Test #28:

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

input:

10000 101 2
1 2
1 6504
2 3
2 1733
3 4
3 2417
3 3758
4 5
4 7501
5 6
5 2206
6 7
6 1017
7 8
7 2151
7 9241
8 9
8 1486
8 1635
9 10
9 1408
9 2642
10 11
10 4577
11 12
11 1347
12 13
12 2140
13 14
13 2192
13 6978
14 15
14 4124
15 16
15 1822
15 7890
15 9019
16 17
16 5150
16 6022
17 18
17 1331
17 1960
18 19
18...

output:

448
5 6 8 11 59 60 62 65 77 80 83 87 139 143 145 147 175 176 261 264 274 276 277 282 286 288 290 291 292 294 355 401 403 404 533 534 539 573 640 642 644 646 680 682 685 687 689 690 694 697 698 700 707 778 779 780 781 797 802 803 846 851 852 864 868 871 872 874 895 900 903 904 906 907 909 912 918 923...

result:

ok 2 lines

Test #29:

score: 0
Accepted
time: 6ms
memory: 3996kb

input:

10000 1000 2
1 2
1 3
1 21
1 26
1 45
1 64
1 71
1 79
1 86
1 107
1 117
1 141
1 155
1 156
1 161
1 165
1 174
1 180
1 188
1 196
1 199
1 204
1 215
1 229
1 230
1 242
1 243
1 246
1 258
1 267
1 277
1 314
1 318
1 335
1 351
1 352
1 361
1 369
1 383
1 393
1 401
1 418
1 421
1 423
1 424
1 445
1 454
1 461
1 473
1 47...

output:

183
1 2 69 71 192 219 253 271 298 302 314 353 436 500 591 663 682 701 837 973 1014 1151 1261 1351 1361 1365 1407 1418 1502 1525 1626 1645 1708 1740 1758 1791 1857 1911 2045 2046 2047 2048 2161 2196 2242 2361 2390 2432 2439 2492 2512 2549 2569 2573 2642 2697 2744 2818 3061 3062 3100 3107 3166 3173 31...

result:

ok 2 lines

Test #30:

score: 0
Accepted
time: 3ms
memory: 4048kb

input:

10000 1000 1000
1 2
1 3
1 6
1 11
1 59
1 61
1 69
1 230
1 1247
1 1502
1 1587
1 1990
1 2072
1 2644
1 2922
1 3198
1 3296
1 3599
1 3631
1 3654
1 4435
1 4460
1 4539
1 4697
1 5344
1 5474
1 5595
1 5665
1 6035
1 6126
1 6142
1 6546
1 6690
1 7317
1 7617
1 7742
1 8023
1 8601
1 8782
1 8802
1 8838
1 8992
1 9095
1...

output:

0


result:

ok single line: '0'

Test #31:

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

input:

20 13 1
1 2
2 3
2 17
3 4
3 15
4 5
5 6
5 11
5 13
6 7
7 8
7 12
7 16
8 9
8 14
9 10
10 19
13 18
14 20
4 3 9 15 17
4 2 3 6 10
4 2 5 9 15
4 7 12 14 19
4 1 11 12 15
4 3 6 9 12
4 4 11 12 16
4 3 5 6 16
4 7 11 13 16
4 3 4 6 15
4 2 4 5 15
4 2 4 11 17
4 2 4 5 11

output:

17
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 

result:

ok 2 lines

Test #32:

score: 0
Accepted
time: 2ms
memory: 3528kb

input:

20 13 2
1 2
1 11
2 3
2 19
3 4
3 14
4 5
4 20
5 6
6 7
7 8
7 12
8 9
9 10
9 13
12 16
12 17
13 15
15 18
4 11 14 17 19
4 2 3 10 15
4 9 10 12 15
4 4 12 13 18
4 1 10 12 20
4 1 7 11 15
4 8 11 18 19
4 1 2 13 15
4 1 3 10 15
4 9 13 15 18
4 10 13 15 18
4 7 9 13 18
4 9 13 15 18

output:

15
1 2 3 4 5 7 9 10 11 12 13 14 15 18 19 

result:

ok 2 lines

Test #33:

score: 0
Accepted
time: 2ms
memory: 3308kb

input:

20 13 3
1 2
2 3
2 12
2 13
3 4
4 5
5 6
6 7
6 15
7 8
8 9
9 10
10 11
11 17
11 19
12 14
12 16
16 18
18 20
4 7 9 16 20
4 4 13 15 18
4 6 7 9 19
4 4 16 17 18
4 9 14 16 19
4 2 6 16 20
4 3 6 18 20
4 5 6 16 18
4 3 4 16 18
4 2 10 11 12
4 8 10 12 16
4 2 9 10 12
4 3 9 10 16

output:

13
2 3 5 6 7 8 10 11 12 13 17 18 19 

result:

ok 2 lines

Test #34:

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

input:

20 13 4
1 2
1 15
2 3
2 17
3 4
4 5
4 12
5 6
5 16
6 7
7 8
7 11
8 9
8 14
9 10
10 13
17 18
18 19
18 20
4 2 3 16 20
4 10 15 16 18
4 14 15 16 18
4 1 4 5 20
4 7 11 13 15
4 6 9 15 17
4 5 8 15 17
4 1 7 11 17
4 1 3 8 14
4 9 10 19 20
4 8 13 19 20
4 10 13 17 18
4 9 13 18 19

output:

14
1 2 3 4 5 6 8 10 11 13 15 16 17 19 

result:

ok 2 lines

Test #35:

score: 0
Accepted
time: 2ms
memory: 3316kb

input:

20 13 5
1 2
2 3
3 4
3 20
4 5
4 15
4 17
5 6
6 7
6 12
7 8
8 9
8 14
8 16
8 18
9 10
9 13
10 11
13 19
4 7 9 12 13
4 2 15 17 19
4 8 11 17 18
4 3 6 11 16
4 1 2 14 17
4 1 2 6 8
4 1 8 9 20
4 2 3 7 16
4 2 3 8 14
4 3 4 7 8
4 7 8 15 20
4 5 8 17 18
4 4 14 17 18

output:

8
2 3 5 7 8 9 11 12 

result:

ok 2 lines

Subtask #3:

score: 0
Time Limit Exceeded

Test #36:

score: 0
Time Limit Exceeded

input:

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

output:


result:


Subtask #4:

score: 0
Time Limit Exceeded

Test #42:

score: 0
Time Limit Exceeded

input:

100000 50000 50000
1 2
1 62279
2 3
2 65122
2 73814
2 79457
2 80525
3 4
3 84818
3 94649
4 5
4 97078
5 6
6 7
6 91079
7 8
7 86372
8 9
8 61967
9 10
10 11
11 12
11 73785
11 88130
12 13
12 53359
12 95417
13 14
13 99504
14 15
15 16
15 50946
15 51474
16 17
16 59256
16 72237
17 18
18 19
18 63271
19 20
20 21
...

output:


result:


Subtask #5:

score: 0
Skipped

Dependency #4:

0%

Subtask #6:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%