1.27英文题面翻译

编程入门 行业动态 更新时间:2024-10-20 07:59:15

1.27<a href=https://www.elefans.com/category/jswz/34/1769696.html style=英文题面翻译"/>

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英文题面翻译

本文发布于:2024-02-27 05:07:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1705287.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:英文

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!