QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#143865#6503. DFS Order 3GuanYunchangWA 97ms3840kbC++171.2kb2023-08-21 14:55:382023-08-21 14:55:44

详细

Test #1:

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

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:

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

result:

ok correct answer! (4 test cases)

Test #2:

score: -100
Wrong Answer
time: 97ms
memory: 3748kb

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:

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

result:

wrong answer your output is not a tree (test case 1)