##### 这是写的是 $O(n^{2})$ 算法啊, $ n = 200000 $ 会 $TLE$ 的。
by Playnext @ 2018-06-02 16:39:25
@[Playnext](/space/show?uid=51658) 你能帮我改一下吗
by Well_whz @ 2018-06-03 20:39:34
@[Well_whz](/space/show?uid=57931)
```cpp
#include<cstdio>
#include<algorithm>
using namespace std;
int a[200001],ans=-0x7fffffff,tem,n;
int main()
{
scanf("%d",&n);
for(int i=1;i<=n;i++){
scanf("%d",&a[i]);
tem=max(a[i],tem+a[i]);
ans=max(ans,tem);
}
printf("%d",ans);
return 0;
}
```
by Playnext @ 2018-06-03 20:47:03