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ï
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to