
9 Aug
2007
9 Aug
'07
12:10 p.m.
I get "Wrong answer" with the following code for the same problem... Is there something strange in this code : module Main where import qualified Data.ByteString.Char8 as B main = B.getLine >>= sequence_ . flip replicate hot . maybe 0 fst . B.readInt hot = do B.getLine men <- B.getLine women <- B.getLine print $ sum $ zipWith (*) (map (maybe 0 fst . B.readInt) $ B.words men) (map (maybe 0 fst . B.readInt) $ B.words women) ??? I get the expected results with my tests. -- Jedaï