Re: [Haskell-cafe] haskell in online contests

2009-11-28 Thread vishnu
curious what lazyness you used to go from 60 to 1.6? I always thought lazyness was automatic and seq made strictness possible. thanks Vishnu On Sat, Nov 28, 2009 at 7:41 AM, Daniel Fischer daniel.is.fisc...@web.dewrote: Am Samstag 28 November 2009 02:04:31 schrieb Daniel Fischer: Make it distance

[Haskell-cafe] haskell in online contests

2009-11-27 Thread vishnu
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

Re: [Haskell-cafe] haskell in online contests

2009-11-27 Thread vishnu
wow I just woke up to see this :). Im impressed at the speed of the response, thanks Daniel Bad news first. a) According to codechef, you must also consider digits. you're right, I totally missed this. Thanks :) b) Your distance function is wrong. With idx i j = (i+1)*(j+1) - 1, you

Re: [Haskell-cafe] haskell in online contests

2009-11-27 Thread vishnu
Hi Daniel Wow that's fantastic. Could you explain those further optimisations a bit more please? Especially the whole more lazyness thing. Timings here: Your last ByteString code: 128s That with corrected index calculation: 172s Correct indices and distance orig new = f m n instead of memf m

Re: Re[2]: [Haskell-cafe] haskell in online contests

2009-11-27 Thread vishnu
Hi Bulat hmm ok I understand the issue of compiler maturity. But I thought lazyness was meant to be a bonus? Or is it that if you really try to squeeze performance it becomes more of a hindrance? On Sat, Nov 28, 2009 at 1:47 AM, Bulat Ziganshin bulat.zigans...@gmail.comwrote: Hello Don,