結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
8,824 KB
testcase_01 AC 57 ms
9,612 KB
testcase_02 AC 96 ms
11,460 KB
testcase_03 AC 83 ms
10,928 KB
testcase_04 AC 38 ms
8,940 KB
testcase_05 AC 101 ms
11,564 KB
testcase_06 AC 57 ms
9,900 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 = [[False]*(pow(2,15)+1) for i in range(n)]

dp[0][0] = True
dp[0][a[0]] = True

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