Created
June 12, 2012 19:01
-
-
Save pogin503/2919441 to your computer and use it in GitHub Desktop.
AtCoder #001
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
| {- http://arc001.contest.atcoder.jp/tasks/arc001_1# | |
| 他の人のを見たらそれに引きづられて丸パクリになってもうた(汗) | |
| 参考ソース: http://arc001.contest.atcoder.jp/submissions/22675# | |
| -} | |
| import Data.List | |
| result = do | |
| s <-getLine | |
| s1 <- getLine | |
| let countList = map (\c -> myCount c s1) "1234" | |
| putStrLn $ show (maximum countList) ++ " " ++ show (minimum countList) | |
| myCount :: Char -> String -> Int | |
| myCount _ [] = 0 | |
| myCount c (x:xs) = myCount c xs + if c == x then 1 else 0 | |
| main = result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment