仔细比对了题解的代码和我的代码,发现没什么区别,怎么我的只有40分
#include <iostream>
using namespace std;
long long n, arr[30000], b[30000], maxx = -9999999;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
cin >> n;
for (int i = 1; i <= n; ++i)
{
cin >> arr[i];
b[i] = max(arr[i], b[i - 1] + arr[i]);
maxx = max(b[i], maxx);
}
cout << maxx;
return 0;
}