結果
| 問題 |
No.293 4>7の世界
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-11-05 08:20:32 |
| 言語 | Haskell (9.10.1) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 604 bytes |
| コンパイル時間 | 5,548 ms |
| コンパイル使用メモリ | 174,848 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-30 11:30:21 |
| 合計ジャッジ時間 | 2,660 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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
ソースコード
-- yukicoder My Practice
-- author: Leonardone @ NEETSDKASU
-- スマホから投稿テスト
import Data.List
main = do
ab <- getLine
putStrLn $ solve ab
solve ab =
let
(a:b:_) = words ab
f (x:xs) (y:ys) = case (x, y) of
('7', '4') -> False
('4', '7') -> True
_ -> case compare x y of
LT -> False
EQ -> f xs ys
GT -> True
f _ _ = True
la = length a
lb = length b
r = case compare la lb of
LT -> False
EQ -> f a b
GT -> True
in
if r then a else b