結果

問題 No.216 FAC
ユーザー 情報学生情報学生
提出日時 2019-08-22 17:23:07
言語 Haskell
(9.8.2)
結果
WA  
実行時間 -
コード長 395 bytes
コンパイル時間 5,117 ms
コンパイル使用メモリ 167,448 KB
実行使用メモリ 8,432 KB
最終ジャッジ日時 2023-08-02 18:42:54
合計ジャッジ時間 6,337 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,496 KB
testcase_01 AC 2 ms
7,476 KB
testcase_02 AC 2 ms
7,484 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 3 ms
7,432 KB
testcase_09 AC 3 ms
7,536 KB
testcase_10 AC 3 ms
7,532 KB
testcase_11 AC 3 ms
7,428 KB
testcase_12 AC 3 ms
7,576 KB
testcase_13 AC 3 ms
7,572 KB
testcase_14 AC 3 ms
7,548 KB
testcase_15 AC 3 ms
7,540 KB
testcase_16 AC 3 ms
8,336 KB
testcase_17 AC 4 ms
8,432 KB
testcase_18 AC 3 ms
8,424 KB
testcase_19 AC 4 ms
8,324 KB
testcase_20 AC 3 ms
8,428 KB
testcase_21 AC 4 ms
8,336 KB
testcase_22 AC 3 ms
8,356 KB
testcase_23 AC 4 ms
8,336 KB
testcase_24 AC 4 ms
8,416 KB
testcase_25 AC 3 ms
8,404 KB
testcase_26 AC 3 ms
7,508 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 Data.List
import qualified Data.IntMap as Map

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 = sortOn fst $ Map.toList $ Map.fromListWith (+) ws
        a  = snd $ head us
        bs = map snd $ tail us
    if maximum bs <= a then putStrLn "YES" else putStrLn "NO"
0