Maximum Cyclic Segment Sum by kozima

(loop(format(#1=dotimes(i(setf y()m 0 a()x(read-from-string(format()"(~A)"(read-line)))d`(,@x,@x)l(length x))t)(#1#(j l)(if(>(setf s(subseq d i(+ i j 1))v(apply'+ s))m)(setf m v a s))))"~{~D~^ ~}
"a))

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

download

return to the top page