Maximum Cyclic Segment Sum by nn

for(;s=readline(m=0);print(o))for(;/ /g(l=s);)for(s=v=+/\S+$/(l);u=/\S+ /g(l);v-=-u,s+=' '+ +u)v>m&&(o=s,m=v)

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

download

return to the top page