結果
問題 |
No.441 和か積
|
ユーザー |
![]() |
提出日時 | 2019-08-25 20:37:26 |
言語 | Haskell (9.10.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 676 bytes |
コンパイル時間 | 9,509 ms |
コンパイル使用メモリ | 180,884 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-07 00:03:11 |
合計ジャッジ時間 | 10,748 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 WA * 2 |
コンパイルメッセージ
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 Data.Char (isSpace) import Control.Applicative ((<$>)) import Data.List (unfoldr) import Data.ByteString.Char8 (ByteString) import qualified Data.ByteString.Char8 as B getL :: (ByteString -> [Integer]) -> IO [Integer] getL f = f <$> B.getLine readIL :: (ByteString -> Maybe (Integer, ByteString)) -> (ByteString -> [Integer]) readIL f = unfoldr g where g s = do (n, s') <- f s return (n, B.dropWhile isSpace s') main :: IO () main = do [a, b] <- getL (readIL B.readInteger) if a == b then putStrLn "E" else if a == 0 || b == 0 || a == 1 || b == 1 then putStrLn "S" else putStrLn "P"