Last active
March 10, 2019 10:53
-
-
Save rdbuf/f1d936430ae92ee2a02204746cd7085e to your computer and use it in GitHub Desktop.
Решил ЕГЭ#23!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Data.List | |
| import Control.Monad | |
| import Data.Monoid | |
| answer = length . filter cond . replicateM 2 . replicateM 9 $ [False,True] | |
| cond [x,y] = and $ [x!!0 || y!!1] <> zipWith (&&) (rows x) (rows y) where | |
| rows = map ((||) <$> not . (!!0) <*> (!!1)) . take 8 . tails | |
| main = print answer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment