Problem A: 最大子段和
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:36
Solved:10
Description
给一个长度为 $n$ 的整数序列 $a$,选出其中连续且非空的一段使这段的和最大。
Input
第一行一个整数 $n$ ,表示数列的长度
第二行 $n$ 个整数,表示数列 $a_i$
Output
一行一个整数,表示最大子段和
Sample Input Copy
7
2 3 4 -5 6 -1 2
Sample Output Copy
11
HINT
对于 $50\%$ 的数据,保证 $n≤5000$
对于 $100\%$ 的数据,保证 $n≤2×10^5$,$∣a_i∣≤10^9$