結果
問題 | No.424 立体迷路 |
ユーザー |
|
提出日時 | 2018-06-01 14:12:35 |
言語 | Haskell (9.10.1) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,130 bytes |
コンパイル時間 | 3,189 ms |
コンパイル使用メモリ | 149,632 KB |
最終ジャッジ日時 | 2024-07-05 07:16:44 |
合計ジャッジ時間 | 3,816 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、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:8: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. | 8 | import Data.IntSet (IntSet) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Main.hs:9: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. | 9 | import qualified Data.IntSet as IS | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ソースコード
importControl.Applicative(<$>),importControl.MonadreplicateMimportData.BoolboolimportData.Listintercalate,foldl'importData.ChardigitToIntimportData.Vector.UnboxedVector,(!)importqualifiedData.Vector.UnboxedasVimportData.IntSetIntSetimportqualifiedData.IntSetasISmain::IO()main = do[h, w] <- fsolve h w <$> f <*> replicateM h (map digitToInt <$> getLine) >>= putStrLnwhere f = map read <$> words <$> getLinesolve::Int->Int->Int->Int->Stringsolve h w [sx, sy, gx, gy] ms = bool "NO" "YES" . (IS.member (toIx (gx-1) (gy-1))) $ dfs w IS.empty (toIx (sx-1) (sy-1))wheremv = V.fromList $ replicate (w+1) 100 ++ intercalate [100] ms ++ replicate (w+1) 100toIx i j = (i+1)*(w+1)+jdfs w mm cp = foldl' (dfs w) (IS.insert cp mm) npwhere np = [tp | tp <- [cp+1, cp-w-1, cp-1, cp+w+1], abs ((mv ! tp) - cph) <= 1, IS.notMember tp mm] ++[tp2 | (tp1, tp2) <- [(cp+1, cp+2), (cp-w-1, cp-2*w-2), (cp-1, cp-2), (cp+w+1, cp+2*w+2)], (mv ! tp1) < cph, (mv ! tp2) == cph, IS.notMember tp2 mm]cph = mv ! cp