QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#209091#5367. 递增树列slime#60 894ms4104kbC++233.6kb2023-10-10 09:48:532024-07-04 02:17:55

詳細信息

Subtask #1:

score: 9
Accepted

Test #1:

score: 9
Accepted
time: 1ms
memory: 3860kb

input:

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

output:

712

result:

ok single line: '712'

Test #2:

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

input:

5
1 2
1 3
3 4
4 5

output:

44

result:

ok single line: '44'

Test #3:

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

input:

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

output:

576

result:

ok single line: '576'

Test #4:

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

input:

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

output:

6912

result:

ok single line: '6912'

Test #5:

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

input:

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

output:

3360

result:

ok single line: '3360'

Subtask #2:

score: 11
Accepted

Dependency #1:

100%
Accepted

Test #6:

score: 11
Accepted
time: 1ms
memory: 3876kb

input:

14
1 2
1 3
1 4
1 5
1 6
4 7
2 8
1 9
4 10
7 11
9 12
2 13
11 14

output:

389151297

result:

ok single line: '389151297'

Test #7:

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

input:

13
1 2
2 3
2 4
2 5
4 6
4 7
3 8
4 9
6 10
4 11
11 12
6 13

output:

17381952

result:

ok single line: '17381952'

Test #8:

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

input:

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

output:

4993920

result:

ok single line: '4993920'

Test #9:

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

input:

15
1 2
1 3
2 4
4 5
2 6
6 7
2 8
8 9
2 10
4 11
8 12
4 13
5 14
9 15

output:

818474475

result:

ok single line: '818474475'

Test #10:

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

input:

15
1 2
1 3
2 4
3 5
2 6
5 7
4 8
4 9
1 10
10 11
8 12
10 13
13 14
7 15

output:

16041048

result:

ok single line: '16041048'

Subtask #3:

score: 15
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #11:

score: 15
Accepted
time: 6ms
memory: 3672kb

input:

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

output:

179142361

result:

ok single line: '179142361'

Test #12:

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

input:

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

output:

680835791

result:

ok single line: '680835791'

Test #13:

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

input:

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

output:

613299173

result:

ok single line: '613299173'

Test #14:

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

input:

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

output:

990332459

result:

ok single line: '990332459'

Test #15:

score: 0
Accepted
time: 8ms
memory: 3704kb

input:

27
1 2
1 3
2 4
1 5
3 6
1 7
4 8
5 9
5 10
9 11
10 12
11 13
6 14
3 15
6 16
5 17
4 18
14 19
3 20
13 21
1 22
8 23
6 24
4 25
12 26
25 27

output:

254905851

result:

ok single line: '254905851'

Test #16:

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

input:

28
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28

output:

245512165

result:

ok single line: '245512165'

Test #17:

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

input:

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

output:

440732388

result:

ok single line: '440732388'

Test #18:

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

input:

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

output:

222462817

result:

ok single line: '222462817'

Test #19:

score: 0
Accepted
time: 12ms
memory: 3904kb

input:

30
1 2
1 3
1 4
2 5
5 6
3 7
7 8
5 9
6 10
7 11
10 12
9 13
11 14
11 15
14 16
13 17
16 18
15 19
19 20
20 21
18 22
22 23
21 24
24 25
22 26
24 27
25 28
27 29
27 30

output:

915280502

result:

ok single line: '915280502'

Test #20:

score: 0
Accepted
time: 7ms
memory: 3912kb

input:

29
1 2
2 3
1 4
4 5
2 6
5 7
3 8
7 9
5 10
7 11
10 12
9 13
13 14
11 15
11 16
12 17
17 18
17 19
17 20
16 21
17 22
20 23
22 24
23 25
22 26
25 27
24 28
28 29

output:

847984210

result:

ok single line: '847984210'

Test #21:

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

input:

30
1 2
1 3
3 4
4 5
4 6
5 7
6 8
6 9
8 10
6 11
11 12
10 13
9 14
9 15
15 16
15 17
17 18
16 19
16 20
19 21
16 22
20 23
20 24
21 25
20 26
22 27
25 28
26 29
28 30

