delete pics to save space
This commit is contained in:
16
1.1115.cpp
Normal file
16
1.1115.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include<cstdio>
|
||||
#include<algorithm>
|
||||
using namespace std;
|
||||
int n,x,res,now;
|
||||
int main()
|
||||
{
|
||||
scanf("%d%d",&n,&res); now=res;
|
||||
for(int i=1;i<n;i++)
|
||||
{
|
||||
scanf("%d",&x);
|
||||
now=max(now+x,x);
|
||||
res=max(now,res);
|
||||
}
|
||||
printf("%d\n",res);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user