結果

問題 No.29 パワーアップ
ユーザー momen999momen999
提出日時 2017-06-05 12:58:30
言語 Haskell
(9.2.2)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 304 bytes
コンパイル時間 1,499 ms
使用メモリ 9,824 KB
最終ジャッジ日時 2023-03-30 21:30:28
合計ジャッジ時間 2,992 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 2 ms
7,568 KB
testcase_01 AC 2 ms
9,696 KB
testcase_02 AC 2 ms
7,596 KB
testcase_03 AC 2 ms
7,572 KB
testcase_04 AC 2 ms
9,784 KB
testcase_05 AC 3 ms
9,780 KB
testcase_06 AC 3 ms
7,612 KB
testcase_07 AC 3 ms
9,824 KB
testcase_08 AC 2 ms
7,596 KB
testcase_09 AC 2 ms
9,628 KB
testcase_10 AC 3 ms
7,584 KB
testcase_11 AC 3 ms
9,696 KB
testcase_12 AC 3 ms
7,592 KB
testcase_13 AC 3 ms
7,592 KB
testcase_14 AC 3 ms
9,768 KB
testcase_15 AC 2 ms
9,824 KB
testcase_16 AC 3 ms
7,588 KB
testcase_17 AC 2 ms
7,720 KB
testcase_18 AC 2 ms
7,656 KB
testcase_19 AC 3 ms
9,712 KB
testcase_20 AC 2 ms
7,672 KB
testcase_21 AC 2 ms
7,576 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.2.2/environments/default
[1 of 1] Compiling Main             ( Main.hs, Main.o )
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