Toggle navigation
Bulletin
Problems
Submissions
Contests
Discuss
About
Rank
Sign in
Sign up
×
Close
2024 全國模擬賽題目上線啦 !!!!!
題目在
這裡
~
2248 . C. 共享自行車
Submit
Status
Discussion / Solution
Ranklist
Back to Problems List
TopCoder
Caido
$\mathbb{W}\mathcal{aimai}\sim$
User's AC Ratio
95.8% (
115/120
)
Submission's AC Ratio
55.8% (
144
/
258
)
Tags
Show solution-related tags
TOI
TOI-pre
2022-TOI-pre
Description
題目 PDF 檔在這裡
Input Format
Output Format
Sample Input 1
copy
8 2
4 2 2 1 3 3 0 1
1 2 3
2 3 1
3 4 2
5 6 2
6 7 3
6 8 1
2 6 3
Sample Output 1
copy
21
Sample Input 2
copy
4 3
1 10 0 1
1 4 3
3 2 2
4 2 1
Sample Output 2
copy
16
Hints
Problem Source
2022 TOI 初選
測資來源:
TWPCA GitHub
Subtasks
No.
Testdata Range
Constraints
Score
1
0~1
範例測資。
0
2
2~12
$n \le 100$
10
3
13~22
自行車數量超過 $k$ 的租借站數量恰有一個
11
4
23~32
所有租借站位於一條直線上,如範例 2
17
5
33~42
無額外限制。
62
Testdata and Limits
No.
Time Limit (ms)
Memory Limit (VSS, KiB)
Output Limit (KiB)
Subtasks
0
1000
1048576
65536
1
1
1000
1048576
65536
1
2
1000
1048576
65536
2
3
1000
1048576
65536
2
4
1000
1048576
65536
2
5
1000
1048576
65536
2
6
1000
1048576
65536
2
7
1000
1048576
65536
2
8
1000
1048576
65536
2
9
1000
1048576
65536
2
10
1000
1048576
65536
2
11
1000
1048576
65536
2
12
1000
1048576
65536
2
13
1000
1048576
65536
3
14
1000
1048576
65536
3
15
1000
1048576
65536
3
16
1000
1048576
65536
3
17
1000
1048576
65536
3
18
1000
1048576
65536
3
19
1000
1048576
65536
3
20
1000
1048576
65536
3
21
1000
1048576
65536
3
22
1000
1048576
65536
3
23
1000
1048576
65536
4
24
1000
1048576
65536
4
25
1000
1048576
65536
4
26
1000
1048576
65536
4
27
1000
1048576
65536
4
28
1000
1048576
65536
4
29
1000
1048576
65536
4
30
1000
1048576
65536
4
31
1000
1048576
65536
4
32
1000
1048576
65536
4
33
1000
1048576
65536
5
34
1000
1048576
65536
5
35
1000
1048576
65536
5
36
1000
1048576
65536
5
37
1000
1048576
65536
5
38
1000
1048576
65536
5
39
1000
1048576
65536
5
40
1000
1048576
65536
5
41
1000
1048576
65536
5
42
1000
1048576
65536
5
Submit
Back to Top