问题: 给定一整数序列A1, A2,... An (可能有负数),求A1~An的一个子序列Ai~Aj,使得Ai到Aj的和最大 例如:整数序列-2, 11, -4, 13, -5, 2, -5, -3, 12, -9的最大子序列的和为21。 从左到右记录当前子序列的和sum,开始位置为start,结束 Read More
posted @ 2016-10-11 11:53 虫儿ls Views(283) Comments(0) Diggs(0) Edit
import java.util.Scanner; import java.util.Stack; public class Test15 { public static void main(String[] args){ Scanner sc = new Scanner(System.in); while(sc.hasNext()){ ... Read More
posted @ 2016-10-11 11:51 虫儿ls Views(147) Comments(0) Diggs(0) Edit