英文题面翻译"/>
1.27英文题面翻译
Given a set of n integers: A={a1, a2,..., an}, we define a function d(A) as below:
t1 t2 d(A) = max{ ∑ai + ∑aj | 1 <= s1 <= t1 < s2 <= t2 <= n }i=s1 j=s2
Your task is to calculate d(A).
输入
The input consists of T(<=30) test cases. The number of test cases (T) is given in the first line of the input.
Each test case contains two lines. The first line is an integer n(2<=n<=50000). The second line contains n integers: a1, a2, ..., an. (|ai| <= 10000).There is an empty line after each case.
输出
Print exactly one line for each test case. The line should contain the integer d(A).
翻译
描述
给出一组整数,定义如下函数:
t1 t2 d(A) = max{ ∑ai + ∑aj | 1 <= s1 <= t1 < s2 <= t2 <= n }i=s1 j=s2
你的任务是计算出d(A)
输入输入包含T(T<=30)组测试数据,测试数据总数在第一行给出。
每一组测试数据包含两行。第一行是一个整数n(2<=n<=50000)。第二行包含n个整数a1, a2, ..., an. (|ai| <= 10000).,每一组测试数据后有一行空格。
输出
每一组测试数据后只输出一行。这一行包含一个整数d(A)。
更多推荐
1.27英文题面翻译
发布评论