[Haskell-cafe] haskell in online contests
vishnu
pathsny at gmail.com
Fri Nov 27 14:41:37 EST 2009
Ive just started learning haskell pretty recently and Ive been trying to
solve some online contest problems as part of this exercise. However, Ive
been having almost no success. For various reasons my answers almost always
are too slow. I recently stumbled across this link which was quite useful
http://www.haskell.org/haskellwiki/SPOJ. This helped me speed up some of my
programs where input was slowing me down.
But being a noob, to a large extent I don't even know why my programs are
slow sometimes or how to tell what makes them slow. I've been attempting
problems from www.codechef.com (which uses SPOJ) in actuality. Because I
have an admin account I can actually compare my solution against others
there (which are almost always in C/C++ or Java) to try and figure out if Im
missing a trick. Recently the problem I picked up was
http://www.codechef.com/problems/DDILEMMA/ and I worked through solutions
that just don't seem to be fast enough. I looked at successful submissions
in C++ and JAVA which seem to do mostly what I'm doing (ofcourse there are
differences because those are imperative languages and I might be
misunderstanding things.). I've got my program, test input that I generated,
cost center analysis all up on this page.
http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=5120#a5137
I've been getting some significant help from the #haskell channel but
unfortunately this hasn't helped me break the barrier I need to. So I was
wondering if someone would be kind enough to help me understand the profiler
output and help me understand how to improve performance in cases like this
thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091127/c8242d4a/attachment.html
More information about the Haskell-Cafe
mailing list