Max Sum

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 207874    Accepted Submission(s): 48646

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

 
Author
Ignatius.L
 
Max Sum

Time Limit: / MS (Java/Others)    Memory Limit: / K (Java/Others)
Total Submission(s): Accepted Submission(s): Problem Description
Given a sequence a[],a[],a[]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (,-,,,-), the max sum in this sequence is + (-) + + = . Input
The first line of the input contains an integer T(<=T<=) which means the number of test cases. Then T lines follow, each line starts with a number N(<=N<=), then N integers followed(all the integers are between - and ). 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 - -
- - - Sample Output
Case : Case : Author
Ignatius.L
 

最新文章

  1. [C#] 走进异步编程的世界 - 剖析异步方法(上)
  2. c#线程间操作无效: 从不是创建控件“textBox1”的线程访问它
  3. ionic
  4. SDK接入(U8SDK)——SDK抽象层的设计
  5. JS代码格式化和语法着色
  6. Xcode真机调试中&quot;There was an internal API error&quot;错误解决方法
  7. NOI剑客决斗
  8. NGUI基础之button(按钮)
  9. Asp.Net 之 WebService部署到服务器后出现&quot; The test form is only available for requests from the local machine &quot;
  10. C#边边角角(一)
  11. 解决mydql执行sql文件时报Error: Unknown storage engine &#39;InnoDB&#39;的错误。
  12. OpenStack架构详解
  13. Python selenium webdriver设置js操作页面滚动条
  14. django 存在则忽略, 不存在则创 TagSheet.objects.get_or_create(tag=&#39;test&#39;)
  15. BZOJ 4591 【SHOI2015】 超能粒子炮&#183;改
  16. kafka安装和部署
  17. YOLO V1论文理解
  18. Eclipse “cannot be resolved to a type”
  19. 多进程监控自动关机工具升级远程关闭多台server——C# works with PowerShell
  20. 【顽固BUG】Visual Studio 2015 + TestDriven.NET-3.8.2860_Personal_Beta 调用的目标发生了异常。

热门文章

  1. 融合libevent和protobuf
  2. MYSQL三个默认库的介绍
  3. dedecms织梦 v5.6 两处跨站漏洞
  4. 微软URLRewriter.dll的url重写的简单使用(实现伪静态)
  5. jquery easyui里datagrid用法记录
  6. Android触控屏幕Gesture(GestureDetector和SimpleOnGestureListener的使用教程) 分类:Androidandroid实例
  7. Linux0.11内核剖析--内核代码(kernel)--sched.c
  8. Chrome 制作绿色便携版
  9. Transform数据权限浅析1之mdl语句批量加载权限
  10. token 案例,只是测试,功能并不完善(只是看看token 到底是何方神圣)