program r208;
var n,i,j,k,x:longint;
max,min,sum,c1,b1:int64;
begin
readln(n);
read(x); sum:=x;
min:=maxlongint;
max:=-maxlongint;
b1:=x;
if x>0 then c1:=0
else
c1:=x;
for i:=2 to n do
begin
read(x);
sum:=sum+x;
if b1>0 then
b1:=b1+x
else b1:=x;
if b1>max then max:=b1;
if c1<0 then
c1:=c1+x
else c1:=x;
if c1>0 then c1:=0;
if c1<min then min:=c1;
end;
if sum-min>max then write(sum-min)
else write(max);
end.
大牛们帮忙看一下哪里错了,第三个点老错,还有第8和第十个点超时。
谁知道那些耗时八十几ms的怎么写的啊?