Distributing the balls by sjoerd_visscher

main=interact$unlines.map(show.h.map read.words).lines\x0d
h[a,b]=f b*a#b\x0d
n#0=0\x0d
n#k|n==k=1\x0d
n#k=(n-1)#(k-1)+k*(n-1)#k\x0d
f 0=1\x0d
f n=n*f(n-1)

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

download

return to the top page