結果
問題 |
No.2672 Subset Xor Sum
|
ユーザー |
![]() |
提出日時 | 2024-03-15 21:42:57 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 454 bytes |
コンパイル時間 | 227 ms |
コンパイル使用メモリ | 82,384 KB |
実行使用メモリ | 382,252 KB |
最終ジャッジ日時 | 2024-09-30 00:37:06 |
合計ジャッジ時間 | 11,396 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 56 RE * 10 |
ソースコード
import sys input = lambda: sys.stdin.readline().strip() def Map(): return list(map(int,input().split())) N = int(input()) A = Map() g = 0 for a in A: g ^= a if g != 0: print('No') exit() M = 1 << 13 dp = [0 for j in range((N+1)*M)] for n in range(N-1): a = A[n] dp[(n+1)*M + a] = 1 for j in range(M): if dp[n*M+j] == 1: dp[(n+1)*M+j] = 1 dp[(n+1)*M + (a^j)] = 1 if dp[(N-1)*M + 0] == 1: print('Yes') else: print('No')