HDU 1003 联机算法
来源:互联网 发布:pl sql mysql 编辑:程序博客网 时间:2024/06/05 18:02
Max Sum
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 188183 Accepted Submission(s): 43850
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
25 6 -1 5 4 -77 0 6 -1 1 -6 7 -5
Sample Output
Case 1:14 1 4Case 2:7 1 6
Author
Ignatius.L
0 0
- HDU 1003 联机算法
- BestCoder Round #64 (div.2) 1002 Sum HDU 5586 联机算法
- 联机
- 联机算法求最大子序列和
- 最大子序问题的联机算法
- 联机算法求最大子序列和
- 联机算法 与 递归调用 的分析
- 不相交集ADT(联机算法 + 脱机算法)
- 读书笔记:数组最大子序列问题 及 联机算法
- 近似装箱问题(三种联机算法实现)
- java实现基于SM4算法计算联机MAC数据
- 联机算法——最大子数组问题
- 【数据结构和算法分析】最大子序列求和问题及联机算法
- 联机备份
- ubuntu 联机
- 联机错误
- iax联机
- 网络联机
- 测试用例各要素编写规范
- 二叉堆(优先队列)
- Map接口、Collections接口
- 将项目打包为一个可执行jar
- 利用Javascript去操作UIWebView的广告内容
- HDU 1003 联机算法
- 通讯录
- Java中server层、modle层和dao层的区别和功能介绍
- 印制电路板特性阻抗的生产可行性设计
- Apache 2.2主配置文件/etc/httpd/conf/httpd.conf配置解说
- 对抽屉效果几大github第三方库的
- 同行评审的五个方法都是怎样实现的有什么区别
- 硬盘分区2----GPT与MBR的区别
- Mysql 主键