結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー brthyyjpbrthyyjp
提出日時 2020-08-21 06:54:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,913 ms / 5,000 ms
コード長 273 bytes
コンパイル時間 815 ms
コンパイル使用メモリ 82,816 KB
実行使用メモリ 260,736 KB
最終ジャッジ日時 2024-04-21 22:29:03
合計ジャッジ時間 13,958 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
61,440 KB
testcase_01 AC 51 ms
63,104 KB
testcase_02 AC 54 ms
67,072 KB
testcase_03 AC 56 ms
66,176 KB
testcase_04 AC 48 ms
61,568 KB
testcase_05 AC 56 ms
67,456 KB
testcase_06 AC 52 ms
63,616 KB
testcase_07 AC 1,913 ms
260,480 KB
testcase_08 AC 1,472 ms
260,520 KB
testcase_09 AC 1,060 ms
260,452 KB
testcase_10 AC 1,253 ms
260,608 KB
testcase_11 AC 1,591 ms
259,404 KB
testcase_12 AC 56 ms
68,736 KB
testcase_13 AC 45 ms
59,776 KB
testcase_14 AC 1,041 ms
260,736 KB
testcase_15 AC 1,632 ms
258,928 KB
testcase_16 AC 54 ms
65,792 KB
testcase_17 AC 485 ms
260,480 KB
testcase_18 AC 1,680 ms
260,472 KB
testcase_19 AC 332 ms
260,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))

N = 2**15+5
dp = [0]*N
dp[0] = 1
import copy
for i, a in enumerate(A):
    temp = copy.copy(dp)
    for j in range(N):
        if dp[j] == 1:
            temp[j^a] = 1
    dp = copy.copy(temp)
#print(dp)
print(sum(dp))
0