結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー tobusakana
提出日時 2020-11-29 19:08:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,626 ms / 5,000 ms
コード長 311 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 82,472 KB
実行使用メモリ 260,288 KB
最終ジャッジ日時 2024-09-13 02:04:29
合計ジャッジ時間 16,816 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline = sys.stdin.readline

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

SIZE = 2 ** 15
dp = [False] * (SIZE)
dp[0] = True

for i in range(len(A)):
  newdp = dp.copy()
  for j in range(len(dp)):
    if not dp[j]:
      continue
    newdp[j ^ A[i]] = True
  dp = newdp

print(sum(dp))
0