2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
17
Task/ABC-Problem/Ela/abc-problem.ela
Normal file
17
Task/ABC-Problem/Ela/abc-problem.ela
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
open list monad io char
|
||||
|
||||
:::IO
|
||||
|
||||
null = foldr (\_ _ -> false) true
|
||||
|
||||
mapM_ f = foldr ((>>-) << f) (return ())
|
||||
|
||||
abc _ [] = [[]]
|
||||
abc blocks (c::cs) =
|
||||
[b::ans \\ b <- blocks | c `elem` b, ans <- abc (delete b blocks) cs]
|
||||
|
||||
blocks = ["BO", "XK", "DQ", "CP", "NA", "GT", "RE", "TG", "QD", "FS",
|
||||
"JW", "HU", "VI", "AN", "OB", "ER", "FS", "LY", "PC", "ZM"]
|
||||
|
||||
mapM_ (\w -> putLn (w, not << null $ abc blocks (map char.upper w)))
|
||||
["", "A", "BARK", "BoOK", "TrEAT", "COmMoN", "SQUAD", "conFUsE"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue