結果
問題 |
No.293 4>7の世界
|
ユーザー |
|
提出日時 | 2018-05-09 16:40:36 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 575 bytes |
コンパイル時間 | 10,063 ms |
コンパイル使用メモリ | 169,856 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-30 12:38:54 |
合計ジャッジ時間 | 7,852 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
import Control.Applicative ((<$>)) main :: IO () main = solve <$> words <$> getLine >>= putStrLn solve :: [String] -> String solve [a, b] | al > bl = a | al < bl = b | otherwise = case foldr f EQ (zip a b) of GT -> a _ -> b where al = length a bl = length b f (x, y) b = case comp x y of EQ -> b GT -> GT LT -> LT comp :: Char -> Char -> Ordering comp '4' '7' = GT comp '7' '4' = LT comp x y = compare x y