結果
| 問題 |
No.2672 Subset Xor Sum
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-15 23:30:01 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,108 bytes |
| コンパイル時間 | 182 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 302,044 KB |
| 最終ジャッジ日時 | 2024-09-30 03:04:26 |
| 合計ジャッジ時間 | 6,317 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 29 TLE * 1 -- * 36 |
ソースコード
import sys
# import bisect #二分探索
# import math
from collections import deque
from collections import defaultdict
def I():
return int(sys.stdin.readline().rstrip())
def MI():
return map(int, sys.stdin.readline().rstrip().split())
def LI():
return list(map(int, sys.stdin.readline().rstrip().split()))
def LI2():
return list(map(int, sys.stdin.readline().rstrip()))
def S():
return sys.stdin.readline().rstrip()
def LS():
return list(sys.stdin.readline().rstrip().split())
def LS2():
return list(sys.stdin.readline().rstrip())
# 1次元の配列
# list(map(int, input().split()))
# 2次元の配列
# [list(map(int, input().split())) for i in range()]
# wsl pypy3 ファイル名
input = sys.stdin.readline
from collections import Counter, defaultdict
n = I()
a_cnt = Counter(LI())
dp = defaultdict(int)
dp[0] = 1
for a in sorted(a_cnt.keys()):
ndp = defaultdict(int)
mul = 1 << (a_cnt[a] - 1)
for v, c in dp.items():
ndp[v] += c * mul
ndp[v ^ a] += c * mul
dp = ndp
if dp[0] ==2:
print("No")
else:
print("Yes")