Toggle navigation
Bulletin
Problems
Submissions
Contests
Discuss
About
Rank
Sign in
Sign up
×
Close
2024 全國模擬賽題目上線啦 !!!!!
題目在
這裡
~
2231 . I. 黑白機
Submit
Status
Discussion / Solution
Ranklist
Back to Problems List
TopCoder
Caido
$\mathbb{W}\mathcal{aimai}\sim$
User's AC Ratio
70.0% (
21/30
)
Submission's AC Ratio
30.1% (
56
/
186
)
Tags
Show solution-related tags
全國賽
2020-全國賽
nhspc109
Description
題目 PDF 檔在這裡
Input Format
Output Format
Sample Input 1
copy
4
2 2 3 5
1 1 7 2
4 1 1 1
Sample Output 1
copy
10
Sample Input 2
copy
3
4 3 3
1 7 2
2 3 1
Sample Output 2
copy
9
Sample Input 3
copy
5
1 1 9 1 4
3 3 2 5 2
7 1 2 1 2
Sample Output 3
copy
14
Hints
Problem Source
109 學年度全國資訊學科能力競賽
Subtasks
No.
Testdata Range
Constraints
Score
1
0~2
範例測資。
0
2
3~15
$n \le 20$。
9
3
16~32
$n \le 3000$。
17
4
33~54
無額外限制。
74
Testdata and Limits
No.
Time Limit (ms)
Memory Limit (VSS, KiB)
Output Limit (KiB)
Subtasks
0
1000
131072
65536
1
1
1000
131072
65536
1
2
1000
131072
65536
1
3
1000
131072
65536
2
4
1000
131072
65536
2
5
1000
131072
65536
2
6
1000
131072
65536
2
7
1000
131072
65536
2
8
1000
131072
65536
2
9
1000
131072
65536
2
10
1000
131072
65536
2
11
1000
131072
65536
2
12
1000
131072
65536
2
13
1000
131072
65536
2
14
1000
131072
65536
2
15
1000
131072
65536
2
16
1000
131072
65536
3
17
1000
131072
65536
3
18
1000
131072
65536
3
19
1000
131072
65536
3
20
1000
131072
65536
3
21
1000
131072
65536
3
22
1000
131072
65536
3
23
1000
131072
65536
3
24
1000
131072
65536
3
25
1000
131072
65536
3
26
1000
131072
65536
3
27
1000
131072
65536
3
28
1000
131072
65536
3
29
1000
131072
65536
3
30
1000
131072
65536
3
31
1000
131072
65536
3
32
1000
131072
65536
3
33
1000
131072
65536
4
34
1000
131072
65536
4
35
1000
131072
65536
4
36
1000
131072
65536
4
37
1000
131072
65536
4
38
1000
131072
65536
4
39
1000
131072
65536
4
40
1000
131072
65536
4
41
1000
131072
65536
4
42
1000
131072
65536
4
43
1000
131072
65536
4
44
1000
131072
65536
4
45
1000
131072
65536
4
46
1000
131072
65536
4
47
1000
131072
65536
4
48
1000
131072
65536
4
49
1000
131072
65536
4
50
1000
131072
65536
4
51
1000
131072
65536
4
52
1000
131072
65536
4
53
1000
131072
65536
4
54
1000
131072
65536
4
Submit
Back to Top