結果
| 問題 | No.441 和か積 | 
| コンテスト | |
| ユーザー |  情報学生 | 
| 提出日時 | 2019-08-25 20:36:07 | 
| 言語 | Haskell (9.10.1) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 656 bytes | 
| コンパイル時間 | 11,150 ms | 
| コンパイル使用メモリ | 180,900 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-11-06 23:59:19 | 
| 合計ジャッジ時間 | 11,090 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 22 WA * 8 | 
コンパイルメッセージ
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
            then putStrLn "S"
            else putStrLn "P"
            
            
            
        