結果

問題 No.216 FAC
ユーザー tottoripapertottoripaper
提出日時 2015-05-26 22:33:44
言語 Haskell
(9.8.2)
結果
AC  
実行時間 4 ms / 1,000 ms
コード長 515 bytes
コンパイル時間 8,999 ms
コンパイル使用メモリ 160,452 KB
実行使用メモリ 8,208 KB
最終ジャッジ日時 2023-08-05 02:41:58
合計ジャッジ時間 10,263 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,176 KB
testcase_01 AC 2 ms
7,268 KB
testcase_02 AC 3 ms
7,244 KB
testcase_03 AC 4 ms
7,892 KB
testcase_04 AC 3 ms
7,492 KB
testcase_05 AC 3 ms
7,484 KB
testcase_06 AC 3 ms
6,956 KB
testcase_07 AC 3 ms
7,028 KB
testcase_08 AC 3 ms
7,068 KB
testcase_09 AC 3 ms
7,064 KB
testcase_10 AC 3 ms
7,228 KB
testcase_11 AC 3 ms
7,064 KB
testcase_12 AC 2 ms
7,256 KB
testcase_13 AC 2 ms
7,272 KB
testcase_14 AC 2 ms
7,096 KB
testcase_15 AC 2 ms
7,320 KB
testcase_16 AC 4 ms
8,088 KB
testcase_17 AC 4 ms
8,088 KB
testcase_18 AC 3 ms
8,072 KB
testcase_19 AC 3 ms
8,152 KB
testcase_20 AC 4 ms
8,132 KB
testcase_21 AC 4 ms
8,088 KB
testcase_22 AC 3 ms
8,088 KB
testcase_23 AC 3 ms
8,140 KB
testcase_24 AC 4 ms
8,208 KB
testcase_25 AC 3 ms
8,124 KB
testcase_26 AC 3 ms
7,216 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 #

{-# LANGUAGE Arrows #-}

import Control.Monad
import Control.Arrow
import Data.List
import Data.Ord

getInts :: IO [Int]
getInts = liftM (map read . words) getLine
    
main = do
  _ <- getLine
  as <- getInts
  bs <- getInts
  let cs = map ((fst . head) &&& (sum . map snd)) . groupBy (\a b -> fst a == fst b) $ sortBy (comparing fst) $ zip bs as
      f = if fst (head cs) /= 0
          then 0
          else snd (head cs)
  putStrLn $ if f >= maximum (map snd cs)
             then "YES"
             else "NO"
0