結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー gorugo30gorugo30
提出日時 2021-03-16 23:22:08
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 335 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 82,688 KB
実行使用メモリ 851,328 KB
最終ジャッジ日時 2024-04-26 06:20:14
合計ジャッジ時間 5,625 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
60,672 KB
testcase_01 AC 61 ms
61,696 KB
testcase_02 AC 66 ms
64,640 KB
testcase_03 AC 62 ms
64,000 KB
testcase_04 AC 53 ms
60,800 KB
testcase_05 AC 69 ms
65,408 KB
testcase_06 AC 59 ms
61,952 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())
dp = [[False] * (2 ** 15) for i in range(N)]
A = list(map(int, input().split()))
dp[0][0] = True
dp[0][A[0]] = True
for i in range(1, N):
    for j in range(2 ** 15):
        dp[i][j] |= dp[i - 1][j]
        dp[i][j ^ A[i]] |= dp[i - 1][j]
ans = 0
for i in range(2 ** 15):
    if dp[-1][i]:
        ans += 1
print(ans)
0