shiro #4492(2007/11/30 02:50 GMT) [ Haskell ] Rating4/4=1.00
1 2 3 4 5 6 7 8 9 10 11 12 13
module Main where import Data.List import qualified System.IO.UTF8 as U partitionNum n = sortBy cmp $ pttn n n where cmp a b | length a < length b = LT | length a == length b = EQ | otherwise = GT pttn 0 _ = [[]] pttn n k = [(n-x):xs | x <- [max (n-k) 0..n-1], xs <- pttn x (n-x)] main = U.putStr $ unlines $ foldr chunk [] $ partitionNum 50 where chunk ns r = map (\n -> replicate n '□') ns ++ [""] ++ r
Rating4/4=1.00-0+
[ reply ]
shiro
#4492()
[
Haskell
]
Rating4/4=1.00
[shiro@scherzo ~]$ time ./Main > /dev/null
real 0m17.715s
user 0m16.241s
sys 0m0.489s
[shiro@scherzo ~]$ time ./Main > x
real 0m20.210s
user 0m17.327s
sys 0m1.230s
[shiro@scherzo ~]$ ls -l x
-rw-rw-r-- 1 shiro shiro 33643344 Nov 29 16:43 x
Rating4/4=1.00-0+
[ reply ]