結果
| 問題 | 
                            No.92 逃走経路
                             | 
                    
| コンテスト | |
| ユーザー | 
                             aimy
                         | 
                    
| 提出日時 | 2017-04-21 19:30:42 | 
| 言語 | Haskell  (9.10.1)  | 
                    
| 結果 | 
                             
                                CE
                                 
                             
                            
                            (最新)
                                AC
                                 
                             
                            (最初)
                            
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 937 bytes | 
| コンパイル時間 | 143 ms | 
| コンパイル使用メモリ | 149,120 KB | 
| 最終ジャッジ日時 | 2024-07-20 05:11:15 | 
| 合計ジャッジ時間 | 480 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、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:3:1: error: [GHC-87110]
    Could not load module ‘Data.Set’.
    It is a member of the hidden package ‘containers-0.6.8’.
    Use -v to see a list of the files searched for.
  |
3 | import qualified Data.Set as S
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            
            ソースコード
import Control.Monad import Data.List import qualified Data.Set as S type YukiCity = ([City],[Road]) cities = fst roads = snd next rs c t = map (from c . fst) $ filter (\r -> link c (path r) && toll r == t) rs type Road = (Path,Toll) path = fst toll = snd type Path = (City,City) link c (c1,c2) = c==c1 || c==c2 from c (c1,c2) | c == c1 = c2 | c == c2 = c1 type Info = [Toll] type City = Int type Toll = Int nub' = S.toList . S.fromList main = do [n,m,k] <- map read . words <$> getLine abcs <- map (map read . words) <$> replicateM m getLine info <- map read . words <$> getLine let rs = map (\[a,b,c] -> ((a,b),c)) abcs let result = investigate ([1..n],rs) info print (length result) putStrLn (unwords (map show result)) investigate :: YukiCity -> Info -> [City] investigate yc i = foldl' (move (roads yc)) (cities yc) i move :: [Road] -> [City] -> Toll -> [City] move rs cs t = nub' $ concatMap (\c -> next rs c t) cs
            
aimy