解法一:直接求解下标i~j的子数组和最大值;复杂度O(N^2);代码如下: 1 #include 2 using namespace std; 3 const int INF=1000000; 4 5 int maxSum(int arr[],int n); 6 7 int main() 8 {... Read More
posted @ 2014-08-18 20:14 chengcy Views(156) Comments(0) Diggs(0)