結果
| 問題 |
No.441 和か積
|
| コンテスト | |
| ユーザー |
情報学生
|
| 提出日時 | 2019-08-25 20:44:19 |
| 言語 | Haskell (9.10.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 688 bytes |
| コンパイル時間 | 3,589 ms |
| コンパイル使用メモリ | 180,768 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-07 00:10:44 |
| 合計ジャッジ時間 | 4,646 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 30 |
コンパイルメッセージ
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 && a == 0
then putStrLn "E"
else if a == 0 || b == 0 || a == 1 || b == 1
then putStrLn "S"
else putStrLn "P"
情報学生