結果
| 問題 | No.2672 Subset Xor Sum |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-15 21:40:29 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 128 ms / 2,000 ms |
| + 583µs | |
| コード長 | 376 bytes |
| 記録 | |
| コンパイル時間 | 228 ms |
| コンパイル使用メモリ | 95,824 KB |
| 実行使用メモリ | 146,036 KB |
| 最終ジャッジ日時 | 2026-09-06 12:02:50 |
| 合計ジャッジ時間 | 7,997 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 66 |
ソースコード
N = int(input())
A = list(map(int, input().split()))
x = 0
for i in A:
x ^= i
if x != 0:
exit(print("No"))
if 0 in A:
exit(print("Yes"))
if N >= 9000:
exit(print("Yes"))
dp = [0] * 9001
for i in A[1:]:
ndp = [0] * 9001
ndp[i] += 1
for j in range(9001):
if i ^ j <= 9000:
ndp[j] += dp[j]
ndp[i ^ j] += dp[j]
if ndp[0]:
exit(print("Yes"))
dp = ndp
print("No")