Toggle navigation
Bulletin
Problems
Submissions
Contests
Discuss
About
Rank
Teams
Sign in
Sign up
×
Close
IOIC 2025 題目已公開!
連結
程式解題社網站
程式解題社網站
上線了!
NTUCPC OJ 現在支援 Rust !
NTUCPCPC 2026 初賽 & 決賽題目已公開!
連結
1474 . 除草
Submit
Status
Discussion / Solution
Ranklist
Back to Problems List
TopCoder
Emmetthor
User's AC Ratio
100.0% (
5/5
)
Submission's AC Ratio
66.7% (
6
/
9
)
Tags
Show solution-related tags
ntucpcpc
ntucpcpc-2026
Description
題目 PDF 檔在這裡
Input Format
Output Format
Sample Input 1
copy
3 4 0 10 10 1 2 3 2 3 0 10 10 1
Sample Output 1
copy
12
Sample Input 2
copy
4 5 0 0 0 1 0 9 9 9 9 9 9 9 9 9 9 0 1 1 1 1
Sample Output 2
copy
5
Hints
Problem Source
Subtasks
No.
Testdata Range
Score
Testdata and Limits
No.
Time Limit (ms)
Memory Limit (VSS, KiB)
Output Limit (KiB)
Subtasks
0
1000
2097152
65536
1
1000
2097152
65536
2
1000
2097152
65536
3
1000
2097152
65536
4
1000
2097152
65536
5
1000
2097152
65536
6
1000
2097152
65536
7
1000
2097152
65536
8
1000
2097152
65536
9
1000
2097152
65536
10
1000
2097152
65536
11
1000
2097152
65536
12
1000
2097152
65536
13
1000
2097152
65536
14
1000
2097152
65536
15
1000
2097152
65536
16
1000
2097152
65536
17
1000
2097152
65536
18
1000
2097152
65536
19
1000
2097152
65536
20
1000
2097152
65536
21
1000
2097152
65536
22
1000
2097152
65536
23
1000
2097152
65536
24
1000
2097152
65536
25
1000
2097152
65536
26
1000
2097152
65536
27
1000
2097152
65536
28
1000
2097152
65536
29
1000
2097152
65536
30
1000
2097152
65536
31
1000
2097152
65536
32
1000
2097152
65536
33
1000
2097152
65536
34
1000
2097152
65536
35
1000
2097152
65536
36
1000
2097152
65536
37
1000
2097152
65536
38
1000
2097152
65536
39
1000
2097152
65536
40
1000
2097152
65536
41
1000
2097152
65536
42
1000
2097152
65536
43
1000
2097152
65536
44
1000
2097152
65536
45
1000
2097152
65536
46
1000
2097152
65536
47
1000
2097152
65536
48
1000
2097152
65536
49
1000
2097152
65536
50
1000
2097152
65536
51
1000
2097152
65536
52
1000
2097152
65536
Submit
Back to Top