QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#122378#6503. DFS Order 3ZhaoZiLongTL 122ms11528kbC++111.1kb2023-07-10 11:42:482023-07-10 11:42:51

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 5680kb

input:

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

output:

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

result:

ok correct answer! (4 test cases)

Test #2:

score: 0
Accepted
time: 122ms
memory: 5624kb

input:

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

output:

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

result:

ok correct answer! (20000 test cases)

Test #3:

score: 0
Accepted
time: 103ms
memory: 6080kb

input:

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

output:

2 5
7 34
8 73
11 44
19 4
25 99
27 97
28 86
30 95
31 73
35 69
36 44
41 5
42 52
46 82
48 18
51 1
54 32
55 80
57 91
59 39
61 89
63 94
64 90
65 13
66 15
70 77
71 21
75 94
76 98
78 26
83 45
85 38
87 56
88 73
96 72
13 74
15 20
21 20
32 53
39 92
44 60
52 74
72 93
73 49
77 29
86 60
89 58
94 47
95 5
97 56
98...

result:

ok correct answer! (200 test cases)

Test #4:

score: 0
Accepted
time: 103ms
memory: 11280kb

input:

8
500
1 164 494 392 66 328 402 15 156 395 234 78 241 304 4 54 439 387 83 460 220 490 369 343 172 190 108 122 173 384 290 403 231 254 70 29 294 359 153 59 228 474 167 222 491 357 169 383 50 103 447 84 344 237 376 457 238 17 363 131 34 244 472 104 154 322 140 488 193 390 245 147 31 189 191 221 259 456...

output:

1 164
4 304
10 135
17 238
18 346
19 295
20 176
24 90
28 415
29 70
30 151
32 374
36 381
37 455
38 21
42 424
44 429
51 305
54 304
55 69
58 319
59 153
60 33
63 261
66 392
67 247
75 422
76 379
77 9
79 132
83 387
84 447
87 243
88 64
89 298
92 48
93 455
94 110
98 313
99 381
103 50
104 472
106 96
109 367
1...

result:

ok correct answer! (8 test cases)

Test #5:

score: 0
Accepted
time: 88ms
memory: 11528kb

input:

2
1000
1 586 727 909 178 211 319 562 12 759 714 885 988 612 507 670 288 932 608 333 649 663 14 826 874 930 968 965 780 353 558 76 787 617 815 181 31 552 3 761 398 814 740 841 789 282 636 894 179 569 566 408 225 334 671 294 101 634 218 270 412 463 400 495 804 710 262 93 572 18 673 808 862 711 350 603...

output:

1 586
4 532
10 201
16 595
17 889
24 310
25 718
26 356
27 263
28 767
30 359
34 877
35 376
36 682
37 939
38 888
41 84
42 314
44 548
46 525
47 679
48 616
51 560
55 87
58 658
59 627
63 505
65 165
67 520
68 60
74 973
78 203
80 786
91 550
93 262
95 404
98 420
104 514
106 116
110 677
111 667
113 252
115 77...

result:

ok correct answer! (2 test cases)

Test #6:

score: -100
Time Limit Exceeded

input:

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

output:


result: