結果
問題 | No.133 カードゲーム |
ユーザー |
![]() |
提出日時 | 2017-02-19 02:25:40 |
言語 | Haskell (9.10.1) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,353 bytes |
コンパイル時間 | 4,266 ms |
コンパイル使用メモリ | 149,888 KB |
最終ジャッジ日時 | 2024-06-25 03:48:32 |
合計ジャッジ時間 | 4,607 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:12:1: error: [GHC-87110] Could not load module ‘Data.IntMap’. It is a member of the hidden package ‘containers-0.6.8’. Use -v to see a list of the files searched for. | 12 | import qualified Data.IntMap as IntMap | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Main.hs:13:1: error: [GHC-87110] Could not load module ‘Data.Map’. It is a member of the hidden package ‘containers-0.6.8’. Use -v to see a list of the files searched for. | 13 | import qualified Data.Map as Map | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ソースコード
LANGUAGEmoduleMainwhereimportData.MaybeimportqualifiedData.ByteString.CharasCimportControl.MonadforM_importData.IntimportData.ListimportData.ArrayimportData.WordimportData.BitsimportqualifiedData.IntMapasIntMapimportqualifiedData.MapasMapyes::CByteStringyes = "YES"no::CByteStringno = "NO"getInts::IOIntgetInts = doss <- C.getLinereturn $ map (fst . fromJust . C.readInt) $ C.words ssgetIntss::Int->IOIntgetIntss 0 = return []getIntss n = doxs <- getIntsxss <- getIntss (n - 1)return $ xs : xss-- end standard template --main::IO()main = do[n] <- getIntsxs <- getIntsys <- getIntslet res = solve n xs ysprint ressolve::Int->Int->Int->Doublesolve n xs ys = (sum $ map eval zs) / (realToFrac $ length zs)wherezs = [zip xs' ys' | xs' <- permutations xs, ys' <- permutations ys]eval::IntInt->Doubleeval ws = let (s1, s2) = eval' ws (0,0) in if s1 > s2 then 1.0 else 0.0eval'::IntInt->IntInt->IntInteval' [] t = teval' ((w1,w2):ws) (s1, s2) = case compare w1 w2 ofLT -> eval' ws (s1, s2 + 1)EQ -> eval' ws (s1, s2)GT -> eval' ws (s1 + 1, s2)