QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#116563#4814. Exciting Travelasdf1234codingRE 6ms25944kbC++206.8kb2023-06-29 15:09:482023-06-29 15:09:51

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 5ms
memory: 25320kb

input:

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

output:

1
1
2

result:

ok 3 number(s): "1 1 2"

Test #2:

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

input:

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

output:

0
0
0
1
4
3
5

result:

ok 7 numbers

Test #3:

score: 0
Accepted
time: 4ms
memory: 25356kb

input:

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

output:

0
0
3
2
0
1
0
1
0
1

result:

ok 10 numbers

Test #4:

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

input:

1 1
1 1

output:

0

result:

ok 1 number(s): "0"

Test #5:

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

input:

1 0

output:


result:

ok 0 number(s): ""

Test #6:

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

input:

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

output:

1
0
4
0
0
0
2
0
0
4
0
0
0
4
4

result:

ok 15 numbers

Test #7:

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

input:

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

output:

0
3
1
3
0
0
0
0
0
0
0
5
6
1
6

result:

ok 15 numbers

Test #8:

score: 0
Accepted
time: 5ms
memory: 25336kb

input:

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

output:

1
1
0
2
6
3
0
0
0
0
7
0
0
5
0

result:

ok 15 numbers

Test #9:

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

input:

1000 500
685 415
28 527
771 396
201 538
604 162
631 66
144 596
788 378
919 59
737 550
471 413
3 590
891 52
886 705
350 238
164 224
554 358
909 150
354 441
310 756
380 661
380 867
601 318
197 204
993 673
118 624
249 539
841 737
742 853
250 566
543 663
981 243
60 120
976 801
750 2
694 8
935 831
381 48...

output:

0
3
0
3
4
2
2
0
2
0
4
0
1
4
5
2
0
12
0
14
3
3
5
3
0
0
2
0
4
9
5
5
1
0
40
12
0
18
4
1
1
6
0
7
3
0
0
14
5
1
3
8
5
0
4
0
5
7
2
5
6
0
5
0
1
2
7
3
0
0
6
0
1
8
4
1
11
0
1
0
8
3
2
0
1
2
0
3
9
5
13
2
0
4
2
0
4
1
14
1
4
4
4
0
1
1
10
2
2
0
0
4
10
2
3
10
4
0
13
6
0
19
3
4
9
2
10
6
1
0
0
3
0
0
6
12
5
2
2
1
9
15...

result:

ok 500 numbers

Test #10:

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

input:

1000 500
657 521
621 14
522 258
78 524
221 712
607 614
270 378
307 865
702 869
336 541
649 488
606 807
272 312
152 213
931 861
442 227
3 298
700 757
74 634
829 765
670 748
532 283
398 90
626 913
610 879
340 850
183 369
326 877
872 809
684 303
574 161
798 339
803 842
182 571
585 732
262 859
851 515
7...

output:

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

result:

ok 500 numbers

Test #11:

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

input:

1000 500
642 460
642 15
642 123
415 642
642 302
402 642
596 642
139 642
449 642
715 642
642 377
642 622
718 642
642 172
262 642
240 642
642 872
256 642
642 403
642 486
227 642
642 708
642 907
113 642
642 400
829 642
642 430
142 642
765 642
219 642
470 642
744 642
642 871
30 642
642 282
422 642
623 6...

output:

0
0
1
0
2
0
9
1
0
0
3
16
5
11
0
3
1
7
2
4
5
0
2
1
0
8
1
27
1
2
2
2
8
1
5
0
2
13
1
1
3
8
7
7
23
9
3
1
10
2
1
4
0
7
0
2
2
2
0
5
1
4
15
3
4
0
3
0
6
0
0
0
0
0
1
0
4
1
1
1
0
9
6
1
8
1
8
0
0
5
6
3
0
8
2
4
13
15
6
2
10
0
1
19
2
11
0
4
0
6
10
0
0
6
2
7
2
0
21
11
0
3
2
8
0
4
0
0
0
8
0
1
7
8
0
1
0
0
8
20
3
0
...

result:

ok 500 numbers

Test #12:

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

input:

1000 500
268 91
243 255
301 436
34 358
177 16
819 174
305 923
256 126
803 359
603 677
302 485
801 546
79 963
873 946
163 496
893 771
521 23
820 389
344 700
442 824
16 222
166 820
364 678
853 173
389 917
36 303
987 560
388 284
191 904
268 629
193 572
956 945
783 520
899 763
514 245
991 477
937 239
64...

output:

1
0
2
7
1
0
16
0
15
5
0
12
0
9
0
2
1
12
0
0
5
2
49
0
10
0
2
1
0
10
0
0
0
0
6
11
0
8
6
10
0
3
0
11
2
1
0
9
2
17
13
0
8
22
0
3
0
4
4
0
3
4
3
11
3
11
0
0
1
7
0
31
17
0
2
5
0
8
1
1
1
0
0
5
2
1
2
3
8
2
0
3
5
14
1
0
2
6
4
0
5
0
5
1
0
1
0
0
9
4
0
0
1
6
0
0
0
3
0
0
1
4
2
0
23
3
10
1
3
2
1
2
0
1
11
5
0
0
2
1...

result:

ok 500 numbers

Test #13:

score: -100
Runtime Error

input:

200000 50000
147950 15945
149717 150569
30462 116515
142211 168449
44972 135361
21861 103991
37557 168992
94504 141877
53485 104648
84171 32837
130622 2483
138672 112637
194683 83812
90100 176078
199978 53056
51731 34853
137794 56530
52239 113059
162164 35256
198068 150417
26594 32585
107974 138107
...

output:


result: