結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー すフすフ
提出日時 2022-09-19 23:38:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 367 bytes
コンパイル時間 757 ms
コンパイル使用メモリ 10,816 KB
実行使用メモリ 813,868 KB
最終ジャッジ日時 2023-08-23 19:12:55
合計ジャッジ時間 3,835 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
8,664 KB
testcase_01 AC 56 ms
9,556 KB
testcase_02 AC 100 ms
11,304 KB
testcase_03 AC 88 ms
10,916 KB
testcase_04 AC 39 ms
9,072 KB
testcase_05 AC 109 ms
11,588 KB
testcase_06 AC 60 ms
9,840 KB
testcase_07 MLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#dp[i][j] = i番目まで,jを作る場合の数

dp = [[0]*(pow(2,15)+1) for i in range(n)]

dp[0][0] = 1
dp[0][a[0]] = 1

for i in range(1,n):
    for j in range(pow(2,14)+1):
        dp[i][j] = dp[i-1][j] + dp[i-1][j^a[i]]
ans = 0
for i in range(pow(2,15)+1):
    if dp[-1][i] > 0:
        ans += 1
print(ans)
0