当前位置:网站首页>D28:maximum sum (maximum sum, translation)
D28:maximum sum (maximum sum, translation)
2022-07-03 23:14:00 【Aggressive Wenwen】
The original title is :OpenJudge - 1481:Maximum sum
translate :
describe : Give a group n It's an integer :A={a1,a2,...,an}, We define functions d(A) as follows :
t1 t2 d(A) = max{ ∑ai + ∑aj | 1 <= s1 <= t1 < s2 <= t2 <= n } i=s1 j=s2
Your task is to calculate d(A). Output only one line for each test case . This line should contain integers d(A);
Input : Input by T(T<=30) A test case consists of , The number of test cases (T) In the first line of input . Each test case contains two lines . The first line is an integer n(2<=n<=50000). The second line contains n It's an integer :a1,a2,..., One .(|ai| <= 10000). There is a blank line after each case ;
Output : Print one line for each test case , Contains integers d(A);
Tips : In the sample input , We choose {2,2,3,-3,4} and {5}, You can get the answer . The input is huge , Suggest using scanf.
边栏推荐
- Get current JVM data
- Introduction to the gtid mode of MySQL master-slave replication
- Qtoolbutton available signal
- How to switch between dual graphics cards of notebook computer
- NPM script
- Recursion and recursion
- [untitled]
- 2022 chemical automation control instrument examination content and chemical automation control instrument simulation examination
- . Net ADO splicing SQL statement with parameters
- Op amp related - link
猜你喜欢
4 environment construction -standalone ha
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
Unsafe and CAS principle
Exclusive download! Alibaba cloud native brings 10 + technical experts to bring "new possibilities of cloud native and cloud future"
User login function: simple but difficult
2/14 (regular expression, sed streaming editor)
Qtoolbutton - menu and popup mode
2022.02.13
How can enterprises and developers take advantage of the explosion of cloud native landing?
MLX90614 driver, function introduction and PEC verification
随机推荐
Classification and extension of OC
To rotate 90 degrees clockwise and modify the video format
What are the securities companies with the lowest Commission for stock account opening? Would you recommend it? Is it safe to open an account on your mobile phone
2.14 summary
Pyqt5 sensitive word detection tool production, operator's Gospel
How to solve win10 black screen with only mouse arrow
Shell script three swordsman awk
Xiangong intelligent obtained hundreds of millions of yuan of b-round financing to accelerate the process of building non-standard solutions with standardized products
Hcip day 12 notes
. Net ADO splicing SQL statement with parameters
Hcip 13th day notes
MLX90614 driver, function introduction and PEC verification
A preliminary study on the middleware of script Downloader
A treasure open source software, cross platform terminal artifact tabby
Pandaoxi's video
Blue Bridge Cup -- Mason prime
Ten minutes will take you in-depth understanding of multithreading. Multithreading on lock optimization (I)
Teach you how to run two or more MySQL databases at the same time in one system
Errors taken 1 Position1 argument but 2 were given in Mockingbird
EPF: a fuzzy testing framework for network protocols based on evolution, protocol awareness and coverage guidance