最大連續子序列和

給定一個數字序列a1,a2……an,求其中一段連續的子序列具備最大的和,輸出這個最大和。ios 樣例:web 6 -2 11 -4 13 -5 -2svg 輸出spa 20code 顯然11+(-4)+13=20爲最大子序列和xml 暴力寫法token 枚舉左右端點ci #include<iostream> #include<algorithm> using namespace std; int
相關文章
相關標籤/搜索