結果
問題 | No.11 カードマッチ |
ユーザー | okaduki |
提出日時 | 2017-05-20 22:22:20 |
言語 | Haskell (9.8.2) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 687 bytes |
コンパイル時間 | 305 ms |
コンパイル使用メモリ | 143,528 KB |
最終ジャッジ日時 | 2023-10-19 04:15:59 |
合計ジャッジ時間 | 678 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) Main.hs:4:1: error: Could not load module ‘Data.ByteString.Char8’ It is a member of the hidden package ‘bytestring-0.11.4.0’. You can run ‘:set -package bytestring’ to expose it. (Note: this unloads all the modules in the current scope.) Use -v (or `:set -v` in ghci) to see a list of the files searched for. | 4 | import qualified Data.ByteString.Char8 as B | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ソースコード
{-# LANGUAGE FlexibleContexts, OverloadedStrings #-} import Control.Applicative import Control.Monad import qualified Data.ByteString.Char8 as B import Data.Maybe (fromJust) import Data.List import Text.Printf import Debug.Trace main = do [w] <- getInts [h] <- getInts [n] <- getInts xxs <- replicateM (fromInteger n) getInts let xl = fromIntegral $ length $ nub $ map head xxs let yl = fromIntegral $ length $ nub $ map (head . tail) xxs print $ xl * h + yl * w - xl * yl - n -- util getInts :: IO [Integer] getInts = map (fst . fromJust . B.readInteger) . B.words <$> B.getLine substr :: Int -> Int -> B.ByteString -> B.ByteString substr b l s = B.take l $ B.drop b s