QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#601701#4122. 嫁接树HuangHanSheng70 53ms14356kbC++202.2kb2024-09-30 11:08:392024-09-30 11:08:40

详细


Pretests


Final Tests

Test #1:

score: 5
Accepted
time: 23ms
memory: 13312kb

input:

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

output:

66022.383

result:

ok single line: '66022.383'

Test #2:

score: 5
Accepted
time: 22ms
memory: 13568kb

input:

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

output:

69617.050

result:

ok single line: '69617.050'

Test #3:

score: 5
Accepted
time: 21ms
memory: 13956kb

input:

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

output:

73247.333

result:

ok single line: '73247.333'

Test #4:

score: 5
Accepted
time: 19ms
memory: 13860kb

input:

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

output:

76902.517

result:

ok single line: '76902.517'

Test #5:

score: 5
Accepted
time: 24ms
memory: 14356kb

input:

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

output:

84305.667

result:

ok single line: '84305.667'

Test #6:

score: 5
Accepted
time: 15ms
memory: 13712kb

input:

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

output:

0.606

result:

ok single line: '0.606'

Test #7:

score: 5
Accepted
time: 23ms
memory: 13880kb

input:

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

output:

0.203

result:

ok single line: '0.203'

Test #8:

score: 5
Accepted
time: 22ms
memory: 13972kb

input:

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

output:

0.068

result:

ok single line: '0.068'

Test #9:

score: 5
Accepted
time: 24ms
memory: 14192kb

input:

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

output:

0.088

result:

ok single line: '0.088'

Test #10:

score: 5
Accepted
time: 21ms
memory: 14340kb

input:

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

output:

0.155

result:

ok single line: '0.155'

Test #11:

score: 0
Wrong Answer
time: 36ms
memory: 9148kb

input:

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

output:

12084.783

result:

wrong answer 1st lines differ - expected: '12084.733', found: '12084.783'

Test #12:

score: 0
Wrong Answer
time: 36ms
memory: 10840kb

input:

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

output:

12846.733

result:

wrong answer 1st lines differ - expected: '12869.817', found: '12846.733'

Test #13:

score: 0
Wrong Answer
time: 39ms
memory: 8880kb

input:

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

output:

13637.650

result:

wrong answer 1st lines differ - expected: '13659.067', found: '13637.650'

Test #14:

score: 5
Accepted
time: 48ms
memory: 9192kb

input:

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

output:

14445.067

result:

ok single line: '14445.067'

Test #15:

score: 0
Wrong Answer
time: 53ms
memory: 9288kb

input:

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

output:

16022.767

result:

wrong answer 1st lines differ - expected: '16042.017', found: '16022.767'

Test #16:

score: 0
Wrong Answer
time: 39ms
memory: 9256kb

input:

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

output:

0.286

result:

wrong answer 1st lines differ - expected: '0.285', found: '0.286'

Test #17:

score: 0
Wrong Answer
time: 43ms
memory: 9008kb

input:

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

output:

0.142

result:

wrong answer 1st lines differ - expected: '0.143', found: '0.142'

Test #18:

score: 5
Accepted
time: 46ms
memory: 9048kb

input:

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

output:

0.071

result:

ok single line: '0.071'

Test #19:

score: 5
Accepted
time: 41ms
memory: 9220kb

input:

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

output:

0.095

result:

ok single line: '0.095'

Test #20:

score: 5
Accepted
time: 53ms
memory: 9264kb

input:

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

output:

0.189

result:

ok single line: '0.189'