結果
問題 |
No.2672 Subset Xor Sum
|
ユーザー |
![]() |
提出日時 | 2024-03-15 22:01:00 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 429 bytes |
コンパイル時間 | 597 ms |
コンパイル使用メモリ | 82,532 KB |
実行使用メモリ | 142,484 KB |
最終ジャッジ日時 | 2024-09-30 01:11:38 |
合計ジャッジ時間 | 6,276 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 57 WA * 9 |
ソースコード
N=int(input()) A=list(map(int, input().split())) c=0 for a in A: c^=a if c!=0: print('No') exit() if len(A)!=len(set(A)): print('Yes') exit() if 0 in set(A): print('Yes') exit f=-1 dp=[0]*8192 for j in range(N-1): a=A[j] ndp=[0]*8192 for i in range(8192): if dp[i]==1: ndp[i]=1 ndp[i^a]=1 dp=ndp dp[a]=1 if dp[0]==1: f=1 break if f==1: print('Yes') else: print('No')