結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー aimyaimy
提出日時 2017-06-16 11:07:51
言語 Haskell
(9.8.2)
結果
AC  
実行時間 2,553 ms / 5,000 ms
コード長 231 bytes
コンパイル時間 1,858 ms
コンパイル使用メモリ 165,860 KB
実行使用メモリ 13,784 KB
最終ジャッジ日時 2023-09-12 13:03:06
合計ジャッジ時間 18,865 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,708 KB
testcase_01 AC 3 ms
7,656 KB
testcase_02 AC 5 ms
10,380 KB
testcase_03 AC 4 ms
8,476 KB
testcase_04 AC 2 ms
7,748 KB
testcase_05 AC 7 ms
11,848 KB
testcase_06 AC 3 ms
7,832 KB
testcase_07 AC 2,221 ms
13,736 KB
testcase_08 AC 2,272 ms
13,736 KB
testcase_09 AC 1,522 ms
13,660 KB
testcase_10 AC 1,872 ms
13,268 KB
testcase_11 AC 2,432 ms
13,680 KB
testcase_12 AC 8 ms
11,940 KB
testcase_13 AC 3 ms
7,568 KB
testcase_14 AC 12 ms
12,216 KB
testcase_15 AC 2,553 ms
13,756 KB
testcase_16 AC 3 ms
8,172 KB
testcase_17 AC 563 ms
13,784 KB
testcase_18 AC 2,172 ms
13,652 KB
testcase_19 AC 283 ms
13,204 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 qualified Data.IntSet as S
import Data.Bits
import Data.List

main = do
 getLine
 as <- sort . map read . words <$> getLine
 print (nxor as)

nxor = S.size . foldl' (\acc x -> S.union acc (S.map (xor x) acc)) (S.singleton 0)
0