Created
April 28, 2011 05:10
-
-
Save oskimura/945837 to your computer and use it in GitHub Desktop.
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
| {-# OPTIONS_GHC -O2 -optc-O3 -optc-ffast-math -cpp #-} | |
| {-# OPTIONS_GHC -funbox-strict-fields -fexcess-precision -monly-3-regs #-} | |
| {-# LANGUAGE BangPatterns, OverloadedStrings, ScopedTypeVariables #-} | |
| {-# LANGUAGE NoMonomorphismRestriction #-} | |
| module Main where | |
| import Control.Applicative | |
| import Data.List | |
| import Text.Printf | |
| splitBy :: (a -> Bool) -> [a] -> [[a]] | |
| splitBy p [] = [] | |
| splitBy p xs = a : (splitBy p $ dropWhile p $ b) | |
| where | |
| (a, b) = break p xs | |
| split :: String -> [String] | |
| split = splitBy (==' ') | |
| -- input = lines <$> readFile "input.txt" | |
| input = lines <$> getContents | |
| countVowel text = length xs | |
| where | |
| xs = intersect text vowel | |
| vowel = "aeiou" | |
| solve :: [String] -> String | |
| solve xs = if ys == [5,7,5] then "YES" else "NO" | |
| where ys = map countVowel $ xs | |
| main :: IO () | |
| main = do { ns <- input | |
| ; printf "%s" . solve $ ns | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment