| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 436 人关注过本帖
标题:那位大神能给解释下题意
只看楼主 加入收藏
hedaacm
Rank: 6Rank: 6
来 自:河北保定
等 级:侠之大者
威 望:2
帖 子:400
专家分:418
注 册:2012-1-26
结帖率:79.41%
收藏
已结贴  问题点数:20 回复次数:4 
那位大神能给解释下题意
哪位大神 能给解释下题意

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<=T<=20) which means the number of test cases. Then T lines follow, each line starts with a number N(1<=N<=100000), then N integers followed(all the integers are between -1000 and 1000).
 

Output
For each test case, you should output two lines. The first line is "Case #:", # means the number of the test case. The second line contains three integers, the Max Sum in the sequence, the start position of the sub-sequence, the end position of the sub-sequence. If there are more than one result, output the first one. Output a blank line between two cases.
 

Sample Input
2
5 6 -1 5 4 -7
7 0 6 -1 1 -6 7 -5
 

Sample Output
Case 1:
14 1 4

Case 2:
7 1 6
搜索更多相关主题的帖子: 1000 max sequence between example 
2012-03-24 21:23
绿茶盖儿
Rank: 10Rank: 10Rank: 10
等 级:青峰侠
威 望:1
帖 子:363
专家分:1852
注 册:2011-9-3
收藏
得分:5 
问题描述:给定一个序列,让你求这个序列中的一个子序列,使得该子序列中元素的和是所有子序列中最大的
输入:第一行输入共有几个测试序列(T个),余下T行分别输入这T个测试序列中元素的个数N及这N个元素的值
输出:对于每个测试序列,其输出包含两行,第一行Case #,"#"表示序列的序号,第二行的输出包含三项,第一项是所求子序列的元素的和的值,第二项是该子序列在原序列中的起始位置,第三项是该子序列在原序列中结束位置。
大概就是这个意思吧,不知道我说清楚没有。
2012-03-24 21:51
爱德华
Rank: 7Rank: 7Rank: 7
等 级:黑侠
威 望:2
帖 子:183
专家分:536
注 册:2011-5-29
收藏
得分:5 
看见英文就头疼

算法,数据结构,windows核心编程.
2012-03-26 18:26
Adm〃h
Rank: 2
等 级:论坛游民
帖 子:26
专家分:18
注 册:2012-3-26
收藏
得分:5 
英语是什么。好吃吗?

当一个问题思考许久后却还是不得其解时 我会去睡一觉或出去走走之后我可能会灵感爆发。
2012-03-27 10:30
Devil_W
Rank: 10Rank: 10Rank: 10
等 级:青峰侠
威 望:9
帖 子:1160
专家分:1797
注 册:2009-9-14
收藏
得分:5 
最大整数和序列。

瞄一眼就知道什么了吧。
2012-03-27 10:31
快速回复:那位大神能给解释下题意
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015692 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved