Skip to content

Instantly share code, notes, and snippets.

@rdbuf
Last active March 10, 2019 10:53
Show Gist options
  • Select an option

  • Save rdbuf/f1d936430ae92ee2a02204746cd7085e to your computer and use it in GitHub Desktop.

Select an option

Save rdbuf/f1d936430ae92ee2a02204746cd7085e to your computer and use it in GitHub Desktop.
Решил ЕГЭ#23!
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