結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー すフすフ
提出日時 2022-09-19 23:38:02
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 367 bytes
コンパイル時間 246 ms
コンパイル使用メモリ 87,212 KB
実行使用メモリ 849,168 KB
最終ジャッジ日時 2023-08-23 19:12:51
合計ジャッジ時間 3,190 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
76,852 KB
testcase_01 AC 77 ms
77,656 KB
testcase_02 AC 82 ms
79,444 KB
testcase_03 AC 79 ms
78,944 KB
testcase_04 AC 75 ms
76,960 KB
testcase_05 AC 81 ms
79,732 KB
testcase_06 AC 78 ms
77,988 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