Maximum Cyclic Segment Sum

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Maximum Segment Sum is a problem to find the segment,
of which summation is the maximum of the sums of all segments.

There exists the difference between Maximum Segment Sum and this problem.
"segment" in this problem includes cyclic shifted sequence's one.
For example, see 1st problem set.

Options

exec is denied

now post-mortem time, all source codes will be revealed

Sample input:_

1004 -2010 2008 -2011 1005

Sample output:

1005 1004

Sample input:_

-45 -8 -37 13 17 14 0 36 16 -35 -47 28 40 -1 27 -10 -42 -46 43 -32 49 17 12 -33 -23 2 2 -29 -17 -21 -34 -12 19 -21 -49 -12 42 0 -26 9 13 -23 -12 4 25 -34 44 33 -31 37
20 47 -23 39 -12 -49 40 0 38 49 45 -16 47 37 -9 26 -17 -14 -24 24 -19 -13 -23 43 -48 -42 26 46 38 -15 10 8 -18 37 -1 19 37 -11 -29 25 -11 -34 -41 -13 -47 0 -36 -14 35 -11
-9 -31 -13 39 46 -29 9 27 9 -49 -17 13 1 -27 -35 -11 -19 -29 33 -47 -15 -8 -21 -12 26 -12 -28 -9 39 30 49 -20 48 -14 -30 45 5 28 23 -34 28 -44 28 -19 -21 43 18 8 -36 1
-2 20 43 -43 -18 -38 33 36 34 -16 41 33 -19 48 -37 -15 24 35 1 -27 -9 8 6 25 -25 -41 43 24 -26 -41 32 21 28 25 27 -39 36 11 46 21 45 38 4 -24 37 16 9 11 1 -39
-17 -9 31 -18 -24 24 46 43 2 -10 42 -34 -25 2 -27 2 -32 -37 19 3 14 15 27 -3 -17 -12 -12 -32 14 -34 25 46 5 6 -21 31 -19 -25 24 33 14 16 48 38 -30 -29 -9 -13 -16 -40

Sample output:

13 17 14 0 36 16 -35 -47 28 40 -1 27
35 -11 20 47 -23 39 -12 -49 40 0 38 49 45 -16 47 37 -9 26 -17 -14 -24 24 -19 -13 -23 43 -48 -42 26 46 38 -15 10 8 -18 37 -1 19 37
39 30 49 -20 48 -14 -30 45 5 28 23 -34 28 -44 28 -19 -21 43 18 8 -36 1 -9 -31 -13 39 46 -29 9 27 9
33 36 34 -16 41 33 -19 48 -37 -15 24 35 1 -27 -9 8 6 25 -25 -41 43 24 -26 -41 32 21 28 25 27 -39 36 11 46 21 45 38 4 -24 37 16 9 11 1 -39 -2 20 43
25 46 5 6 -21 31 -19 -25 24 33 14 16 48 38

Sample input:_

-15 -10 -7 -24 -45 48 -40 -15 33 -4
7 11 -34 -35 45 -2 34 -49 8 22
-34 -25 -32 34 29 -31 -4 44 -35 -42
16 13 -20 8 -16 -26 48 -47 -21 16
-32 3 -8 32 37 28 -48 -41 42 26
25 -34 -5 -47 20 48 -37 3 -2 10
26 5 -43 26 -24 3 -34 -39 11 19
-29 9 39 -21 -47 46 -37 34 47 -37
7 -10 -18 34 49 -27 0 20 -8 30
-20 -38 3 22 -9 21 25 -14 -33 6

Sample output:

48
45 -2 34
34 29 -31 -4 44
48
42 26 -32 3 -8 32 37 28
20 48
11 19 26 5
46 -37 34 47
34 49 -27 0 20 -8 30 7
3 22 -9 21 25

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1kaki841.09762009/01/08 18:04:510B / 39B / 40B
2leonid871.00572009/01/09 11:43:140B / 36B / 46B
3flagitious910.10782009/01/02 13:22:530B / 42B / 41B
4ksk990.26112009/01/02 01:25:460B / 49B / 46B
5murky-satyr1030.69892009/01/05 05:51:520B / 53B / 43B
6shinh1070.14882009/01/10 04:20:290B / 54B / 44B
7mokos1020.94162009/01/24 11:32:130B / 48B / 45B

Perl _

RankUserSizeTimeDateStatistics
1ySas790.45322009/01/07 22:41:010B / 32B / 45B
2Mithran1061.17452009/01/04 23:15:560B / 38B / 61B

Python _

RankUserSizeTimeDateStatistics
1hallvabo (embed)1180.12962009/01/14 23:13:0525B / 46B / 42B
2recursive1270.23022009/01/03 06:18:380B / 79B / 39B
3hallvabo1550.26212009/01/03 04:43:240B / 83B / 56B

Common LISP _

RankUserSizeTimeDateStatistics
1kozima2000.86952009/01/04 09:21:110B / 108B / 74B

Arc _

RankUserSizeTimeDateStatistics
1murky-satyr1104.49022009/11/30 01:45:210B / 61B / 41B

JavaScript _

RankUserSizeTimeDateStatistics
1nn1091.08492009/01/06 14:51:570B / 47B / 58B
2murky-satyr1220.27302009/01/05 15:50:270B / 61B / 56B
3ktt1380.13422009/01/10 13:10:300B / 68B / 68B

J _

RankUserSizeTimeDateStatistics
1pooq1040.18552009/01/06 02:00:170B / 30B / 69B
2I., S.670.16302011/06/01 21:35:240B / 18B / 47B
3pooq910.12012011/01/30 09:05:390B / 30B / 57B

C _

RankUserSizeTimeDateStatistics
151b(embed)1660.04772009/01/10 17:26:0925B / 66B / 73B
251b1790.04832009/01/10 15:53:090B / 88B / 91B

D _

RankUserSizeTimeDateStatistics
151b2030.06302009/01/10 15:55:450B / 108B / 91B

Haskell _

RankUserSizeTimeDateStatistics
1Test1660.15462008/12/31 23:25:310B / 117B / 39B
2tttaki2160.36062009/01/12 21:32:390B / 120B / 78B

Pascal _

RankUserSizeTimeDateStatistics
1uru3140.07592009/01/02 17:19:480B / 194B / 89B

AWK _

RankUserSizeTimeDateStatistics
1nn790.07832009/01/07 23:27:240B / 36B / 43B
2yamaya800.06262009/01/06 22:35:260B / 36B / 43B

Bash _

RankUserSizeTimeDateStatistics
1yamaya(embed)1430.17832009/01/07 23:49:300B / 74B / 41B

Postscript _

RankUserSizeTimeDateStatistics
1ySas1181.34442009/01/10 15:56:3750B / 31B / 35B
2yshl(embed)1181.14612009/01/10 18:30:5059B / 41B / 13B
3yshl(bin)1341.37212009/01/10 21:11:0966B / 39B / 25B
4ySas (not bin)2341.33402009/01/10 19:24:090B / 176B / 31B
5yshl2461.27932009/01/10 21:10:560B / 179B / 29B

goruby _

RankUserSizeTimeDateStatistics
1murky-satyr740.75662009/01/05 05:44:510B / 29B / 41B
2murky-satyr641.06902009/11/29 23:03:510B / 27B / 32B

Groovy _

RankUserSizeTimeDateStatistics
1murky-satyr1235.04352009/12/01 00:45:360B / 70B / 52B
2nn1439.49292009/10/21 12:40:580B / 78B / 58B

Language Ranking_

RankLangUserSizeScore
1gorubymurky-satyr6410000
2JI., S.679552
3PerlySas798101
4AWKnn798101
5Rubykaki847619
6JavaScriptnn1095871
7Arcmurky-satyr1105818
8PostscriptySas1185423
9Pythonhallvabo (embed)1185423
10Groovymurky-satyr1235203
11Bashyamaya(embed)1434475
12HaskellTest1663855
13C51b(embed)1663855
14Common LISPkozima2003200
15D51b2033152
16Pascaluru3142038

return top