Submit | All submissions | Best solutions | Back to list |
EISUBARRAY - Subarray with the largest sum |
Given an array of integers A. A subarray of array A is an array of zero or more consecutive elements in A. Given array A, find the largest possible absolute sum of a non-empty subarray of A.
Input
The first line is an integer n 9 (n <= 106)
The second line is the n integers of array A.
The first line is an integer n (n <= 106)
The second line is the n integers of array A.
Output
The largest possible sum
Example
Input:
7
-1 2 4 -1 6 -10 1
Output:
11
Added by: | Ha Minh Ngoc |
Date: | 2019-04-09 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: GOSU |