当前位置:网站首页>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.
边栏推荐
- SDMU OJ#P19. Stock trading
- How about opening an account at Hengtai securities? Is it safe?
- [automation operation and maintenance novice village] flask-2 certification
- How to restore the factory settings of HP computer
- Pan Yueming helps Germany's Rochester Zodiac custom wristwatch
- Arc135 partial solution
- Simple solution of m3u8 file format
- Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
- 2.14 summary
- Yyds dry goods inventory Prometheus alarm Art
猜你喜欢
Sort merge sort
QT creator source code learning note 05, how does the menu bar realize plug-in?
Hcip day 15 notes
Current detection circuit - including op amp current scheme
How to switch between dual graphics cards of notebook computer
User login function: simple but difficult
Weekly leetcode - nc9/nc56/nc89/nc126/nc69/nc120
Pyqt5 sensitive word detection tool production, operator's Gospel
Shiftvit uses the precision of swing transformer to outperform the speed of RESNET, and discusses that the success of Vit does not lie in attention!
4 environment construction -standalone ha
随机推荐
Current detection circuit - including op amp current scheme
Programming language (2)
How about opening an account at Hengtai securities? Is it safe?
Sword finger offer day 4 (Sword finger offer 03. duplicate numbers in the array, sword finger offer 53 - I. find the number I in the sorted array, and the missing numbers in sword finger offer 53 - ii
Pan Yueming helps Germany's Rochester Zodiac custom wristwatch
File copy method
Minimum commission for stock account opening. Stock account opening is free. Is online account opening safe
How can enterprises and developers take advantage of the explosion of cloud native landing?
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
The 2022 global software R & D technology conference was released, and world-class masters such as Turing prize winners attended
finalize finalization finally final
Gorilla/mux framework (RK boot): add tracing Middleware
How to understand the gain bandwidth product operational amplifier gain
Meta metauniverse female safety problems occur frequently, how to solve the relevant problems in the metauniverse?
炒股开户佣金优惠怎么才能获得,网上开户安全吗
How to solve the problem of requiring a password when accessing your network neighborhood on your computer
Scratch uses runner Py run or debug crawler
Pyqt5 sensitive word detection tool production, operator's Gospel
Pointer concept & character pointer & pointer array yyds dry inventory
Take you to master the formatter of visual studio code