Toggle navigation
CGOJ
F.A.Qs
ProblemSet
Source/Category
Status
Ranklist
Contest
Login
Language
中文
ئۇيغۇرچە
English
فارسی
ไทย
한국어
Problem I: 分割队伍
Problem I: 分割队伍
[Creator :
]
Time Limit :
1.000
sec
Memory Limit :
128 MiB
Submit
ProblemList
Solved: 3
Submit Num: 14
Statistics
ShowOff!
Description
给定一个长度为
lns="http://www.w3.org/1998/Math/MathML">
N
N
的数列
lns="http://www.w3.org/1998/Math/MathML">
A
1
,
A
2
,
A
3
,
…
,
A
N
A
1
,
A
2
,
A
3
,
…
,
A
N
,请找一个切割点,将它分成前后两部分,求出这两部分的和,请问应该如何切割,才能让这两个和的差距最小。输出这个最小的差距。
Input
第一行,单个整数
lns="http://www.w3.org/1998/Math/MathML">
n
n
第二行,
lns="http://www.w3.org/1998/Math/MathML">
n
n
个整数
lns="http://www.w3.org/1998/Math/MathML">
a
1
,
a
2
,
…
,
a
n
a
1
,
a
2
,
…
,
a
n
对于
lns="http://www.w3.org/1998/Math/MathML">
30
%
3
0
%
的数据,
lns="http://www.w3.org/1998/Math/MathML">
1
≤
n
≤
100
1
≤
n
≤
1
0
0
对于
lns="http://www.w3.org/1998/Math/MathML">
70
%
7
0
%
的数据,
lns="http://www.w3.org/1998/Math/MathML">
1
≤
n
≤
10000
1
≤
n
≤
1
0
0
0
0
对于
lns="http://www.w3.org/1998/Math/MathML">
100
%
1
0
0
%
的数据,
lns="http://www.w3.org/1998/Math/MathML">
1
≤
n
≤
100000
1
≤
n
≤
1
0
0
0
0
0
lns="http://www.w3.org/1998/Math/MathML">
1
≤
a
i
≤
10000
1
≤
a
i
≤
1
0
0
0
0
Output
单个整数:表示前后两部分总和差距的最小值。
Sample Input
Copy
3 100 1 1
Sample Output
Copy
98
HINT
100-(1+1)