Toggle navigation
Bulletin
Problems
Submissions
Contests
Discuss
About
Rank
Sign in
Sign up
×
Close
2024 全國模擬賽題目上線啦 !!!!!
題目在
這裡
~
2365 . E. 棲息地分配 (habitat distribution)
Submit
Status
Discussion / Solution
Ranklist
Back to Problems List
TopCoder
Caido
$\mathbb{W}\mathcal{aimai}\sim$
User's AC Ratio
77.3% (
17/22
)
Submission's AC Ratio
17.1% (
22
/
129
)
Tags
Show solution-related tags
TOI
TOI-pre
2024-TOI-pre
Description
題目 PDF 檔在這裡
Input Format
Output Format
Sample Input 1
copy
1
5 6
1 2
2 3
3 4
4 5
5 3
4 2
Sample Output 1
copy
3 3 4 5
1 1
1 2
Sample Input 2
copy
2
5 4
1 2
1 3
3 4
3 5
5 4
1 2
2 3
1 3
4 5
Sample Output 2
copy
2 1 2
1 3
2 4 5
3 1 2 3
1 4
1 5
Hints
Problem Source
Subtasks
No.
Testdata Range
Constraints
Score
1
0~1
範例測資
0
2
2~4
輸入滿足 $m = n − 1$,且所有的棲息地連通。
3
3
5~15
輸入保證存在兩個以上的棲息地互相無法抵達。
23
4
16~22
輸入滿足所有測試資料中,$n$ 的總和不超過 $500$。
28
5
0~52
無額外限制
46
Testdata and Limits
No.
Time Limit (ms)
Memory Limit (VSS, KiB)
Output Limit (KiB)
Subtasks
0
2500
1048576
65536
1
5
1
2500
1048576
65536
1
5
2
2500
1048576
65536
2
5
3
2500
1048576
65536
2
5
4
2500
1048576
65536
2
5
5
2500
1048576
65536
3
5
6
2500
1048576
65536
3
5
7
2500
1048576
65536
3
5
8
2500
1048576
65536
3
5
9
2500
1048576
65536
3
5
10
2500
1048576
65536
3
5
11
2500
1048576
65536
3
5
12
2500
1048576
65536
3
5
13
2500
1048576
65536
3
5
14
2500
1048576
65536
3
5
15
2500
1048576
65536
3
5
16
2500
1048576
65536
4
5
17
2500
1048576
65536
4
5
18
2500
1048576
65536
4
5
19
2500
1048576
65536
4
5
20
2500
1048576
65536
4
5
21
2500
1048576
65536
4
5
22
2500
1048576
65536
4
5
23
2500
1048576
65536
5
24
2500
1048576
65536
5
25
2500
1048576
65536
5
26
2500
1048576
65536
5
27
2500
1048576
65536
5
28
2500
1048576
65536
5
29
2500
1048576
65536
5
30
2500
1048576
65536
5
31
2500
1048576
65536
5
32
2500
1048576
65536
5
33
2500
1048576
65536
5
34
2500
1048576
65536
5
35
2500
1048576
65536
5
36
2500
1048576
65536
5
37
2500
1048576
65536
5
38
2500
1048576
65536
5
39
2500
1048576
65536
5
40
2500
1048576
65536
5
41
2500
1048576
65536
5
42
2500
1048576
65536
5
43
2500
1048576
65536
5
44
2500
1048576
65536
5
45
2500
1048576
65536
5
46
2500
1048576
65536
5
47
2500
1048576
65536
5
48
2500
1048576
65536
5
49
2500
1048576
65536
5
50
2500
1048576
65536
5
Submit
Back to Top