結果

問題 No.932 解法破綻!高橋君
ユーザー RheoTommy
提出日時 2020-01-12 19:56:57
言語 Haskell
(9.10.1)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 634 bytes
コンパイル時間 8,244 ms
コンパイル使用メモリ 171,904 KB
実行使用メモリ 20,992 KB
最終ジャッジ日時 2024-11-30 04:47:14
合計ジャッジ時間 9,001 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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

ソースコード

diff #

import Control.Monad
import Data.Array
import qualified Data.ByteString.Char8 as BS
import Data.Char
import Data.List
import Data.Maybe

readInts :: IO [Integer]
readInts = map (fst . fromJust . BS.readInteger) . BS.words <$> BS.getLine

readStrings :: IO [BS.ByteString]
readStrings = BS.words <$> BS.getLine

splitBy :: (a -> Bool) -> [a] -> [[a]]
splitBy p [] = []
splitBy p xs = a : splitBy p (dropWhile p b)
  where
    (a, b) = break p xs

main :: IO ()
main = do
  s <- splitBy (== ',') <$> getLine
  putStrLn $ solve s

solve = f
  where
    f [] = "Done!"
    f (x:xs)
      | x /= "AC" = "Failed..."
      | otherwise = f xs
0