結果

問題 No.99 ジャンピング駒
ユーザー gemmarogemmaro
提出日時 2020-01-31 11:44:30
言語 Haskell
(9.8.2)
結果
AC  
実行時間 445 ms / 5,000 ms
コード長 207 bytes
コンパイル時間 4,211 ms
コンパイル使用メモリ 168,448 KB
実行使用メモリ 59,212 KB
最終ジャッジ日時 2023-10-17 08:16:30
合計ジャッジ時間 7,047 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 445 ms
59,212 KB
testcase_01 AC 445 ms
59,212 KB
testcase_02 AC 445 ms
59,212 KB
testcase_03 AC 444 ms
59,212 KB
testcase_04 AC 435 ms
59,212 KB
testcase_05 AC 435 ms
59,212 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

main = do
    _ <- getLine
    xs <- map read . words <$> getLine
    print $ solve xs

solve :: [Int] -> Int
solve xs = abs (o - e)
    where o = length $ filter odd xs
          e = length $ filter even xs
0