結果

問題 No.216 FAC
ユーザー 情報学生情報学生
提出日時 2019-08-22 17:36:22
言語 Haskell
(9.6.2)
結果
RE  
実行時間 -
コード長 458 bytes
コンパイル時間 7,815 ms
コンパイル使用メモリ 165,524 KB
実行使用メモリ 8,308 KB
最終ジャッジ日時 2023-08-02 19:01:54
合計ジャッジ時間 6,531 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,540 KB
testcase_01 AC 2 ms
7,404 KB
testcase_02 AC 3 ms
7,392 KB
testcase_03 AC 3 ms
7,696 KB
testcase_04 AC 3 ms
7,536 KB
testcase_05 AC 3 ms
7,468 KB
testcase_06 AC 2 ms
7,252 KB
testcase_07 RE -
testcase_08 AC 2 ms
7,368 KB
testcase_09 AC 3 ms
7,408 KB
testcase_10 AC 2 ms
7,464 KB
testcase_11 AC 2 ms
7,424 KB
testcase_12 AC 3 ms
7,416 KB
testcase_13 AC 3 ms
7,480 KB
testcase_14 AC 3 ms
7,324 KB
testcase_15 AC 2 ms
7,424 KB
testcase_16 AC 4 ms
8,240 KB
testcase_17 AC 4 ms
8,248 KB
testcase_18 AC 3 ms
8,308 KB
testcase_19 AC 4 ms
8,176 KB
testcase_20 AC 3 ms
8,184 KB
testcase_21 AC 3 ms
7,812 KB
testcase_22 AC 4 ms
8,264 KB
testcase_23 AC 3 ms
8,244 KB
testcase_24 AC 4 ms
8,192 KB
testcase_25 AC 4 ms
8,196 KB
testcase_26 AC 3 ms
7,380 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.IntMap as Map
import Data.List

main :: IO ()
main = do
    (n:xs) <- map (read :: String -> Int) . words <$> getContents
    let ys = take n xs
        zs = drop n xs
        ws = zip zs ys
        us = Map.toList $ Map.fromListWith (+) ws
        a  = head us
        bs = map snd $ tail us
    if fst a /= 0
        then putStrLn "NO"
        else if maximum bs <= snd a
            then putStrLn "YES"
            else putStrLn "NO"
0