output:

203499669

result:

ok single line: '203499669'

Test #22:

score: 0
Accepted
time: 7ms
memory: 3668kb

input:

29
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
7 18
1 19
6 20
16 21
18 22
19 23
15 24
6 25
3 26
16 27
9 28
21 29

output:

673029660

result:

ok single line: '673029660'

Test #23:

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

input:

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

output:

463358446

result:

ok single line: '463358446'

Test #24:

score: 0
Accepted
time: 8ms
memory: 3628kb

input:

30
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
16 20
14 21
8 22
13 23
3 24
16 25
13 26
18 27
10 28
5 29
21 30

output:

2581770

result:

ok single line: '2581770'

Subtask #4:

score: 25
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #25:

score: 25
Accepted
time: 76ms
memory: 3656kb

input:

42
1 2
1 3
2 4
1 5
1 6
1 7
6 8
2 9
5 10
2 11
2 12
7 13
9 14
3 15
4 16
3 17
8 18
11 19
10 20
12 21
16 22
6 23
13 24
19 25
8 26
22 27
19 28
7 29
1 30
2 31
30 32
27 33
28 34
18 35
6 36
24 37
21 38
11 39
22 40
22 41
3 42

output:

475818143

result:

ok single line: '475818143'

Test #26:

score: 0
Accepted
time: 86ms
memory: 3636kb

input:

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

output:

574349748

result:

ok single line: '574349748'

Test #27:

score: 0
Accepted
time: 154ms
memory: 3640kb

input:

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

output:

284808122

result:

ok single line: '284808122'

Test #28:

score: 0
Accepted
time: 161ms
memory: 3700kb

input:

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

output:

728582173

result:

ok single line: '728582173'

Test #29:

score: 0
Accepted
time: 83ms
memory: 3676kb

input:

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

output:

830913254

result:

ok single line: '830913254'

Test #30:

score: 0
Accepted
time: 7ms
memory: 3832kb

input:

42
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42

output:

118430285

result:

ok single line: '118430285'

Test #31:

score: 0
Accepted
time: 37ms
memory: 3772kb

input:

44
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
1 39
1 40
1 41
1 42
1 43
1 44

output:

10503098

result:

ok single line: '10503098'

Test #32:

score: 0
Accepted
time: 28ms
memory: 3744kb

input:

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

output:

236779386

result:

ok single line: '236779386'

Test #33:

score: 0
Accepted
time: 25ms
memory: 3772kb

input:

43
1 2
1 3
3 4
4 5
4 6
4 7
4 8
8 9
7 10
7 11
10 12
9 13
12 14
12 15
14 16
15 17
17 18
17 19
18 20
19 21
19 22
20 23
21 24
22 25
23 26
24 27
27 28
25 29
26 30
30 31
29 32
32 33
31 34
33 35
33 36
33 37
37 38
35 39
37 40
37 41
38 42
42 43

output:

472278844

result:

ok single line: '472278844'

Test #34:

score: 0
Accepted
time: 46ms
memory: 4024kb

input:

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

output:

918870657

result:

ok single line: '918870657'

Test #35:

score: 0
Accepted
time: 35ms
memory: 3772kb

input:

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

output:

85610243

result:

ok single line: '85610243'

Test #36:

score: 0
Accepted
time: 76ms
memory: 4008kb

input:

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

output:

773530270

result:

ok single line: '773530270'

Test #37:

score: 0
Accepted
time: 55ms
memory: 3696kb

input:

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

output:

600462689

result:

ok single line: '600462689'

Test #38:

score: 0
Accepted
time: 42ms
memory: 3748kb

input:

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

output:

563685126

result:

ok single line: '563685126'

Subtask #5:

score: 0
Time Limit Exceeded

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Test #39:

score: 40
Accepted
time: 894ms
memory: 4104kb

input:

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

output:

518761011

result:

ok single line: '518761011'

Test #40:

score: -40
Time Limit Exceeded

input:

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

output:


result: