結果

問題 No.216 FAC
ユーザー momen999momen999
提出日時 2017-06-07 14:28:44
言語 Haskell
(9.8.2)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 420 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 142,260 KB
最終ジャッジ日時 2023-10-23 18:57:50
合計ジャッジ時間 915 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、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:1:1: error:
    Could not load module ‘Data.IntMap’
    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.
  |
1 | import qualified Data.IntMap as M
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

ソースコード

diff #

import qualified Data.IntMap as M

rInt :: String -> Int
rInt = read

solve as bs
    | ba0 < mba = "NO"
    | otherwise = "YES"
    where
        ba = M.fromListWith (+) $ zip bs as
        ba0 = (\x -> case x of {Just x -> x; Nothing -> -1;} ) $ M.lookup 0 ba
        mba = M.foldr max 0 ba

main = do
    getLine
    as <- map rInt . words <$> getLine
    bs <- map rInt . words <$> getLine
    putStrLn $ solve as bs
0