結果

問題 No.183 たのしい排他的論理和(EASY)
コンテスト
ユーザー 学ぶマン
提出日時 2025-10-28 21:07:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 3,240 ms / 5,000 ms
コード長 323 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 82,524 KB
実行使用メモリ 249,012 KB
最終ジャッジ日時 2025-10-28 21:08:08
合計ジャッジ時間 21,951 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

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

limit = 2**15
DP = [False] * (limit + 1)
DP[0] = True

for i in range(N):
    a = A[i]
    nDP = [False] * (limit + 1)
    for j in range(limit + 1):
        if DP[j]:
            nDP[j] = True
            nDP[j ^ a] = True
    DP = nDP

ans = DP.count(True)
print(ans)
0