結果

問題 No.3044 April Sum of Odd
ユーザー HaarHaar
提出日時 2019-04-01 21:22:04
言語 Haskell
(9.8.2)
結果
AC  
実行時間 313 ms / 2,000 ms
コード長 291 bytes
コンパイル時間 8,847 ms
コンパイル使用メモリ 163,548 KB
実行使用メモリ 45,200 KB
最終ジャッジ日時 2023-08-17 14:00:26
合計ジャッジ時間 10,280 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,120 KB
testcase_01 AC 2 ms
7,040 KB
testcase_02 AC 3 ms
7,268 KB
testcase_03 AC 32 ms
14,136 KB
testcase_04 AC 32 ms
14,672 KB
testcase_05 AC 32 ms
14,148 KB
testcase_06 AC 42 ms
15,232 KB
testcase_07 AC 22 ms
12,148 KB
testcase_08 AC 33 ms
14,128 KB
testcase_09 AC 32 ms
14,384 KB
testcase_10 AC 313 ms
45,200 KB
testcase_11 AC 143 ms
20,792 KB
testcase_12 AC 2 ms
7,108 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.Int
import Data.List
import Control.Monad

main = do
  [n,m] <- map read . words <$> getLine :: IO [Int]
  as <- map read . words <$> getLine :: IO [Int64]

  mapM_ print $ map sum . filter (\xs -> (odd $ head xs) && (length xs >= m)) . groupBy (\x y -> x`mod`2 == y`mod`2) $ as
0