結果

問題 No.216 FAC
ユーザー Michae'GonMichae'Gon
提出日時 2015-07-17 16:25:52
言語 Haskell
(9.6.2)
結果
AC  
実行時間 4 ms / 1,000 ms
コード長 464 bytes
コンパイル時間 7,595 ms
コンパイル使用メモリ 164,236 KB
実行使用メモリ 8,372 KB
最終ジャッジ日時 2023-08-05 02:50:34
合計ジャッジ時間 8,655 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,360 KB
testcase_01 AC 2 ms
7,348 KB
testcase_02 AC 3 ms
7,308 KB
testcase_03 AC 3 ms
8,040 KB
testcase_04 AC 2 ms
7,676 KB
testcase_05 AC 3 ms
7,544 KB
testcase_06 AC 2 ms
7,376 KB
testcase_07 AC 3 ms
7,288 KB
testcase_08 AC 2 ms
7,320 KB
testcase_09 AC 2 ms
7,344 KB
testcase_10 AC 2 ms
7,364 KB
testcase_11 AC 2 ms
7,388 KB
testcase_12 AC 3 ms
7,368 KB
testcase_13 AC 2 ms
7,356 KB
testcase_14 AC 3 ms
7,380 KB
testcase_15 AC 2 ms
7,324 KB
testcase_16 AC 3 ms
8,156 KB
testcase_17 AC 3 ms
8,372 KB
testcase_18 AC 3 ms
8,220 KB
testcase_19 AC 4 ms
8,292 KB
testcase_20 AC 3 ms
8,236 KB
testcase_21 AC 3 ms
8,212 KB
testcase_22 AC 3 ms
8,172 KB
testcase_23 AC 3 ms
8,216 KB
testcase_24 AC 4 ms
8,168 KB
testcase_25 AC 3 ms
8,184 KB
testcase_26 AC 2 ms
7,356 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import qualified Data.Map as M

main = getLine >> getLine >>= main' . map read . words
        where
                main' xs = getLine >>= putStrLn . solve . M.fromListWith (+) . flip zip xs . map read . words

solve :: M.Map Int Int -> String
solve xs
        | k < mnum = "NO"
        | otherwise = "YES"
        where
                mnum = M.foldl max 0 xs
                k = err $ M.lookup 0 xs
                err (Just x) = x
                err _ = (-1)
0