滴滴 连续最大和 分治
题目链接题目描述一个数组有 N 个元素,求连续子数组的最大和。 例如:[-1,2,1],和最大的连续子数组为[2,1],其和为 3#include<iostream> #include<algorithm> using namespace std; const int maxn =1e5+5; int arr[maxn]; int div(int arr[],int ...
题目链接题目描述一个数组有 N 个元素,求连续子数组的最大和。 例如:[-1,2,1],和最大的连续子数组为[2,1],其和为 3#include<iostream> #include<algorithm> using namespace std; const int maxn =1e5+5; int arr[maxn]; int div(int arr[],int ...