QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#195986#6503. DFS Order 3HuangHanShengTL 218ms14980kbC++201.9kb2023-10-01 10:31:092023-10-01 10:31:10

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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
2 3
1 2
2 3
2 4
1 2
1 3
2 4
3 5

result:

ok correct answer! (4 test cases)

Test #2:

score: 0
Accepted
time: 61ms
memory: 5636kb

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:

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

result:

ok correct answer! (20000 test cases)

Test #3:

score: 0
Accepted
time: 94ms
memory: 5996kb

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
9 10
6 16
3 18
4 19
15 20
20 21
6 23
22 26
1 29
9 33
7 34
23 37
5 41
10 43
11 44
36 44
1 45
20 45
12 47
17 47
18 48
17 50
38 50
1 51
42 52
4 53
32 53
32 54
33 56
34 58
38 58
39 59
14 60
44 60
40 62
13 65
15 66
4 67
49 67
3 68
26 68
40 68
14 69
35 69
38 69
21 71
8 73
31 73
49 73
13 74
37 74
52 74...

result:

ok correct answer! (200 test cases)

Test #4:

score: 0
Accepted
time: 157ms
memory: 12532kb

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:

6 8
14 23
12 27
21 38
11 46
26 52
33 60
3 69
55 69
29 70
11 73
23 74
9 77
25 82
64 88
24 90
48 92
61 95
56 97
6 100
22 101
23 102
50 103
96 106
2 110
94 110
11 117
39 120
80 120
108 122
5 124
105 126
72 127
125 127
79 132
48 133
127 134
10 135
114 135
121 141
124 143
31 147
30 151
61 151
59 153
50 1...

result:

ok correct answer! (8 test cases)

Test #5:

score: 0
Accepted
time: 218ms
memory: 14980kb

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:

60 68
41 84
55 87
20 97
70 97
66 99
6 105
106 116
56 119
105 122
92 123
50 124
84 136
132 139
15 143
45 145
118 150
130 150
9 152
141 154
97 155
82 156
13 160
65 165
157 167
157 169
117 174
142 183
32 187
117 190
72 192
177 193
176 196
77 197
137 197
102 199
158 200
10 201
184 201
8 203
78 203
33 20...

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: