Maximum Cyclic Segment Sum by yshl

10{/a[]def a 0 def(%stdin)(r)file 200 string readline pop cvx exec count{0 1
count 3 sub{array astore dup 0 exch{add}forall dup a load gt{/a 2 index def def
a[}if pop aload pop}for count 1 roll}repeat()a{exch print =only( )}forall/ =

Note that non-ascii characters in the above source code will be escaped (such as \x9f).


return to the top page