結果
問題 | No.92 逃走経路 |
ユーザー |
|
提出日時 | 2018-06-16 17:15:51 |
言語 | Haskell (9.10.1) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,162 bytes |
コンパイル時間 | 813 ms |
コンパイル使用メモリ | 150,400 KB |
最終ジャッジ日時 | 2024-06-30 16:18:04 |
合計ジャッジ時間 | 1,460 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) Main.hs:9:1: error: [GHC-87110] Could not load module ‘Data.Map’. It is a member of the hidden package ‘containers-0.6.8’. Use -v to see a list of the files searched for. | 9 | import Data.Map (Map) | ^^^^^^^^^^^^^^^^^^^^^ Main.hs:10:1: error: [GHC-87110] Could not load module ‘Data.Map’. It is a member of the hidden package ‘containers-0.6.8’. Use -v to see a list of the files searched for. | 10 | import qualified Data.Map as M | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Main.hs:12:1: error: [GHC-87110] Could not load module ‘Data.IntSet’. It is a member of the hidden package ‘containers-0.6.8’. Use -v to see a list of the files searched for. | 12 | import Data.IntSet (IntSet) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Main.hs:13:1: error: [GHC-87110] Could not load module ‘Data.IntSet’. It is a member of the hidden package ‘containers-0.6.8’. Use -v to see a list of the files searched for. | 13 | import qualified Data.IntSet as IS | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ソースコード
importControl.Applicative(<$>),importControl.MonadreplicateMimportData.ByteString.CharByteStringimportqualifiedData.ByteString.CharasBimportData.Listunfoldr,foldl'importData.CharisSpaceimportData.MapMapimportqualifiedData.MapasMimportData.IntSetIntSetimportqualifiedData.IntSetasISmain::IO()main = do[n, m, _] <- fsolve n <$> replicateM m f <*> f >>= mapM_ putStrLnwhere f = readil B.readInt <$> B.getLinesolve::Int->Int->Int->Stringsolve n fts fs = let ls = foldl' (g mp) (IS.fromList [1..n]) fs in [(show . IS.size) ls, (unwords . map show . IS.toList) ls]where f mp [a, b, c] = M.insertWith (++) (a, c) [b] (M.insertWith (++) (b, c) [a] mp)mp = foldl' f M.empty ftsg mp st d = IS.foldl' h IS.empty stwhere h s p = case M.lookup (p, d) mp ofJust xs -> IS.union s (IS.fromList xs)Nothing -> sreadil::Integrala=>ByteString->MaybeaByteString->ByteString->areadil f = unfoldr gwhereg s = do(n, s') <- f sreturn (n, B.dropWhile isSpace s')