結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー e-mone-mon
提出日時 2015-04-17 13:24:21
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 4,786 ms / 5,000 ms
コード長 281 bytes
コンパイル時間 400 ms
コンパイル使用メモリ 87,168 KB
実行使用メモリ 81,880 KB
最終ジャッジ日時 2023-09-11 11:04:39
合計ジャッジ時間 24,005 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,340 KB
testcase_01 AC 71 ms
71,272 KB
testcase_02 AC 77 ms
75,808 KB
testcase_03 AC 75 ms
75,912 KB
testcase_04 AC 70 ms
71,148 KB
testcase_05 AC 77 ms
77,308 KB
testcase_06 AC 72 ms
71,144 KB
testcase_07 AC 4,786 ms
81,876 KB
testcase_08 AC 2,595 ms
77,992 KB
testcase_09 AC 1,799 ms
78,028 KB
testcase_10 AC 2,159 ms
78,092 KB
testcase_11 AC 2,808 ms
78,272 KB
testcase_12 AC 84 ms
81,548 KB
testcase_13 AC 73 ms
71,284 KB
testcase_14 AC 79 ms
76,524 KB
testcase_15 AC 2,907 ms
78,004 KB
testcase_16 AC 76 ms
75,912 KB
testcase_17 AC 700 ms
78,000 KB
testcase_18 AC 3,761 ms
81,880 KB
testcase_19 AC 380 ms
77,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = int(input())
dp = dict()
A = list(map(int,input().split()))
dp[0] = True

for a in A:
    tmp = dict()
    for i,value in dp.items():
        if i ^ a not in dp:
            tmp[i^a] = True
    dp.update(tmp)
print(len(dp.keys()))
0