結果
問題 | No.653 E869120 and Lucky Numbers |
ユーザー |
![]() |
提出日時 | 2018-02-25 08:04:37 |
言語 | Haskell (9.10.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 489 bytes |
コンパイル時間 | 9,052 ms |
コンパイル使用メモリ | 174,720 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-07 16:10:35 |
合計ジャッジ時間 | 9,624 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 WA * 6 |
コンパイルメッセージ
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
ソースコード
main = do p <- getLine putStrLn $ if parse p then "Yes" else "No" parse p@(h:t) | null t = False | h == '1' && all (flip elem "345") (init' t) && (flip elem "234") (last' t) = True | all (flip elem "67") (init' p1) && flip elem "78" (last' p1) && all (flip elem "345") (init' p2) && (flip elem "234") (last' p2) = True | otherwise = False where (p1,p2) = span (flip elem "2345") p init' xs = if null xs then [] else init xs last' xs = if null xs then 'x' else last xs