早教吧 育儿知识 作业答案 考试题库 百科 知识分享

英语翻译ProblemDescriptionGivenasequencea[1],a[2],a[3].a[n],yourjobistocalculatethemaxsumofasub-sequence.Forexample,given(6,-1,5,4,-7),themaxsuminthissequenceis6+(-1)+5+4=14.InputThefirstlineoftheinputcontains

题目详情
英语翻译
Problem Description
Given a sequence a[1],a[2],a[3].a[n],your job is to calculate the max sum of a sub-sequence.For example,given (6,-1,5,4,-7),the max sum in this sequence is 6 + (-1) + 5 + 4 = 14.
Input
The first line of the input contains an integer T(1
▼优质解答
答案和解析
问题描述
给出一个数列a[1],a[2],a[3].a[n],你的工作是计算这个子数列的最大和.例如,给出数列(6,-1,5,4,-7),那么这个数列的最大和就是6 + (-1) + 5 + 4 = 14.
输入
第一行包括一个整数T(1