結果

問題 No.582 キャンディー・ボックス3
ユーザー 競プロ秋田競プロ秋田
提出日時 2017-10-27 23:18:00
言語 Haskell
(9.8.2)
結果
WA  
実行時間 -
コード長 429 bytes
コンパイル時間 5,251 ms
コンパイル使用メモリ 172,928 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-01 17:41:38
合計ジャッジ時間 6,184 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
6,816 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 WA -
testcase_10 AC 1 ms
6,944 KB
testcase_11 AC 1 ms
6,944 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 WA -
testcase_14 AC 2 ms
6,940 KB
testcase_15 WA -
testcase_16 AC 1 ms
6,940 KB
testcase_17 AC 1 ms
6,940 KB
testcase_18 AC 3 ms
6,944 KB
testcase_19 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 #

module Main (main) where
import Control.Applicative
import Control.Monad
import Data.List

main :: IO ()
main = do
 { n <- readLn :: IO Int
 ; cs <- map read . words <$> getLine :: IO [Int]
 ; let ones = length $ filter (==1) cs
 ; let twos = length $ filter (==2) cs
 ; let bigs = length $ filter (>2) cs
 ; let answer = if bigs > 0 || (twos == 1 && odd ones) || (twos /= 1 && even ones) then "B" else "A"
 ; putStrLn answer
 }
0