当前位置:网站首页>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.
边栏推荐
- The reason why the computer runs slowly and how to solve it
- Unity shader visualizer shader graph
- How can enterprises and developers take advantage of the explosion of cloud native landing?
- Blue Bridge Cup -- guess age
- Teach you how to run two or more MySQL databases at the same time in one system
- Op amp related - link
- Wisdom tooth technology announced that it had completed the round D financing of US $100million and had not obtained a valid patent yet
- 2022 a special equipment related management (elevator) examination questions and a special equipment related management (elevator) examination contents
- How to prevent malicious crawling of information by one-to-one live broadcast source server
- 2022 t elevator repair registration examination and the latest analysis of T elevator repair
猜你喜欢
2022 a special equipment related management (elevator) examination questions and a special equipment related management (elevator) examination contents
Unique in China! Alibaba cloud container service enters the Forrester leader quadrant
The first game of the new year, many bug awards submitted
SDMU OJ#P19. Stock trading
The difference between SRAM and DRAM
How to switch between dual graphics cards of notebook computer
[note] IPC traditional interprocess communication and binder interprocess communication principle
What are the common computer problems and solutions
Teach you how to run two or more MySQL databases at the same time in one system
2 spark environment setup local
随机推荐
Ppt image processing
Comparable interface and comparator interface
Unique in China! Alibaba cloud container service enters the Forrester leader quadrant
2/14 (regular expression, sed streaming editor)
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
[network security] what is emergency response? What indicators should you pay attention to in emergency response?
2 spark environment setup local
Live app source code, jump to links outside the station or jump to pages inside the platform
Pandaoxi's video
540. Single element in ordered array
Pan Yueming helps Germany's Rochester Zodiac custom wristwatch
Yyds dry goods inventory Prometheus alarm Art
Label coco format data and format data in the upper left corner and lower right corner are mutually converted
3 environment construction -standalone
How to write a good title of 10w+?
To rotate 90 degrees clockwise and modify the video format
User login function: simple but difficult
Summary of fluent systemchrome
Comment obtenir une commission préférentielle pour l'ouverture d'un compte en bourse? Est - ce que l'ouverture d'un compte en ligne est sécurisée?
Go Technology Daily (2022-02-13) - Summary of experience in database storage selection