最速スクリプト言語決定戦!
■ このスレッドは過去ログ倉庫に格納されています
0181デフォルトの名無しさん
NGNGtarai (640, 320, 0)
module Main where
tarai :: Int -> Int -> Int -> Int
tarai x y z
| x <= y = y
| otherwise = tarai (tarai (x - 1) y z) (tarai (y - 1) z x) (tarai (z -1) x y)
main = print $ tarai 640 320 0
ghc -O2 tarai.hs
./a.out 0.00s user 0.01s system 105% cpu 0.017 total
runhugs tarai.hs
runhugs tarai.hs 3.17s user 0.12s system 89% cpu 3.671 total
# やっぱりhugsは遅い。
■ このスレッドは過去ログ倉庫に格納されています