HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > "Informatics Stars" Online Contests - 2011-2014 > problem:


2012-10-04. 50598 - Minimum Sum

"Informatics Stars" Online Contests - 2011-2014

Start: Oct.20.2012 at 10:00:00 AM
Finish: Oct.20.2012 at 03:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 2012-02-5. 50768 - Where is Waldorf?
• 2012-02-7. 50704 - Connected?
• 2012-02-8. 50596 - Your Ride Is He...
• 2012-02-8. 50596 - Your Ride Is He...
• 2012-03-01. 50563 - Long Modulus
• 2012-03-02. 50567 - Input Data No...
• 2012-03-04. 50597 - Drawing Diam...
• 2012-10-02. 50555 - Frequency of L...
• 2012-10-04. 50598 - Minimum Sum
• 2012-11-30. 50656 - Divisibility by 11
• 2012-11-40. 50558 - Biggest Barn
• 2012-12-10. 50546 - Average Fuel P...
• 2012-12-20. 50574 - Triangular Nu...
• 2012-12-30. 50684 - Sum of prime ...
• 2013-01-10. 50584 - Total invoice ...
• 2013-01-30. 50599 - Sum of Squar...
• 2013-03-20. 50578 - Mersenne prime

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Minimum Sum

Shqip

In computer science, the maximum subarray sum problem is the task of finding the contiguous subarray within a one-dimensional array of numbers (containing at least one positive number) which has the largest sum. For example, if the largest sum is asked for the sequence of values -2, 1, -3, 4, -1, 2, 1, -5, 4; the contiguous subarray with the largest sum is 4, -1, 2, 1, with the sum 6.

Similar to Maximum subarray sum, Write a program that reads a sequence of integers, (possibly with positive and negative values), and defines the minimum sequential sum and its starting and ending positions in the array.

Input specification
You will be given comma-separate positive or negative integers. The sequence will contain at least one negative number and may contain at most 100.000 integers ending with a semicolon (;). The numbers in the sequence are between -1000 and 1000.
Note: The position of the first number is one (1).
           There are at most 100 numbers per line.

Output specification
Show the minimum sequential sum (sum) followed by starting and ending positions of the minimum sum. Note: There can be several mins having the same result, you will show the first occurrence.

Sample Input I     
-2, 1, -3, 4, -1, 2, -1, -5, 7, -6, 4;   
Sample Output I
-6 7 8

Sample Input II
3, -5, -3, 0, 1, -1, 9, -3, -7, 10, -17;
Sample Output II
-17 11 11

Для отправки решений необходимо выполнить вход.

www.contester.ru