結果

問題 No.548 国士無双
ユーザー LeonardoneLeonardone
提出日時 2019-09-25 06:04:18
言語 Haskell
(9.8.2)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 593 bytes
コンパイル時間 473 ms
コンパイル使用メモリ 142,664 KB
最終ジャッジ日時 2023-10-18 02:06:18
合計ジャッジ時間 1,239 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、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:7:1: error:
    Could not load module ‘Data.Map’
    It is a member of the hidden package ‘containers-0.6.7’.
    You can run ‘:set -package containers’ 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.
  |
7 | import qualified Data.Map as Map
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

ソースコード

diff #

-- リジャッジ落ち修正
-- putStrLn -> putStr

-- Try yukicoder
-- author: Leonardone @ NEETSDKASU

import qualified Data.Map as Map

main = putStr . unlines . solve =<< getLine

hoge [] = ["Impossible"]
hoge xs = xs

solve xs = ans where
    xm = foldl f Map.empty xs
    f a x = Map.insertWith (+) x 1 a
    ans = hoge . map (return.fst) . filter h $ map g ['a' .. 'm']
    g c = (c, f xm c)
    h (c, m) = (13,14) == xx where
        xx = foldl u (0,0) ['a' .. 'm']
        u (a,b) x = case Map.lookup x m of
            Just k  -> (a+1,b+k)
            Nothing -> (0,0)
            
0