結果
| 問題 |
No.179 塗り分け
|
| コンテスト | |
| ユーザー |
aimy
|
| 提出日時 | 2017-05-20 09:10:46 |
| 言語 | Haskell (9.10.1) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 834 bytes |
| コンパイル時間 | 165 ms |
| コンパイル使用メモリ | 148,736 KB |
| 最終ジャッジ日時 | 2024-11-15 04:45:39 |
| 合計ジャッジ時間 | 666 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / 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:6:1: error: [GHC-87110]
Could not load module ‘Data.IntMap’.
It is a member of the hidden package ‘containers-0.6.8’.
Use -v to see a list of the files searched for.
|
6 | import Data.IntMap ((!))
| ^^^^^^^^^^^^^^^^^^^^^^^^
Main.hs:7:1: error: [GHC-87110]
Could not load module ‘Data.IntMap’.
It is a member of the hidden package ‘containers-0.6.8’.
Use -v to see a list of the files searched for.
|
7 | import qualified Data.IntMap as M
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ソースコード
import Data.Char import Data.Bool import Data.List import Data.Maybe import Control.Monad import Data.IntMap ((!)) import qualified Data.IntMap as M main = do [h,w] <- map read . words <$> getLine cs <- filter isPrint <$> getContents let is = map fst $ filter ((=='#').snd) (zip [1000*h' + w' | h'<-[0..h-1], w'<-[0..w-1]] cs) putStrLn $ bool "NO" "YES" (dpaint h w (M.fromDistinctAscList (zip is (repeat False)))) dpaint h w icm | M.null icm = False | otherwise = or $ map (\d -> isJust (foldl' (paint d) (return icm) idx)) ds where idx = M.keys icm ds = [i | h'<-[0..h-1], w'<-[negate (w-1) .. w-1], let i = 1000*h'+w', i>0] paint _ Nothing _ = Nothing paint d (Just icm) i | icm ! i = return icm | (not . M.member (i+d)) icm = Nothing | otherwise = return (M.unionWith (||) (M.fromList [(i,True),(i+d,True)]) icm)
aimy