結果
| 問題 |
No.587 七対子
|
| コンテスト | |
| ユーザー |
atuk721
|
| 提出日時 | 2017-11-06 15:45:32 |
| 言語 | Haskell (9.10.1) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 545 bytes |
| コンパイル時間 | 111 ms |
| コンパイル使用メモリ | 148,736 KB |
| 最終ジャッジ日時 | 2024-07-19 19:46:03 |
| 合計ジャッジ時間 | 417 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、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:1:1: error: [GHC-87110]
Could not load module ‘Data.Map.Lazy’.
It is a member of the hidden package ‘containers-0.6.8’.
Use -v to see a list of the files searched for.
|
1 | import qualified Data.Map.Lazy as M
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ソースコード
import qualified Data.Map.Lazy as M
createStringMap :: String -> M.Map Char Int
createStringMap = foldr (\c acc -> M.insertWith (\n o -> o + 1) c 1 acc) M.empty
process :: String -> Maybe Char
process input
| M.size stringMap == 7 && M.size singleMap == 1 = Just $ (M.keys singleMap) !! 0
| otherwise = Nothing
where stringMap = createStringMap input
singleMap = M.filter (\c -> c == 1) stringMap
main :: IO ()
main = do
input <- getLine
case process input of
Just x -> putStrLn [x]
Nothing -> putStrLn "Impossible"
atuk721