結果

問題 No.29 パワーアップ
コンテスト
ユーザー gigurururu
提出日時 2015-04-09 17:51:39
言語 Haskell
(9.10.1)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 240 bytes
コンパイル時間 4,413 ms
コンパイル使用メモリ 153,216 KB
最終ジャッジ日時 2025-10-24 20:52:19
合計ジャッジ時間 4,748 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.10.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
Main.hs:2:1: error: [GHC-87110]
    Could not load module ‘Data.Set’.
    It is a member of the hidden package ‘containers-0.7’.
    Use -v to see a list of the files searched for.
  |
2 | import qualified Data.Set as S
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

ソースコード

diff #

import Data.List
import qualified Data.Set as S
main =
  print . (`div`4) . fst . foldl f (0,S.empty) . drop 1 . words =<< getContents
  where
    f (a,s) c
      | S.member c s = (a+3,S.delete c s)
      | otherwise    = (a+1,S.insert c s)
0