結果

問題 No.29 パワーアップ
ユーザー momen999
提出日時 2017-06-05 12:58:30
言語 Haskell
(9.10.1)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 304 bytes
コンパイル時間 1,592 ms
コンパイル使用メモリ 173,312 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-22 06:48:36
合計ジャッジ時間 2,342 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Control.Monad
import Data.List

rInt :: String -> Int
rInt = read

pwUp (a,b) (x,y) = (a+x, b+y)

main = do
    n <- readLn
    ps <- foldr pwUp (0,0) . map ((`divMod` 2) . length) . group . sort . foldr (++) [] . map (map rInt . words) <$> replicateM n getLine
    print $ fst ps + snd ps `div` 4
0